FBSDKShareDialog cancels when it should post

后端 未结 4 1842
南笙
南笙 2021-01-01 22:00

I create a FBSDKShareDialog in code

- (void)shareWithFacebookDialog;
{  
  FBSDKShareLinkContent* content = [[FBSDKShareLinkContent alloc] init];
  content.c         


        
4条回答
  •  無奈伤痛
    2021-01-01 22:42

    This happened to me when I tried to call the method right after login.

    FBSDKLoginManager *login = [[FBSDKLoginManager alloc] init];
        [login logInWithPublishPermissions:@[@"publish_actions"] handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) {
            if (error || result.isCancelled) {
    
            } else {
                [self shareWithFacebookDialog];
            }
        }];
    

    It works if I just call it without logging in (should already have valid token).

    if ([FBSDKAccessToken currentAccessToken]) {
        [self shareWithFacebookDialog];
    }
    

提交回复
热议问题