Facebook应用程序邀请的iOS SDK无法显示邀请VC
问题描述:
所以这是我的应用程序代码的邀请:Facebook应用程序邀请的iOS SDK无法显示邀请VC
private func inviteFriends() {
let content = FBSDKAppInviteContent()
content.appLinkURL = URL(string: "...")
content.appInvitePreviewImageURL = URL(string: "...")
FBSDKAppInviteDialog.show(from: self, with: content, delegate: nil)
}
此代码工作正常,但如果我尝试添加促销代码:
private func inviteFriends() {
let content = FBSDKAppInviteContent()
content.appLinkURL = URL(string: "...")
content.appInvitePreviewImageURL = URL(string: "...")
content.promotionCode = "preview"
content.promotionText = "Use the *preview* code to unlock the app"
FBSDKAppInviteDialog.show(from: self, with: content, delegate: nil)
}
邀请VC不再显示(该函数被调用,但没有显示)。我在这里错过了什么?
答
的问题是,我用特殊字符像*
所以删除它使应用程序正常工作我最终的代码是这样的:
private func inviteFriends() {
let content = FBSDKAppInviteContent()
content.appLinkURL = URL(string: "...")
content.appInvitePreviewImageURL = URL(string: "...")
content.promotionCode = "preview"
content.promotionText = "Use the preview code to unlock the app"
FBSDKAppInviteDialog.show(from: self, with: content, delegate: nil)
}
你试过初始化FBSDKAppInviteDialog对象,然后调用这个节目? –
不,我只是试图按照这个:https://developers.facebook.com/docs/app-invites/ios – Chlebta