【问题标题】:Examples of Facebook AppInvites with Branch.io in SwiftSwift 中带有 Branch.io 的 Facebook AppInvites 示例
【发布时间】:2015-06-11 07:47:16
【问题描述】:

Branch 有很好的示例,说明如何在 Swift 中使用 AppLinks 创建深层链接,但我找不到任何有关如何在 Swift 中创建 Facebook 的 AppInvites 的示例。有人做过吗?

【问题讨论】:

    标签: swift deep-linking applinks branch.io


    【解决方案1】:

    此处解决方案的工作分支:Swift implementation of FBSDKAppInviteDialogDelegate not working

    生成分支 URL 并从那里的回调中显示共享对话框。

    var inviteDialog: FBSDKAppInviteDialog = FBSDKAppInviteDialog()
    
    Branch.getInstance().getShortURLWithParams(params, andChannel: "facebook", andFeature: "app_invite", andCallback: { (branchUrl: String?, error: NSError?) -> Void in
    
                    if error == nil {
    
                    var inviteContent: FBSDKAppInviteContent = FBSDKAppInviteContent()
    
                    inviteContent.appLinkURL = NSURL(string: branchUrl!)!
    
                    inviteDialog.content = inviteContent
                    inviteDialog.delegate = self
                    inviteDialog.show()
                }
            })
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-07-19
      • 2011-02-22
      • 2014-12-28
      • 1970-01-01
      • 2016-06-25
      • 2015-02-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多