Warning about "setting a timer for a long period of time" when using ably-js-react-native on android

Ably js uses timers of up to two minutes (the two minute one is for connection state recovery). Some versions of react-native on Android warn about timers >60s, since javascript timers are not called when the activity in which the timer is running is in the background, and react native uses a heuristic that a timer set for more than a minute could be being used for some purpose (such as an alarm) where it must be called even when the activity is in the background.

 

The short answer is: the way ably-js uses timers understands this and is appropriate for how they work in react-native on Android, and it's safe to ignore or suppress the warning.

 

See https://github.com/ably/ably-js-react-native/issues/9#issuecomment-455680414 for a more detailed explanation of why this is the case.