Open eugeen3 opened 1 year ago
Hi! Try wake your application when any VoIP call is being received, see this: https://github.com/hiennguyen92/flutter_callkit_incoming/blob/master/PUSHKIT.md
After receive CallStateEnum.CALL_INITIATION event -> start FlutterCallkitIncoming.showCallkitIncoming(params); in your code add FlutterCallkitIncoming.onEvent.listen((CallEvent event) use: case Event.ACTION_CALL_ACCEPT: and show screen calling your application on Flutter
maybe using FCM for awake your app not good idea? maybe it's better to use another library? for example: https://pub.dev/packages/flutter_background
@eugeen3 were you able to solve this problem?
@eugeen3, You can try running SIP as a background service, if FCM option doesn't suit your preferences.
I use the FCM to awake my app and init SIP listener when my app is terminated. To show call notification I use
flutter_callkit_incoming
library. When Accept is pressed on incoming call notification then the app is opened in new isolate. In app i have the screen with hang up button which allows me to end the call withcall.hangup({'status_code': 603})
. As I mentioned, the app is opened in new isolate, so i don't have access to instance of currentCall
since the call was handled in separate isolate. Can I somehow reconnect to the call in my app? I guess thesendMessage()
may help since it also triggers thecallStateChanged()
function.