У меня есть странная ошибка в моем APL Firebase для реагирования.Значение JSON типа NSnull не может быть преобразовано в NSString
Взаимодействующий-run-андроид работает нормально без ошибок.
, но с ошибкой run-ios с реакцией, с JSON-значением типа NSnull не может быть преобразован в NSString.
исходный код следующим образом. (Основной и регистрацию класс работы аутентификации на firebase)
Я думаю Firebase Класс имеет различные ACT КСН и Android, чтобы преобразовать JSON в текст.
Любое предложение оценено.
Shoji
главный
// Инициализировать firebase приложение здесь и передать его другим компонентам, как это необходимо. Только инициализация при запуске.
const firebaseApp = firebase.initializeApp(firebaseConfig);
var GiftedMessenger = require('react-native-gifted-messenger');
let styles = {}
class Pricing extends Component {
constructor(props){
super(props);
this.state = {
page: null
};
/* this.itemsRef = this.getRef().child('items'); */
}
componentWillMount(){
// We must asynchronously get the auth state, if we use currentUser here, it'll be null
const unsubscribe = firebaseApp.auth().onAuthStateChanged((user) => {
// If the user is logged in take them to the accounts screen
if (user != null) {
this.setState({page: Account});
console.log('(user != null)')
return;
}
// otherwise have them login
console.log('(user != Login)')
this.setState({page: Login});
// unsubscribe this observer
unsubscribe();
});
}
render() {
if (this.state.page) {
return (
// Take the user to whatever page we set the state to.
// We will use a transition where the new page will slide in from the right.
<Navigator
initialRoute={{component: this.state.page}}
configureScene={() => {
return Navigator.SceneConfigs.FloatFromRight;
}}
renderScene={(route, navigator) => {
if(route.component){
// Pass the navigator the the page so it can navigate as well.
// Pass firebaseApp so it can make calls to firebase.
return React.createElement(route.component, { navigator, firebaseApp});
}
}} />
);
} else {
return (
// Our default loading view while waiting to hear back from firebase
Ошибка кажется весьма конкретной. Вопрос должен попытаться сделать то же самое. – user2864740
КЛАСС-БЛОКА, называемая мой APL, выглядит следующим образом. const firebaseApp = firebase.initializeApp (firebaseConfig); Const отписки = firebaseApp.auth(). OnAuthStateChanged ((пользователь) => { this.props.firebaseApp.auth(). CreateUserWithEmailAndPassword ( Const USERDATA = this.props.firebaseApp.auth(). CurrentUser; источник = {{URI: this.state.user.photoURL}} /> // выход из системы, как только это будет завершена, пользователь возвращается к экрану входа this.props.firebaseApp.. auth(). signOut(). then (() => { – itagaki