Objective c Instagram故事分享可以';无法通过登录页面
我有一个应用程序,用户正在通过该应用程序与它共享屏幕截图。该应用程序是实时的,并且工作正常。现在,我意识到当用户点击instagram story share时,它只会进入登录页面。即使用户登录instagram并从我的应用程序中重新单击以分享故事,它仍然会进入instagram登录页面。这是什么问题Objective c Instagram故事分享可以';无法通过登录页面,objective-c,xcode,instagram,instagram-api,Objective C,Xcode,Instagram,Instagram Api,我有一个应用程序,用户正在通过该应用程序与它共享屏幕截图。该应用程序是实时的,并且工作正常。现在,我意识到当用户点击instagram story share时,它只会进入登录页面。即使用户登录instagram并从我的应用程序中重新单击以分享故事,它仍然会进入instagram登录页面。这是什么问题 - (IBAction)instagramClicked:(id)sender { [FIRAnalytics logEventWithName:@"instagram_share"
- (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应用程序当前版本的一个bug。你必须等待更新,甚至他们的应用程序(如Boomerang)在分享到Instagram时也会被破坏