Instagram故事分享无法通过登录页面



>我有一个应用程序,用户正在从该应用程序与它共享屏幕截图。该应用程序已上线,并且工作正常。如今,我意识到当用户点击Instagram故事分享时,它只会进入登录页面。即使用户登录Instagram并从我的应用程序重新点击以分享故事,它仍然会转到Instagram登录页面。这是什么问题?

- (IBAction)instagramClicked:(id)sender
{
[FIRAnalytics logEventWithName:@"instagram_share"
parameters:@{
@"name": @"instagram_share",
@"full_text": @"instagram_share"
}];
[self backgroundImage:UIImagePNGRepresentation([self getScreenshot])
attributionURL:@"abcapp://"];
}
//Get image of the view
- (UIImage *)getScreenshot {
CGRect rect = [_shareView bounds];
UIGraphicsBeginImageContextWithOptions(rect.size,NO,2.0f);
CGContextRef context = UIGraphicsGetCurrentContext();
[_shareView.layer renderInContext:context];
UIImage *capturedScreen = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return capturedScreen;
}
- (void)backgroundImage:(NSData *)backgroundImage
attributionURL:(NSString *)attributionURL {
// Verify app can open custom URL scheme, open if able
NSURL *urlScheme = [NSURL URLWithString:@"instagram-stories://share"];
if ([[UIApplication sharedApplication] canOpenURL:urlScheme]) {
// Assign background image asset and attribution link URL to pasteboard
NSArray *pasteboardItems = @[@{@"com.instagram.sharedSticker.backgroundImage" : backgroundImage,
@"com.instagram.sharedSticker.contentURL" : attributionURL}];
NSDictionary *pasteboardOptions = @{UIPasteboardOptionExpirationDate : [[NSDate date] dateByAddingTimeInterval:60 * 5]};
// This call is iOS 10+, can use 'setItems' depending on what versions you support
[[UIPasteboard generalPasteboard] setItems:pasteboardItems options:pasteboardOptions];
[[UIApplication sharedApplication] openURL:urlScheme options:@{} completionHandler:nil];
} else {
// Handle older app versions or app not installed case
}
}

这是当前版本的Instagram应用程序的错误。您必须等待更新,甚至他们的应用程序(如 回旋镖( 在分享到 Instagram 时也会损坏。

最新更新