小编raj*_*oke的帖子

尝试在 React-Native Firebase 中使用电话身份验证时,iOS 模拟器中的应用程序崩溃

我已按照文档进行操作并进行了必要的设置,但应用程序在启动时崩溃了。我无法弄清楚为什么会发生这种情况。有人使用过 rnfirebase 吗?面临这个问题?

import React, { Component } from 'react';
import { View, Button, Text, TextInput, Image } from 'react-native';

import firebase from 'react-native-firebase';

const successImageUri = 'https://cdn.pixabay.com/photo/2015/06/09/16/12/icon-803718_1280.png';

export default class App extends Component {
  constructor(props) {
    super(props);
    this.unsubscribe = null;
    this.state = {
      user: null,
      message: '',
      codeInput: '',
      phoneNumber: '+44',
      confirmResult: null
    };
    firebase.initializeApp({
      apiKey: 'AIzaSyAvKPtsqqqGjkGLkXD8BeqOR6GwJaI2AcE',
      appId: '1:170852024080:ios:9bb19d2f74715186',
      messagingSenderId: '170852024080',
      projectId: 'chatapp-7c693',
      authDomain: 'chatapp-7c693.firebaseapp.com',
      databaseURL: 'https://chatapp-7c693.firebaseio.com',
      storageBucket: 'chatapp-7c693.appspot.com'
    });
  }

  componentDidMount() {
    this.unsubscribe = firebase.auth().onAuthStateChanged(user => {
      if …
Run Code Online (Sandbox Code Playgroud)

react-native react-native-firebase

2
推荐指数
1
解决办法
2280
查看次数