iOS sdk和Instagram

iOS sdk和Instagram,第1张

概述有没有办法在分享图像到Instagram后打开我的应用程序? 我对Instagram代码的分享: [Utils saveImage:self.pickedImage withName:@"image.igo"];CGRect rect = CGRectMake(0 ,0 , 0, 0);NSArray *paths = NSSearchPathForDirectoriesInDomains 有没有办法在分享图像到Instagram后打开我的应用程序?

我对Instagram代码的分享:

[Utils saveImage:self.pickedImage withname:@"image.igo"];CGRect rect = CGRectMake(0,0);NSArray *paths = NSSearchPathForDirectorIEsInDomains(NSdocumentDirectory,NSUserDomainMask,YES);Nsstring *documentsDirectory = [paths objectAtIndex:0];Nsstring *imagePath = [documentsDirectory stringByAppendingPathComponent:@"image.igo"];NSURL *igImageHookfile = [NSURL fileURLWithPath:imagePath];self.docfile=[UIdocumentInteractionController interactionControllerWithURL:igImageHookfile];self.docfile.UTI = @"com.instagram.exclusivegram";self.docfile.annotation = [NSDictionary dictionaryWithObject: self.descrText forKey:@"InstagramCaption"];NSURL *instagramURL = [NSURL URLWithString:@"instagram://media?ID=MEDIA_ID"];if ([[UIApplication sharedApplication] canopenURL:instagramURL]) {    [self.docfile presentopenInMenuFromrect: rect    inVIEw: self.vIEw animated: YES ];}else {    [Utils simpleAlertWithTitle:LOC(@"You have not Instagram app in device.") message:nil];}

此后打开分享屏幕打开Instagram应用程序.
我想在点击Instagram应用程序中的“共享”按钮后返回我的应用程序,并获得有关共享照片(userID,photoUrl等等)的回调.

可能吗?

谢谢.

解决方法
Hope this answer will resolve your query. This will directly opens library folder in Instagram instead of Camera.        NSURL *instagramURL = [NSURL URLWithString:@"instagram://app"];        if ([[UIApplication sharedApplication] canopenURL:instagramURL])        {            NSURL *vIDeofilePath = [NSURL URLWithString:[Nsstring stringWithFormat:@"%@",[request downloadDestinationPath]]]; // Your local path to the vIDeo            Nsstring *caption = @"Some Preloaded Caption";            ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];            [library writeVIDeoAtPathToSavedPhotosAlbum:vIDeofilePath completionBlock:^(NSURL *assetURL,NSError *error) {                Nsstring *escapedString   = [self urlencodedString:vIDeofilePath.absoluteString];                Nsstring *escapedCaption  = [self urlencodedString:caption];                NSURL *instagramURL = [NSURL URLWithString:[Nsstring stringWithFormat:@"instagram://library?AssetPath=%@&InstagramCaption=%@",escapedString,escapedCaption]];                if ([[UIApplication sharedApplication] canopenURL:instagramURL]) {                    [[UIApplication sharedApplication] openURL:instagramURL];                }            }];
总结

以上是内存溢出为你收集整理的iOS sdk和Instagram全部内容,希望文章能够帮你解决iOS sdk和Instagram所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1076862.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-26
下一篇 2022-05-26

发表评论

登录后才能评论

评论列表(0条)

保存