connectycube-flutter-call-kit
connectycube-flutter-call-kit copied to clipboard
onCallAccepted not working properly, when call is accepted from background
I have implemented the plugin, in my project and receiving the notification to accept a call. But when user tries to accept call, it should be redirected to a specific screen in application. But it throwing error. I am using Get for contextless navigation. The get plugin is implemented correctly, because it is working with every other case, but not with the onCallAccepted
function.
This is my function
Future<void> onCallAccepted(CallEvent callEvent) async { Get.to(VideoCallPage( meetingID: callEvent.sessionId, meetingDetail: callEvent.userInfo, isfrombackground: true, )); }
ConnectycubeFlutterCallKit.instance.init( onCallAccepted: onCallAccepted, onCallRejected: onCallRejected, icon: "ic_stat_name", color: "#039BE5", );
Why is this happening? Any help would be highly appreciated.
which platform do you mean? could you please share the error log?
which platform do you mean? could you please share the error log?
I am using it on android emulator right now. But tried the same on physical android device.
W/FlutterJNI(13747): Tried to send a platform message to Flutter, but FlutterJNI was detached from native C++. Could not send. Channel: connectycube_flutter_call_kit.callEventChannel. Response ID: 266 W/ConnectycubeFlutterBgPerformingService(13747): A background message could not be handled in Dart as no onBackgroundMessage handler has been registered. E/flutter (13747): [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: You are trying to use contextless navigation without E/flutter (13747): a GetMaterialApp or Get.key. E/flutter (13747): If you are testing your app, you can use: E/flutter (13747): [Get.testMode = true], or if you are running your app on E/flutter (13747): a physical device or emulator, you must exchange your [MaterialApp] E/flutter (13747): for a [GetMaterialApp]. E/flutter (13747): E/flutter (13747): #0 GetNavigation.global (package:get/get_navigation/src/extension_navigation.dart:1094:7) E/flutter (13747): #1 GetNavigation.to (package:get/get_navigation/src/extension_navigation.dart:522:12) E/flutter (13747): #2 onCallAccepted (package:flairboat_new/services/push_notification_services.dart:37:14) E/flutter (13747): #3 ConnectycubeFlutterCallKit._processEvent (package:connectycube_flutter_call_kit/src/connectycube_flutter_call_kit.dart:254:26) E/flutter (13747): #4 ConnectycubeFlutterCallKit.initEventsHandler.<anonymous closure> (package:connectycube_flutter_call_kit/src/connectycube_flutter_call_kit.dart:129:7) E/flutter (13747): #5 _rootRunUnary (dart:async/zone.dart:1434:47) E/flutter (13747): #6 _CustomZone.runUnary (dart:async/zone.dart:1335:19) E/flutter (13747): #7 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1244:7) E/flutter (13747): #8 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11) E/flutter (13747): #9 _DelayedData.perform (dart:async/stream_impl.dart:591:14) E/flutter (13747): #10 _StreamImplEvents.handleNext (dart:async/stream_impl.dart:706:11) E/flutter (13747): #11 _PendingEvents.schedule.<anonymous closure> (dart:async/stream_impl.dart:663:7) E/flutter (13747): #12 _rootRun (dart:async/zone.dart:1418:47) E/flutter (13747): #13 _CustomZone.run (dart:async/zone.dart:1328:19) E/flutter (13747): #14 _CustomZone.runGuarded (dart:async/zone.dart:1236:7) E/flutter (13747): #15 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1276:23) E/flutter (13747): #16 _rootRun (dart:async/zone.dart:1426:13) E/flutter (13747): #17 _CustomZone.run (dart:async/zone.dart:1328:19) E/flutter (13747): #18 _CustomZone.runGuarded (dart:async/zone.dart:1236:7) E/flutter (13747): #19 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1276:23) E/flutter (13747): #20 _microtaskLoop (dart:async/schedule_microtask.dart:40:21) E/flutter (13747): #21 _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5) E/flutter (13747):
This is the error log. It shows the error of contextless navigation. But in my whole application I am using it, and it is working fine. It working fine when i am using the same for opening firebase messaging notification from background. But here it is throwing error.
Yes, I am getting the same issue with GetX. Error : of contextless navigation. When user tries to accept call, it should be redirected to a specific screen in application. But it throwing error. I am using Get for contextless navigation.