• <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"

        Expo: quot;auth/operation-not-supported-in-this-enviromentquot;(世博会:“auth/operation-not-supported-in-this-environment)

        <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"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  在开发JS过程中,会经常遇到两个小数相运算的情况,但是运算结果却与预期不同,调试一下发现计算结果竟然有那么长一串尾巴。如下图所示: 产生原因: JavaScript对小数运算会先转成二进制,运算完毕再转回十进制,过程中会有丢失,不过不是所有的小数间运算会
                  问题描述: 在javascript中引用js代码,然后导致反斜杠丢失,发现字符串中的所有\信息丢失。比如在js中引用input type=text onkeyup=value=value.replace(/[^\d]/g,) ,结果导致正则表达式中的\丢失。 问题原因: 该字符串含有\,javascript对字符串进行了转
                  Rails/Javascript: How to inject rails variables into (very) simple javascript(Rails/Javascript:如何将 rails 变量注入(非常)简单的 javascript)
                  CoffeeScript always returns in anonymous function(CoffeeScript 总是以匿名函数返回)
                  Ordinals in words javascript(javascript中的序数)
                  getFullYear returns year before on first day of year(getFullYear 在一年的第一天返回前一年)
                    <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>

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