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
。 所以我有两个问题:
-
当发送邀请时,可以自动closures
FBSDKAppInviteDialog
(现在是邀请发送后的FBSDKAppInviteDialog
,redirect到我的Facebook个人资料页面而没有closures本身)? 我认为这是ios中任何模态视图的自然stream动/行为。 -
为什么我从
didCompleteWithResults
总是收到“(null)”? 我需要知道有多less朋友给我发了邀请。
您的应用链接url不正确。 (你不能插入任何url)
创build一个应用程序链接url: https : //developers.facebook.com/quickstarts
应该看起来像:例如: https : //fb.me/ “1234567889”
- 找不到“FBLoginViewDelegate”的协议声明
- IOS Facebook的SDK邀请缺less应用程序链接的URL
- facebook快速parsing注册
- iOS开发:我怎样才能得到一个Facebook的墙上post显示在朋友的新闻提要?
- 升级到SDK 4.1后,Facebooklogin失败(总是被取消)
- ABMultiValueGetCount – kABPersonSocialProfileProperty总是返回0? 我怎样才能从地址簿获得Facebook的细节?
- 调用时出现“Error Code 8” – iOS
- 强制iOS Facebook应用程序在浏览器中打开馈送链接,而不是在WebView中
- Facebook API分页不起作用