Facebook应用程序邀请iOS SDK可以';不要显示邀请

Facebook应用程序邀请iOS SDK可以';不要显示邀请,ios,swift,facebook,cocoa-touch,Ios,Swift,Facebook,Cocoa Touch,这是我的应用程序邀请代码: private func inviteFriends() { let content = FBSDKAppInviteContent() content.appLinkURL = URL(string: "...") content.appInvitePreviewImageURL = URL(string: "...") FBSDKAppInviteDialog.show(from: self, with: content,

这是我的应用程序邀请代码:

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)
}

不再显示invite 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对象,然后调用show?没有,我只是尝试遵循以下步骤: