Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Android] Background Service Stops After Implementing CallKeep for Incoming Call Notifications #833

Open
beeeshaaal opened this issue Feb 17, 2025 · 2 comments

Comments

@beeeshaaal
Copy link

beeeshaaal commented Feb 17, 2025

I have implemented a Background Service using react-native-background-actions to keep the call active in the background, even if the user clears the app from recent apps during an ongoing call. This was working as expected.

However, after integrating CallKeep(in self managed mode) to display incoming call notifications (with android.permission.READ_PHONE_NUMBERS granted), the app completely quits when cleared from recent apps, terminating the background service and disconnecting the call.

This issue seems to occur after implementing CallKeep, as the Background Service was working properly before.

Expected Behavior:

  • The call should remain active even if the user clears the app from recent apps.
  • The Background Service should continue running, ensuring the call persists.

Actual Behavior:

  • After clearing the app from recent apps, the app fully exits, and the background service does not persist, causing the call to drop.

Steps to Reproduce:

  1. Start a call in the app.
  2. Ensure the background service keeps the call active when moving to the background.
  3. Clear the app from recent apps.
  4. Observe that the call is still active (before implementing CallKeep).
  5. Integrate CallKeep for incoming call notifications and request android.permission.READ_PHONE_NUMBERS.
  6. Repeat steps 1–3.
  7. Notice that after clearing the app from recent apps, it fully quits, and the call disconnects.

Environment:

  • Platform: Android
  • React Native Version: 0.76.5
  • CallKeep Version: ^4.3.14
  • Device/OS: Oneplus Nord CE3, Android 14

Additional Notes:

  • The issue started occurring only after integrating CallKeep.
  • Possible conflict between CallKeep and the Background Service?
  • Any insights on how to maintain the background service while using CallKeep would be helpful.
@Kumargaurav11998
Copy link

set selfManaged: false in setup and again reinstall

@beeeshaaal
Copy link
Author

set selfManaged: false in setup and again reinstall

Tried that already didn't work at all. When incoming call arrives it will ask for android.permission.READ_PHONE_NUMBERS permission before showing the call notification from callKeep, and when granted the notification disappears when clearing from recents.

Do you know how many headless functions can a React Native app can run?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants