Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to access data across 2 different iOS apps?

Tags:

ios

iphone

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?

like image 502
locoboy Avatar asked Jan 19 '12 02:01

locoboy


2 Answers

You can use the iOS keychain. Here's a good tutorial on keychain access groups.

like image 153
John Estropia Avatar answered Sep 20 '22 17:09

John Estropia


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];
} 
like image 24
Amit Avatar answered Sep 21 '22 17:09

Amit