Skip to content

Conversation

@redevrx
Copy link

@redevrx redevrx commented Jun 16, 2024

onEvent not working in terminated state ,when i tap i accept or decline not call listener event
add acceptCallHandle

@hiennguyen92
Copy link
Owner

Thank you so much.
I will check and merge it in next version.

Thank you again for your contribution.

@devbigheads
Copy link

Thank you so much.
I will check and merge it in next version.

Thank you again for your contribution.

You addressed this issue in this recent release??

@sicunets
Copy link

Any update for this issue? Same here onEvent not working in terminated state.

@devbigheads
Copy link

@hiennguyen92 any update??

@arslan9380
Copy link

@redevrx can you please share what changes I need to do to make it this PR workable? its still not working for me.

@atulproject99
Copy link

@hiennguyen92 any update on this ?

@redevrx
Copy link
Author

redevrx commented Sep 3, 2025

@redevrx can you please share what changes I need to do to make it this PR workable? its still not working for me.

Hi @arslan9380 ,

The issue is that onEvent doesn't work when the app is in background/terminated state. You need to use the callback approach instead.

Problem:

  • FlutterCallkitIncoming.onEvent.listen() only works when app is active
  • In background/terminated state, the event channel isn't ready when invoked

Solution:
Use acceptCallHandleCallback instead of relying on onEvent:

// Don't use this in background state:
FlutterCallkitIncoming.onEvent.listen((event) {
  // This won't trigger in background/terminated
});

// Use this approach:
FlutterCallkitIncoming.acceptCallHandleCallback = (callData) {
  // This works in background/terminated state
  _handleAcceptCall(callData);
};

static void _handleAcceptCall(Map<String, dynamic> callData) {
  // Process the accepted call
  // Navigate to call screen or handle call logic
}

899c8f5

@arslan9380
Copy link

I think this is the function you refering?
FlutterCallkitIncoming.acceptCallHandle((callback) {
print("Terminated state call accepted: $callback");
});

Do I need to call this in main.dart ?
Also Please mention is there any changes I need to do in android and appdelegate files?
@redevrx

@atulproject99
Copy link

@redevrx can you tell us what changes we need to do in native side ?

@redevrx
Copy link
Author

redevrx commented Sep 10, 2025

I think this is the function you refering? FlutterCallkitIncoming.acceptCallHandle((callback) { print("Terminated state call accepted: $callback"); });

Do I need to call this in main.dart ? Also Please mention is there any changes I need to do in android and appdelegate files? @redevrx

899c8f5

@redevrx
Copy link
Author

redevrx commented Sep 10, 2025

@redevrx can you tell us what changes we need to do in native side ?

899c8f5

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

Successfully merging this pull request may close these issues.

6 participants