所以我在我的应用程序中只做一个基本的facebook分享,它在我的设备(iPhone 6 OS 9.1和iPad air 9.02)上工作正常,但对我的同事iPad Air 2 8.4.1不起作用或iPhone 6 Plus 9.1。任何人都有任何线索,为什么会这样?
他们在设备设置中登录到Facebook。他们还安装了Facebook应用程序(我没有应用程序,只是通过设置登录)
这是我的设备的屏幕截图,显示要分享的信息,其他设备只显示图片而没有文字。
这是我用来分享的代码
- (void)shareTapped {
UIImage *image = self.pictureView.image;
NSString *postText = [NSString stringWithFormat:@"%@\n*%@\n%@\n%@, %@ %@", self.event.shortDescription, self.event.eventCode, self.event.address, self.event.city, self.event.state, self.event.zip];
[[UtilitiesObject sharedInstance] shareMessage:postText image:image parentVC:self];
}
- (void)shareMessage:(NSString *)msg image:(UIImage *)image parentVC:(UIViewController *)parentVC {
NSArray *activityItems = @[msg];
if (image) {
activityItems = @[msg, image];
}
UIActivityViewController *activityController = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:nil];
// Tailor the list of services displayed
activityController.excludedActivityTypes = @[UIActivityTypeAssignToContact,
//UIActivityTypePostToFacebook,
//UIActivityTypePostToTwitter,
//UIActivityTypeMail,
UIActivityTypeMessage,
UIActivityTypeSaveToCameraRoll,
UIActivityTypePrint,
UIActivityTypePostToWeibo,
UIActivityTypeCopyToPasteboard];
activityController.popoverPresentationController.sourceView = parentVC.view;
[activityController setCompletionWithItemsHandler:
^(NSString *activityType, BOOL completed, NSArray *returnedItems, NSError *activityError) {
if ([activityType isEqualToString: UIActivityTypeMail]) {
NSLog(@"Mail");
}
if ([activityType isEqualToString:UIActivityTypePostToFacebook]) {
NSLog(@"Facebook");
}
if ([activityType isEqualToString:UIActivityTypePostToTwitter]) {
NSLog(@"Twitter");
}
}];
[parentVC presentViewController:activityController animated:YES completion:nil];
}
答案 0 :(得分:0)
Facebook的平台政策不允许应用预先填写消息字段。在这种情况下,由于您没有Facebook应用程序,它使用Apple的共享表,这允许预填充但违反FB的平台策略。在您的朋友案例中,他们可能会看到Facebook应用的分享扩展,这正确地执行了该政策,并且不允许预填充。