question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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 like setInterval(...) 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:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:6

github_iconTop GitHub Comments

1reaction
elioriverocommented, Aug 6, 2020

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.

0reactions
danjenkinscommented, Sep 7, 2020

Yup, not a callkeep issue, closing

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found