Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Firebase in React Native shows a timer warning

I am using Firebase with React Native. Firebase shows me a timer warning as shown in the screenshot.

enter image description here

I read the following note in the React Native troubleshooting guide.

React Native implements a polyfill for WebSockets. These polyfills are initialized as part of the react-native module that you include in your application through import React from 'react'. If you load another module that requires WebSockets, such as Firebase, be sure to load/require it after react-native:

import React from 'react';
import Firebase from 'firebase';

I tried import React before Firebase. But, I still keep getting these timer warnings. The application does work fine. I keep getting multiple warnings at regular intervals. Any help would be well appreciated.

I am using the latest React Native and the warning comes in the Android emulator.

like image 905
vijayst Avatar asked Jun 11 '17 14:06

vijayst


1 Answers

To sort this out all need to do is increase the value of the variable MAX_TIMER_DURATION_MS. Here are the steps:

  1. Go to node_modules/react-native/Libraries/Core/Timer/JSTimers.js

  2. Look for the variable MAX_TIMER_DURATION_MS

  3. Change 60 * 1000 to 10000 * 1000 , needed for firebase

  4. Save the changes and re-build your app.

like image 185
happy go lucky Avatar answered Sep 19 '22 14:09

happy go lucky