【问题标题】:UIDocumentInteractionController in iOS 9 Not Showing Instagram App By ItselfiOS 9 中的 UIDocumentInteractionController 本身不显示 Instagram 应用程序
【发布时间】:2015-10-30 04:53:27
【问题描述】:

我正在使用以下 Instagram 挂钩将图像发布到 Instagram。在 iOS 8 中,Instagram 应用程序在 UIDocumentInteractionController 中单独显示,但在 iOS 9 中,它会在旁边显示其他选项。任何人都知道这可能是为什么以及如何解决这个问题,以便只有 Instagram 再次显示?

UIImage *screenShot = self.shareableImage.image;
NSString *savePath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/Test.ig"];
[UIImagePNGRepresentation(screenShot) writeToFile:savePath atomically:YES];

CGRect rect = CGRectMake(0 ,0 , 0, 0);


NSURL *instagramURL = [NSURL URLWithString:@"instagram://media?id=MEDIA_ID"];

NSString *documentDirectory = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];
// *.igo is exclusive to instagram
NSString *saveImagePath = [documentDirectory stringByAppendingPathComponent:@"Image.igo"];
NSData *imageData = UIImagePNGRepresentation(screenShot);
[imageData writeToFile:saveImagePath atomically:YES];

NSURL *imageURL=[NSURL fileURLWithPath:saveImagePath];

self.dic=[[UIDocumentInteractionController alloc]init];
self.dic.delegate=self;
self.dic.UTI=@"com.instagram.photo";
[self.dic setURL:imageURL];

if ([[UIApplication sharedApplication] canOpenURL:instagramURL]) {

    [self.dic presentOpenInMenuFromRect: rect    inView: self.view animated: YES ];

}
else
{
    UIAlertView *alert = [[UIAlertView alloc]initWithTitle:[NSString stringWithFormat:NSLocalizedString(@"imageShareViewNoInstagramAccountAlertTitle", nil)] message:[NSString stringWithFormat:NSLocalizedString(@"imageShareViewNoInstagramAccountAlertMessage", nil)]delegate:nil cancelButtonTitle:[NSString stringWithFormat:NSLocalizedString(@"imageShareViewNoFacebookAccountAlertCancelButton", nil)]otherButtonTitles:nil, nil];


    [alert show];

}

- (UIDocumentInteractionController *) setupControllerWithURL: (NSURL*) fileURL usingDelegate: (id <UIDocumentInteractionControllerDelegate>) interactionDelegate
{
UIDocumentInteractionController *interactionController = [UIDocumentInteractionController interactionControllerWithURL: fileURL];
interactionController.delegate = interactionDelegate;
return interactionController;
}

【问题讨论】:

  • 我遇到了同样的问题。

标签: ios controller hook instagram uidocumentinteraction


【解决方案1】:

尝试将com.instagram.photo 更改为com.instagram.exclusivegram

干杯!

【讨论】:

  • 这并没有提供问题的答案。要批评或要求作者澄清,请在他们的帖子下方发表评论 - 您可以随时评论自己的帖子,一旦您有足够的reputation,您就可以comment on any post
  • 根据 Instagram 官方文档,应该可以解决问题。
  • 但是没有
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-12-16
  • 2017-06-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多