|
|
|
I used this code for share image with instagram and this is working with iOS 6.0 but it is not working with iOS 7. |
|
|
|
|
|
|
|
I used this code for share image with instagram and this is working with iOS 6.0 but it is not working with iOS 7.
Code (Objective-C)
-(IBAction)ShareWithInstagram:(id)sender
{
NSURL *instagramURL = [NSURL URLWithString:@"instagram://app"];
if ([[UIApplication sharedApplication] canOpenURL:instagramURL]) {
NSString *documentsDirectory = [NSString stringWithFormat:@"%@/brimages/",[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES)objectAtIndex:0]];
NSFileManager *manager = [NSFileManager defaultManager];
NSArray *imageFilenames = [manager contentsOfDirectoryAtPath:documentsDirectory error:nil];
NSString *imageName = [imageFilenames objectAtIndex:page];
NSString *fullpath = [NSString stringWithFormat:@"%@%@",documentsDirectory,imageName];
NSString *fullpath1 = [NSString stringWithFormat:@"%@",fullpath];
//imageToUpload is a file path with .ig file extension
self.documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:fullpath1]];
self.documentInteractionController.UTI = @"com.instagram.exclusivegram";
self.documentInteractionController.annotation = [NSDictionary dictionaryWithObject:@"my caption" forKey:@"InstagramCaption"];
[self.documentInteractionController presentOpenInMenuFromRect:[sender frame] inView:self.view animated:YES];
}
Tag : Mobile, iOS, iPad, Objective-C, Mac
|
|
|
|
|
|
Date :
2014-01-21 14:52:27 |
By :
Henry |
View :
1176 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
You have error message?
|
|
|
|
|
Date :
2014-01-21 20:01:33 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|