ios - 如何通过 Firebase 邀请通过动态链接发送用户信息

标签 ios swift firebase firebase-dynamic-links firebase-invites

我正在尝试在我的应用中实现 Firebase 邀请功能。主要逻辑是用户在联系人列表中选择他/她的 friend ,他们将通过 Firebase Invites 发送邀请来实现此目的,我想发送一些有关用户的和平信息以供我的应用程序识别。在另一端,他/她的 friend 将通过电子邮件/短信收到动态链接(我认为这就是 Firebase 邀请的工作方式),如果他/她打开它,则根据该动态链接中的数据,用户将要求添加他作为他/她的 friend 。 根据 Firebase 文档,我可以看到这段代码

if let invite = FIRInvites.inviteDialog() {
    invite.setInviteDelegate(self)

// NOTE: You must have the App Store ID set in your developer console project   
    // in order for invitations to successfully be sent.

    // A message hint for the dialog. Note this manifests differently   depending on the
    // received invation type. For example, in an email invite this appears as the subject.

    invite.setMessage("Try this out!\n -(GIDSignIn.sharedInstance().currentUser.profile.name)")

// Title for the dialog, this is what the user sees before 
sending the invites.
        invite.setTitle("Invites Example")
        invite.setDeepLink("app_url")
        invite.setCallToActionText("Install!")
        invite.setCustomImage("https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png")
        invite.open()
      }

我的问题是如何创建一个包含用户信息的“app_url”以在 invite.setDeepLink("app_url") 方法中发送。以及在好友端如何处理。

谢谢。

最佳答案

在 Firebase 控制台中创建动态链接:

  1. 打开 Firebase 控制台。
  2. 通过单击侧边栏菜单上的“动态链接”打开“动态链接”页面。在此页面上,您可以看到动态链接及其点击率的列表。
  3. 点击“新建动态链接”并确保选择“生成动态链接”。
  4. 提供动态链接的基本信息。 see documentation here

不确定是否在“ friend 方”处理它。

关于ios - 如何通过 Firebase 邀请通过动态链接发送用户信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38721861/

相关文章:

ios - MapBox 加载了错误的 map

ios - 从 UITableViewController 重新加载 tableView

node.js - 如何在 firebase node.js 云函数中推送通知?

swift - 如何使用调用站点上下文来报告/传播 Firestore 错误至 recordError

ios - 如何在 iPhone 上解压缩从服务器接收到的文件?

ios - 导航回父场景时解除 segue 问题

快速代码生成文件错误

android - 由以下原因引起:org.gradle.api.tasks.TaskExecutionException:任务 ':app:processDebugGoogleServices'的执行失败

ios - 插入 UIImageView?

ios - Swift UIButton 操作和 GestureRecognizer