共享应用程序时产生的“FBAppCall无效使用”错误 – Facebook应用程序ID未注册为URLscheme

我试图通过共享对话框通过Facebook分享我的应用程序,下面的代码:

NSMutableDictionary<FBGraphObject> *object = [FBGraphObject openGraphObjectForPostWithType:@"whatsyourinneragefb:inner_age" title:@"What's Your Inner Age" image:@"https://fbstatic-a.akamaihd.net/images/devsite/attachment_blank.png" url:@"http://samples.ogp.me/578838518886846" description:@"Everyone's finding out their inner ages apart from you! Download now and discover yours!"];; NSLog(@"1"); // Create an action NSMutableDictionary<FBGraphObject> *action = [FBGraphObject graphObject]; action[@"inner_age"] = @"http://samples.ogp.me/578838518886846"; NSLog(@"2"); [FBRequestConnection startForPostWithGraphPath:@"fb578756542228377" graphObject:action completionHandler:^(FBRequestConnection *connection, id result, NSError *error) { // handle the result }]; NSLog(@"3"); // Link the object to the action [action setObject:object forKey:@"whatsyourinneragefb:inner_age"]; NSLog(@"4"); // Check if the Facebook app is installed and we can present the share dialog FBOpenGraphActionParams *params = [[FBOpenGraphActionParams alloc] init]; params.action = action; params.actionType = @"whatsyourinneragefb:inner_age"; NSLog(@"5"); // If the Facebook app is installed and we can present the share dialog if([FBDialogs canPresentShareDialogWithOpenGraphActionParams:params]) { // Show the share dialog [FBDialogs presentShareDialogWithOpenGraphAction:action actionType:@"whatsyourinneragefb:inner_age" previewPropertyName:@"whatsyourinneragefb:inner_age" handler:^(FBAppCall *call, NSDictionary *results, NSError *error) { if(error) { // There was an error NSLog([NSString stringWithFormat:@"Error publishing story: %@", error.description]); } else { // Success NSLog(@"result %@", results); } }]; NSLog(@"6"); // If the Facebook app is NOT installed and we can't present the share dialog } else { // FALLBACK GOES HERE NSLog(@"You don't have Facebook!"); } 

但是,当我分享应用程序时,会产生以下错误:

 FBSDKLog: Invalid use of FBAppCall, fb578756542228377 is not registered as a URL Scheme. Did you set 'FacebookUrlSchemeSuffix' in your plist? 

但是,我在代码中使用的ID与在我的info.plist文件中使用的ID相同,如以下屏幕截图所示:

在这里输入图像说明

此外,日志build议产生错误的代码在“5”和“6”的日志之间 ,如果这有帮助的话。

尝试添加其他方式的架构,如下所示: