【问题标题】:Expo Magic Link and Deep LinkingExpo Magic Link 和 Deep Linking
【发布时间】:2020-12-24 22:27:39
【问题描述】:
  const expoLink = Linking.makeUrl();
  const actionCodeURL =
    " what to write here" + `?redirectUrl=${encodeURIComponent(expoLink)}`;
    
  //sending signInLinkToEmail
  const handlePress = () => {
    firebase
      .auth()
      .sendSignInLinkToEmail(email, {
        url: actionCodeURL, // what should be its value so that on clicking this will redirect them to app.
        handleCodeInApp: true,
      })
      .then(()=>{});
  };

我正在尝试使用 firebase 在我的 expo 应用程序中进行身份验证。我想实现 sendSignInLinkToEmail 以便用户在他/她的电子邮件中收到一个链接。当用户点击链接时,他/她应该被重定向到应用程序。

我卡在 sendSignInLinkToEmail 函数的第二个参数的 URL 部分。

【问题讨论】:

    标签: firebase react-native firebase-authentication expo


    【解决方案1】:

    对于你想要的用途,你只需要给出android和ios参数。这些是您的 android 和 ios 应用在 Firebase 控制台中的项目 ID。

    https://firebase.google.com/docs/auth/web/email-link-auth#send_an_authentication_link_to_the_users_email_address

    【讨论】:

    • 如何在 Expo 中获取 ios 和 Andriod 捆绑 ID?
    • 对于Android,进入你的app文件夹中的android文件夹,然后它应该在build/app/build.gradle文件中,然后在gradle文件中:android => default config => applicationId For iOS,你应该在打开 xCode 并转到 Runner 和常规选项卡时找到它
    • 我希望在不弹出 expo 应用程序的情况下完成此操作。
    猜你喜欢
    • 2022-07-27
    • 2014-01-20
    • 2022-08-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-27
    • 1970-01-01
    相关资源
    最近更新 更多