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.

RNCallKeep is not working on app background and Inactive States

See original GitHub issue

Bug report

Description

I have implemented RNCallKeep features in such a way that when a push notification arrives, then it tries to display an incoming UI through RNCallKeepDisplayIncomingUI(). When the app is in foreground as per the logic If I click on answer button, it is redirecting to a specific page; howsoever, the functionality that I am mentioning wasn’t working as expected when the app goes to background or inactive state.

In background state, on click of answer button, the expected behaviour is that app should change its state to foreground, open the app automatically and redirect to the specific screen. The navigation logic is working fine but it is not opening the app and behave according to the logic.

Help will be appreciated.

Versions

- Callkeep: 3.0.12
- React Native: 0.59.9
- iOS: 10.15.2
- Android: android 9.0
- Phone model: Nokia 5.1 plus 

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:5
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
jason-shencommented, Nov 10, 2020

Same here. Killed an app. Calling to this device — no reaction.

@pavanMude Figured out — need to configure, for example, Firebase background messaging (https://bit.ly/3ej3hoN — react-native-firebase v5 docs NOT THE LATEST, but just my case).

Then you need to register headless task.


AppRegistry.registerHeadlessTask(

  'RNFirebaseBackgroundMessage',

  () => CallMessagingManager.backgroundMessageHandler

)

Inside this backgroundMessageHandler it’s important to call methods:


RNCallKeep.setup(YOUR_OPTIONS)

RNCallKeep.setAvailable(true)

// rest of your call answer logic

After this at some moment (onAnswer, for example) you need to use something like that — react-native-invoke-app to return your app from background.

Just a question, This apply to android only right?

0reactions
nikolov9996commented, Aug 26, 2022

RNCallKeep.setAvailable(true)

this part ended 2 days of suffering with RN a big TY!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Simple guide for React Native WebRTC Video Calling (via ...
There is no way to continue a video call in background because of some OS ... user app is either in closed (killed)...
Read more >
Keeping application alive in background - Help
Hi, I am using react-native-webrtc plugin to make a conference app and it works ... setTimeout doesn't work in the background by default,...
Read more >
React-native-callkeep - npm.io
import RNCallKeep from 'react-native-callkeep'; const options = { ios: { appName: ... Android supports calling apps running in what's called "Self Managed".
Read more >
call - react native callkeep can not navigate to special screen ...
In some case your application can be unreachable : when the user kill the application when it's in background since a long time...
Read more >
https://docs-new.sipthor.net/rSYLKWRTCMb435282bd8d...
diff --git a/app/CallManager.js b/app/CallManager.js index ... when is in the background + // this does not work for iOS when app is in...
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