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?
Asked
Active
Viewed 4,222 times
6
-
1Have you considered iCloud or Dropbox? – Brian Willis Jan 19 '12 at 02:03
-
1An app can respond to a particular type of URL, so App1 can register to respond to App1://foo/bar urls and App2 can access that url. – Paul Tomblin Jan 19 '12 at 02:05
-
@BrianWillis what if the device doesn't have iCloud or Dropbox? – locoboy Jan 19 '12 at 02:36
-
@PaulTomblin, but if you had to deal with multiple installations of the app, how can you deal with this without using the deprecated UDID? – locoboy Jan 19 '12 at 02:42
-
@cfarm54, How can you have multiple installations of an app on a single device? – Paul Tomblin Jan 19 '12 at 13:32
-
@PaulTomblin if you have device1 with App1 and App2 and device2 with App1 and App2 how can you make sure your URL/service doesn't mix up the data between the devices? – locoboy Jan 19 '12 at 14:42
-
Because they only work on the same device. Which is exactly what you asked for in your question. – Paul Tomblin Jan 19 '12 at 14:56
-
sorry i might be misunderstanding then. it sounds like i'll need to learn more about what URLs can do. – locoboy Jan 19 '12 at 15:27
3 Answers
3
You can use the iOS keychain. Here's a good tutorial on keychain access groups.

John Estropia
- 17,460
- 4
- 46
- 50
2
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.

Peter Sarnowski
- 11,900
- 5
- 36
- 33
2
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];
}