首页 > 解决方案 > 带有 React Native 的 Firebase Phone Auth 不接受某些实数

问题描述

我似乎破坏了 Firebase Phone Auth 中的某些内容。我正在使用我自己的后端系统和带有 React Native 的 Firebase,仅用于电话身份验证和 FCM。

背景是我有一个用于身份验证的旧项目。后来必须有另一个应用程序,所以我没有在同一个项目下有多个应用程序,而是为每个应用程序创建了两个新项目。然后我从旧项目中删除了所有应用程序。

现在,当我使用旧项目中使用的真实电话号码时,它们似乎不再起作用。在新项目下设置的测试号码都很好。

我不能再“浪费”更多实数,以防它们也无法用于进一步测试。

使用 React Native Firebase 模块,它看起来像:

auth()
    .signInWithPhoneNumber(phoneNumber)
    .then(confirmation => {
      dispatch({
        type: PHONENUMBER_SIGNIN_SUBMIT_SUCCESS,
        payload: confirmation,
      });
    })
    .catch(error => {
      console.log('received  error from firebase auth', JSON.stringify(error));
      dispatch({
        type: PHONENUMBER_SIGNIN_SUBMIT_FAIL,
        payload: error,
      });
    });

使用旧项目中使用的电话号码,它最终出现在 catch 块中,并带有一条神秘的错误消息{"line":7186,"column":64,"sourceURL":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.xxx.yyy&modulesOnly=false&runModule=true"}

这行 7186 在一个看起来像这样的代码块中

   7172     module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) {
   7173       if (Class === null || !_$$_REQUIRE(_dependencyMap[0], "./isNativeFunction.js")(Class)) return Class;
   7174 
   7175       if (typeof Class !== "function") {
   7176         throw new TypeError("Super expression must either be null or a function");
   7177       }
   7178 
   7179       if (typeof _cache !== "undefined") {
   7180         if (_cache.has(Class)) return _cache.get(Class);
   7181 
   7182         _cache.set(Class, Wrapper);
   7183       }
   7184 
   7185       function Wrapper() {
   7186         return _$$_REQUIRE(_dependencyMap[1], "./construct.js")(Class, arguments, _$$_REQUIRE(_dependencyMap[2], "./getPrototypeOf.js")(this).constructor);
   7187       }
   7188 
   7189       Wrapper.prototype = Object.create(Class.prototype, {
   7190         constructor: {
   7191           value: Wrapper,
   7192           enumerable: false,
   7193           writable: true,
   7194           configurable: true
   7195         }
   7196       });
   7197       return _$$_REQUIRE(_dependencyMap[3], "./setPrototypeOf.js")(Wrapper, Class);
   7198     };

由于我不知道可能导致此问题的原因,因此非常感谢任何帮助和解决方法。

标签: javascriptfirebasefirebase-authenticationreact-native-androidreact-native-firebase

解决方案


推荐阅读