FBSDKShareDialog cancels when it should post

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

I create a FBSDKShareDialog in code

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


        
4条回答
  •  天涯浪人
    2021-01-01 23:03

    I had the same problem: Facebook SDK share always returns sharerDidCancel

    My error was in the AppDelegate method:

    here is a link with the solution http://jitu1990.blogspot.it/2015/05/share-with-facebook-from-ios-app.html

    And here is the code

    - (BOOL)application:(UIApplication *)application openURL:(NSURL* )url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {   
        return [[FBSDKApplicationDelegate sharedInstance] application:application
                                                          openURL:url sourceApplication:sourceApplication annotation:annotation];
    }
    
    - (void)applicationDidBecomeActive:(UIApplication *)application {
        [FBSDKAppEvents activateApp];
    }
    
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
        return [ [FBSDKApplicationDelegate sharedInstance] application :application
                 didFinishLaunchingWithOptions:launchOptions]
      }
    

提交回复
热议问题