我已经在 facebook.developer 中成功创建了 AppId。我还在 info.plist 文件中添加了 urlscheme。
这是我的代码
var inviteDialog : FBSDKAppInviteDialog = FBSDKAppInviteDialog()
if(inviteDialog.canShow()){
let appLinkUrl:NSURL = NSURL(string: "https://fb.me/*******")!
let previewImageUrl:NSURL = NSURL(string: "http://yourwebpage.com/preview-image.png")!
let inviteContent:FBSDKAppInviteContent = FBSDKAppInviteContent()
inviteContent.appLinkURL = appLinkUrl as URL!
inviteContent.appInvitePreviewImageURL = previewImageUrl as URL!
inviteDialog.content = inviteContent
inviteDialog.delegate = self
inviteDialog.show()
}
不显示邀请对话框出现错误