我在我的应用程序中添加了facebook app邀请功能,这是我的代码发送应用程序邀请
let content = FBSDKAppInviteContent()
content.appLinkURL = NSURL(string: "applinkurl")
content.appInvitePreviewImageURL = NSURL(string: "appInvitePreviewImageURL")
FBSDKAppInviteDialog.showWithContent(content, delegate: self);
我在课程
中添加了以下扩展名extension FACEBOOKTEXT:FBSDKAppInviteDialogDelegate {
//MARK: FBSDKAppInviteDialogDelegate
func appInviteDialog(appInviteDialog: FBSDKAppInviteDialog!, didCompleteWithResults results: [NSObject : AnyObject]!) {
print("invitation made")
}
func appInviteDialog(appInviteDialog: FBSDKAppInviteDialog!, didFailWithError error: NSError!) {
print("error made")
}
app appate中的:
func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject?) -> Bool {
var shouldReturn:Bool = FBSDKApplicationDelegate.sharedInstance().application(application, openURL: url, sourceApplication: sourceApplication, annotation: annotation);
shouldReturn = shouldReturn || GIDSignIn.sharedInstance().handleURL(url, sourceApplication: sourceApplication, annotation: annotation);
shouldReturn = shouldReturn || Instagram.sharedManager().handleOpenURL(url);
shouldReturn = shouldReturn || LinkedInBridge.handleURL(application, openURL: url, sourceApplication: sourceApplication, annotation: annotation);
return shouldReturn;
}
我已经配置了" App Links"来自facebook portal nd将其放入infi.plist和content.appLinkURL。
在运行此代码时,会发送应用邀请。当应用程序邀请的接收者在Android上时,邀请被列在facebook的通知感觉中并且使用能够通过它安装app。但是,如果邀请的接收者在iOS上,则邀请未列在使用的通知订阅源中,但是如果用户转到Facebook - >更多(标签) - >应用 - >应用程序邀请,此处列出了邀请。
请指导我做错的地方。我该怎么办才能在iOS中列出通知中的邀请,就像安卓一样。 我正在使用Xcode 6.4和Swift 1.2 这适用于iOS 8,但不适用于iOS 9
提前致谢,
答案 0 :(得分:0)
将以下网址方案添加到您的info.plist,以使其在iOS 9中正常运行
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>
<string>fbapi20130214</string>
<string>fbapi20130410</string>
<string>fbapi20130702</string>
<string>fbapi20131010</string>
<string>fbapi20131219</string>
<string>fbapi20140410</string>
<string>fbapi20140116</string>
<string>fbapi20150313</string>
<string>fbapi20150629</string>
<string>fbapi20160328</string>
<string>fbauth</string>
<string>fbauth2</string>
<string>fb-messenger-api20140430</string>
<string>fb-messenger-platform-20150128</string>
<string>fb-messenger-platform-20150218</string>
<string>fb-messenger-platform-20150305</string>
<string>fb-messenger-api</string>
<string>fbshareextension</string>
</array>
另外做两件事 1.打开facebook.com - &gt;设置 - &gt;应用 - &gt;如果已经为应用授予了权限,则删除您的应用
希望这对你有用。