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] "Activity doesn't exist" - Failed setup RNCallkeep in killed state

See original GitHub issue

Bug report

  • I’ve checked the example to reproduce the issue.

  • Reproduced on: Emulator API 27, 28

  • Android

  • iOS

Description

I trying to use callkeep for voip incoming calls. Info about incoming call will arrive throught the “data-only” notification (FCM). After received notification (handled by headless task). I trying to initialize RNCallKeep.setup but It will throw the error “Activity doesn’t exist”.

Foreground and Background works fine.

Steps to Reproduce

  1. Kill the running application.
  2. Try to initialize RNCallKeep from headless task of FCM.

Versions

- Callkeep: "git+https://github.com/react-native-webrtc/react-native-callkeep.git"
- React Native: 0.63.4
- iOS: 14.5
- Android: API 27, 28
- Phone model: Pixel 2
- @react-native-firebase/messaging: "^11.4.1",

Logs

[Thu May 06 2021 19:14:03.596]  WARN     FCM remote message
[Thu May 06 2021 19:14:03.597]  LOG      {"nativeStackAndroid":[],"userInfo":null,"message":"Activity doesn't exist","code":"E_ACTIVITY_DOES_NOT_EXIST","line":2416,"column":45,"sourceURL":"http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false"}
[Thu May 06 2021 19:14:03.950]  LOG      Running "main" with {"rootTag":1}

Code implementation

// Registering headless task
messaging().setBackgroundMessageHandler(
           async (remoteMessage: RemoteMessage) => {
                console.warn('FCM remote message');
                await CallKeepServiceI.init();
                CallKeepServiceI.displayIncomingCall();
            }
);

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12

github_iconTop GitHub Comments

4reactions
krishnamistry17commented, Jul 8, 2022

Hi react-native-callkeep not working If i kill the running application. Has anyone solved the problem?

2reactions
HalilFociccommented, Nov 15, 2022

You need to manually change RNCallKeepModule.java file after installing node modules. You need to alter the hasPermissions function like this https://github.com/react-native-webrtc/react-native-callkeep/pull/576/files.

After that, in your background message handler you call theese functions before calling RNCallKeep.displayIncmoingCall(cfg) await RNCallKeep.registerPhoneAccount(YOUR_CONFIG)

await RNCallKeep.registerAndroidEvents()

await RNCallKeep.setAvailable(true)

Read more comments on GitHub >

github_iconTop Results From Across the Web

call - react native callkeep can not navigate to special screen ...
Receiving a call when the application is not reachable. In some case your application can be unreachable : when the user kill the...
Read more >
reconnect-react-native-callkeep - npm
React Native CallKeep utilises a brand new iOS 10 framework CallKit and Android ConnectionService to make the life easier for VoIP developers ...
Read more >
React Native CallKeep utilises a brand new iOS 10 framework ...
It will return false if the call does not exist or has not been answered. ... from Recents or similar iOS app, assuming...
Read more >
React-native-callkeep - npm.io
Setup. import RNCallKeep from 'react-native-callkeep'; const options = { ios: ... It will return false if the call does not exist or has...
Read more >
A cautionary tale on Android: do not call System.exit()
When the application calls System.exit() the system will indeed kill the current process and remove the activity from the back stack (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