Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Background Activity Launch Blocked for VoIP Calls #299

Open
seoplague opened this issue Nov 11, 2024 · 0 comments
Open

Background Activity Launch Blocked for VoIP Calls #299

seoplague opened this issue Nov 11, 2024 · 0 comments

Comments

@seoplague
Copy link

I’m working on a VoIP app built on Cordova. After updating Android and targeting SDK 34, push notifications for incoming calls have completely stopped functioning as expected. Based on my research on Android’s latest documentation and changes, here’s the approach I think should work:

  1. Receive the push notification.
  2. Determine the app’s and device’s state.
  3. If the app is closed and the phone is locked, follow the scenario here: FCMService.kt#L439, but this approach results in the warning: ActivityTaskManager: Background activity launch blocked!.

To handle this, I believe the flow should be:

  • Start a Foreground Service and create a Notification with PRIORITY_HIGH and category CATEGORY_CALL.
  • Launch the Foreground Service with startForeground(1, notification, ServiceInfo.FOREGROUND_SERVICE_TYPE_PHONE_CALL).
  • Send a broadcastIntent to interact with the Callkit plugin.
  • Implement a BroadcastReceiver, which calls the receiveCall method in CordovaCall.
  • The receiveCall() method then invokes telecomManager.addNewIncomingCall(handle, callInfo).
  • Problem: Despite implementing the above, all I get is a notification displayed on the screen from my Foreground Service. The BroadcastReceiver doesn't seem to react to anything, as nothing shows up in the logs.

Request: I’d appreciate any guidance or advice from the community on how to resolve this issue, as I seem to be missing something crucial in handling VoIP calls when the app is in the described state on SDK 34.

Thank you for your support!

"@havesource/cordova-plugin-push": "github:havesource/cordova-plugin-push#master",
"browserify": "^17.0.0",
"cordova-android": "^13.0.0",
"cordova-plugin-android-permissions": "^1.1.5",
"cordova-plugin-callkit": "^1.0.0",
"cordova-plugin-device": "^3.0.0",
"cordova-plugin-ionic-webview": "^5.0.1"

Additional Request:

If anyone has successfully implemented VoIP on Cordova with the latest SDKs, I would greatly appreciate any insights or advice on the flow. Any tips on overcoming the Background activity launch blocked issue or handling VoIP notifications more reliably with the latest Android & iOS restrictions would be extremely helpful.

Thank you in advance for your help!

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

No branches or pull requests

1 participant