FBSDKAppInviteDialog的closures和结果总是奇怪的行为(null)

我正在尝试在我的Ios应用程序中实现应用程序邀请stream程。 这是我使用的代码:

-(void)Invite{ FBSDKAppInviteContent *content =[[FBSDKAppInviteContent alloc] init]; content.appLinkURL = [NSURL URLWithString:@"http://www.sdfsdfadfa.net"]; // present the dialog. Assumes self implements protocol `FBSDKAppInviteDialogDelegate` [FBSDKAppInviteDialog showFromViewController:self withContent:content delegate:self]; } -(void)appInviteDialog:(FBSDKAppInviteDialog *)appInviteDialog didCompleteWithResults:(NSDictionary *)results { NSLog(@"result::%@",results); } -(void)appInviteDialog:(FBSDKAppInviteDialog *)appInviteDialog didFailWithError:(NSError *)error { NSLog(@"error::%@",error); } 

这是我的应用程序链接如下所示:

 <html> <head> <meta property="al:ios:url" content="my-app://" /> <meta property="al:ios:app_store_id" content="fake2342" /> <meta property="al:ios:app_name" content="Myapp" /> <meta property="og:title" content="my app" /> <meta property="og:type" content="website" /> <!-- Other headers --> </head> <!-- Other HTML content --> </html> </head> 

这是如何看起来像我的url计划

 <key>CFBundleURLTypes</key> <array> <dict> <key>CFBundleURLSchemes</key> <array> <string>my-app</string> </array> </dict> </array> 

邀请被正确地发送给我select的朋友,但是appInviteDialog didCompleteWithResult总是返回'(null)'。 DidCompleteWithResult只会在FBSDKAppInviteDialog右上angular的“closures”时被FBSDKAppInviteDialog 。 所以我有两个问题:

  • 当发送邀请时,可以自动closuresFBSDKAppInviteDialog (现在是邀请发送后的FBSDKAppInviteDialog ,redirect到我的Facebook个人资料页面而没有closures本身)? 我认为这是ios中任何模态视图的自然stream动/行为。

  • 为什么我从didCompleteWithResults总是收到“(null)”? 我需要知道有多less朋友给我发了邀请。

您的应用链接url不正确。 (你不能插入任何url)

创build一个应用程序链接url: https : //developers.facebook.com/quickstarts

应该看起来像:例如: https : //fb.me/ “1234567889”