flutterjitsijitsi-meet

Flutter - Connectycube_flutter_callkit not working in the background or terminated


i'm using connectycube for receiving calls but when i accept call while is in the background like the image below accept call not working it navigates me the home page but not the call here is the code

void videocaller( var friendName){
  Uuid uuid = Uuid();
  CallEvent callEvent = CallEvent(sessionId: uuid.v4() + "1", callType: 1, callerId: 0, 
  callerName: friendName, opponentsIds:{1234});

  Future<void> _onCallAccepted(CallEvent callEvent) async {
    _joinMeetingVideo(friendName);
   }

   Future<void> _onCallRejected(CallEvent callEvent) async {

   }
   Future onCallRejectedWhenTerminated(CallEvent? callEvent) async {

     }
   Future onCallAcceptedWhenTerminated(CallEvent? callEvent) async {
     _joinMeetingVideo(friendName);
   }

 ConnectycubeFlutterCallKit.onCallRejectedWhenTerminated = onCallRejectedWhenTerminated;
 ConnectycubeFlutterCallKit.onCallAcceptedWhenTerminated = onCallAcceptedWhenTerminated;
  ConnectycubeFlutterCallKit.instance.init(
    onCallAccepted: _onCallAccepted,
    onCallRejected: _onCallRejected,
  );
 ConnectycubeFlutterCallKit.showCallNotification(callEvent);
 ConnectycubeFlutterCallKit.setOnLockScreenVisibility(isVisible: true);

 }

i tried it with getx to navigate to jitsi call but it does not work

actually the problem is that jitsi function [_joinMeetingVideo(friendName);] is not a page where i can navigate to it's a function so it can't be executed enless the app is open this why it opens the home page of the app but not the video call itself but unfortunately i could't find a solution for this issue. any ideas ??


Solution

  • _joinMeetingVideo() is not a top-level function