• <small id='aidNy'></small><noframes id='aidNy'>

    <tfoot id='aidNy'></tfoot>

      <legend id='aidNy'><style id='aidNy'><dir id='aidNy'><q id='aidNy'></q></dir></style></legend>

        <bdo id='aidNy'></bdo><ul id='aidNy'></ul>

      1. <i id='aidNy'><tr id='aidNy'><dt id='aidNy'><q id='aidNy'><span id='aidNy'><b id='aidNy'><form id='aidNy'><ins id='aidNy'></ins><ul id='aidNy'></ul><sub id='aidNy'></sub></form><legend id='aidNy'></legend><bdo id='aidNy'><pre id='aidNy'><center id='aidNy'></center></pre></bdo></b><th id='aidNy'></th></span></q></dt></tr></i><div id='aidNy'><tfoot id='aidNy'></tfoot><dl id='aidNy'><fieldset id='aidNy'></fieldset></dl></div>
      2. 世博会:“auth/operation-not-supported-in-this-environment"

        时间:2023-11-29

        <small id='9HcHm'></small><noframes id='9HcHm'>

          <bdo id='9HcHm'></bdo><ul id='9HcHm'></ul>
                <tbody id='9HcHm'></tbody>

            • <tfoot id='9HcHm'></tfoot>

                1. <legend id='9HcHm'><style id='9HcHm'><dir id='9HcHm'><q id='9HcHm'></q></dir></style></legend>

                  <i id='9HcHm'><tr id='9HcHm'><dt id='9HcHm'><q id='9HcHm'><span id='9HcHm'><b id='9HcHm'><form id='9HcHm'><ins id='9HcHm'></ins><ul id='9HcHm'></ul><sub id='9HcHm'></sub></form><legend id='9HcHm'></legend><bdo id='9HcHm'><pre id='9HcHm'><center id='9HcHm'></center></pre></bdo></b><th id='9HcHm'></th></span></q></dt></tr></i><div id='9HcHm'><tfoot id='9HcHm'></tfoot><dl id='9HcHm'><fieldset id='9HcHm'></fieldset></dl></div>
                  本文介绍了世博会:“auth/operation-not-supported-in-this-environment"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我开发了一个 react-native (expo) 移动应用,并尝试使用 google 帐户登录到 firebase,但出现错误:

                  I develop a react-native (expo) mobile app and try to sign in with a google account to firebase, but I get an error:

                  "auth/operation-not-supported-in-this-enviroment.此应用程序运行的环境不支持此操作."location.protocol" 必须是 http、https 或 chrome-extension 并且网络存储必须启用"

                  "auth/operation-not-supported-in-this-enviroment. This operation is not supported in the enviroment this application is running on. "location.protocol" must be http, https or chrome-extension and web storage must be enabled"

                  代码:

                  loginGoogle() {
                      var provider = new firebase.auth.GoogleAuthProvider();
                      provider.addScope('profile');
                      provider.addScope('email');
                      firebase.auth().signInWithPopup(provider).then(function(result) {
                          var token = result.credential.accessToken;
                          var user = result.user;
                          return true;
                      }).catch(function(error) {
                          alert(error.code + '
                  ' +
                          error.message + '
                  ' +
                          error.email + '
                  ' +
                          error.credential);
                          return false;
                      });
                  }
                  

                  推荐答案

                  signInWithPopup 在 react-native 中不受支持.您将需要使用第三方 OAuth 库来获取 OAuth ID 令牌或访问令牌,然后使用 Firebase 登录:

                  signInWithPopup is not supported in react-native. You will need to use a third party OAuth library to get the OAuth ID token or access token and then sign in with Firebase:

                  const cred = firebase.auth.GoogleAuthProvider.credential(googleIdToken, googleAccessToken);
                  firebase.auth().signInWithCredential(cred)
                    .then((result) => {
                      // User signed in.
                    })
                    .catch((error) => {
                      // Error occurred.
                    });
                  

                  这篇关于世博会:“auth/operation-not-supported-in-this-environment"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何在 i18n-js 中使用 setLocale? 下一篇:React Native 上传图片失败

                  相关文章

                    <bdo id='CiSg5'></bdo><ul id='CiSg5'></ul>

                    <small id='CiSg5'></small><noframes id='CiSg5'>

                      <tfoot id='CiSg5'></tfoot>

                      <i id='CiSg5'><tr id='CiSg5'><dt id='CiSg5'><q id='CiSg5'><span id='CiSg5'><b id='CiSg5'><form id='CiSg5'><ins id='CiSg5'></ins><ul id='CiSg5'></ul><sub id='CiSg5'></sub></form><legend id='CiSg5'></legend><bdo id='CiSg5'><pre id='CiSg5'><center id='CiSg5'></center></pre></bdo></b><th id='CiSg5'></th></span></q></dt></tr></i><div id='CiSg5'><tfoot id='CiSg5'></tfoot><dl id='CiSg5'><fieldset id='CiSg5'></fieldset></dl></div>

                      <legend id='CiSg5'><style id='CiSg5'><dir id='CiSg5'><q id='CiSg5'></q></dir></style></legend>