Android: JavaScript code works only few seconds after deep sleep on incoming call
See original GitHub issue-
I’ve checked the example to reproduce the issue.
-
Reproduced on:
-
Android
-
iOS
Description
JavaScript code works only few seconds after deep sleep on incoming call
Steps to Reproduce
- minimize app (press home button)
- run command to put app in deep sleep
adb shell am kill "com.callkeepdemo"
- turn off the screen
- send data push notification to app with react-native-firebase
- in notification handler run
displayIncomingCall(getRandomNumber());
and some other stuff likesetInterval(...)
or do some ajax requests - call ui appears on the screen
- after second or two js code pauses and will resume only when Call UI will be closed and you open your app. I think it happens because MainActivity actually not appeared on the screen and android paused it with all js code in memory.
If I schedule some function with BackgroundTimer.setTimeout
(instead of regular setTimeout
) it will be executed, but looks like all other code is just frozen
I need some help to figure out how to tell Android or ReactNative that my app or js code specifically should running until Call UI is opened.
Versions
- Callkeep: 3.0.10
- React Native: 0.59.10
- Android: 10
- Phone model: Samsung SM-G970F
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:6
Top Results From Across the Web
Android: Sleep stages/levels on an Android device?
There is not really a separate stage called "deep sleep". ... After a few seconds (it depends on how the device is configured)...
Read more >Stop The Screen Going To Sleep With JavaScript | likes
The Screen Wake Lock API allows us to stop the device screen from going to sleep without hacky work arounds that are likely...
Read more >SystemClock - Android Developers
uptimeMillis() is counted in milliseconds since the system was booted. This clock stops when the system enters deep sleep (CPU off, display dark, ......
Read more >Wi-Fi freqently loses connection and doesn't reestablish it ...
this issue suggests; rather it just throws a page cannot be displayed type-error. After a refresh or two the page will load slowly....
Read more >JavaScript Wait – How to Sleep N Seconds in JS with ...
The code in setTimeout() indicates that there needs to be a one-second delay before it runs. However, during that time, the execution of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m running into exactly this same issue. We’ve some fetch requests and the incoming call is only displayed once they’ve finished. And sometimes it’s not even displayed after the fetch.
Yup, not a callkeep issue, closing