小编Ros*_*tam的帖子

Firebase for android突然无法在我的测试设备中运行

我正在使用Firebase身份验证和实时数据库构建应用程序.在昨天之前,测试时我的设备工作正常.但我现在甚至无法使用Firebase登录,但该应用程序正在处理我朋友的其他设备.

这里的实际问题是什么?测试app你自己的真实设备有任何限制吗?是否超出某种限制?

我尝试卸载应用程序并重新安装,从firebase数据库中删除用户帐户.但仍然没有工作.

谢谢!!

android firebase firebase-authentication firebase-realtime-database

9
推荐指数
1
解决办法
2062
查看次数

React Native GeoLocation不适用于Android

任何人都可以确认React Native Geolocation是否真的在Android上运行?我在使用getCurrentPosition()方法时遇到位置请求超时,并且在使用方法时没有错误消息watchPosition().

我在AndroidManifest.xml上添加了所需的权限(FINE LOCATION),并允许该应用程序获得位置权限.

这是我的实现:

componentWillMount() {
 navigator.geolocation.getCurrentPosition((position) => {
        console.log('+++++++');
        console.log(position.coords.longitude);
        this.setState({
          longitude: position.coords.longitude,
          error: null,
        });
      },
      (error) => {
        console.log(error);

      },

    );
}
Run Code Online (Sandbox Code Playgroud)

React Native Version:0.42

android react-native

7
推荐指数
1
解决办法
8059
查看次数

警告:只能在setInterval(React Native)中调用api时更新已安装或安装的组件

我一直在开发一个应用程序,我需要每30秒进行一次API调用,并在某些状态下设置响应.我在setInterval里面做.我有一个组件,在应用程序的所有屏幕上呈现.(setInterval所在的组件).一切似乎都有效,但是当我按下后退按钮进入上一个屏幕时,我得到了这个警告'setState on unmounted component'.请记住,组件也会再次安装在此屏幕中.足够的话,让我在这里有代码.

SongActivityBar.js

componentDidMount(){
  _isMounted = true
  this._timer = true;
  this.startPolling();
}


  componentWillUnMount() {
    _isMounted = false;
    this._timer && clearInterval(this._timer);
    this._timer = false;
  }

  startPolling=() => {
      if (_isMounted){
          this.fetchNowPlaying(); // do it once and then start it up ...
          this._timer = setInterval(() => this.fetchNowPlaying(), 30000);
      }
  }


 fetchNowPlaying() {
    fetch(url, {
    .......... 
    .then( (response) => {
      this._timer && this.setState({loading: false, nowPlaying: response.Message});
    ........
    });
  }
Run Code Online (Sandbox Code Playgroud)

当点击应用程序的任何屏幕时,组件SongActivityBar.js被加载,回到任何屏幕,使用nav.pop()或android后退按钮给我这个警告.

PS:我使用Navigator在屏幕之间导航(现在无法更改库)

React Native version - 0.45.1
Run Code Online (Sandbox Code Playgroud)

javascript android ios reactjs react-native

0
推荐指数
1
解决办法
385
查看次数