Facebook SDK 3.1 presentShareDialogModally fails

前端 未结 3 698
北荒
北荒 2021-01-13 15:52

I\'m trying to test out the new built-in share \"sheet\" for Facebook on iOS 6 but when I run the sample code it doesn\'t show the sheet. Instead it posts a status for me wi

3条回答
  •  有刺的猬
    2021-01-13 16:54

    You are missing some of the required frameworks:

    AdSupport.framework

    Account.framework

    Social.framework

    BOOL displayedNativeDialog =
    [FBNativeDialogs
     presentShareDialogModallyFrom:self
     initialText:self.shareText
     image:nil
     url:nil
     handler:^(FBNativeDialogResult result, NSError *error) {
         if (error) {
             /* handle failure */
             NSLog(@"error:%@, %@", error, [error localizedDescription]);
         } else {
             if (result == FBNativeDialogResultSucceeded) {
                 /* handle success */
                 NSLog(@"handle success");
             } else {
                 /* handle user cancel */
                 NSLog(@"user cancel");
             }
         }
     }];
    if (!displayedNativeDialog) {
        /* handle fallback to native dialog  */
    }
    

提交回复
热议问题