Reputation: 38960
Let's say that I store some ID data in App1 and want to access it in App2 on the same device. Is this possible on the platform? Are there any workarounds for this if not?
Upvotes: 6
Views: 4242
Reputation: 1795
Image Share Between My app to Instagram:
NSURL *instagramURL = [NSURL URLWithString:@"instagram://location?id=1"];
if ([[UIApplication sharedApplication] canOpenURL:instagramURL]) {
NSString *documentsDirectory = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];
NSString *savedImagePath = [documentsDirectory stringByAppendingPathComponent:@"Image.ig"];
NSData *imageData = UIImagePNGRepresentation(originalImageView.image);
[imageData writeToFile:savedImagePath atomically:YES];
NSURL *imageUrl = [NSURL fileURLWithPath:savedImagePath];
UIDocumentInteractionController * docController = [[UIDocumentInteractionController alloc] init];
docController.delegate = self;
[docController retain];
docController.UTI = @"com.instagram.photo";
[docController setURL:imageUrl];
[docController presentOpenInMenuFromRect:CGRectZero inView:self.view animated:YES];
}
Upvotes: 2
Reputation: 17500
You can use the iOS keychain. Here's a good tutorial on keychain access groups.
Upvotes: 3
Reputation: 11970
One workaround is to register apps as handling some filetype. When such file is about to be opened, a user gets the choice of apps that can handle it and the chosen app gets a copy of the file copied to it's ~Documents/Inbox
directory. But i think you're better with some external service.
Upvotes: 2