connectycube-flutter-samples
connectycube-flutter-samples copied to clipboard
onConnectedToUser is not being excuted
So I have a stateful widget and it implements the RTCSessionStateCallback<P2PSession>
and so overrides all the methods. but the onConnectedToUser is not getting executed when I answer the call from Callkit.
This happens on ios and I am on ios 18
[] Chat sample [x] P2P Calls sample [] Conference Calls sample
Platform (use [x]) [] Android [x] iOS [] macOS [] Windows [] Web [] Linux
Device info Manufacturer: Apple Model: 13 pro max OS version: 18.1
Describe the bug:
So I have a stateful widget and it implements the RTCSessionStateCallback<P2PSession>
and so overrides all the methods. but the onConnectedToUser is not getting executed when I answer the call from Callkit.
This happens on ios and I am on ios 18
Steps to Reproduce:
- conversation page try to log something on the method
onConnectedToUser - get a call
- answer using call kit when your have locked the phone
Logs:
log here
or Gist log
Actual result:
Expected behaviour: A callback should execute the logic I have on that callback method
Additional info Add any other context about the problem here.
Hello @kzawadi. Did you reproduce this issue on P2P Calls sample? Does 'onConnectedToUser' execute in it? Also you can check if this works on android platform.
On Android, it works fine. Yes i am using p2p call sample
And on ios
SO here I attach two screen recordings of the two scenarios and the code
So in the ConversationCallScreen page which implements implements RTCSessionStateCallback<P2PSession>
which now as sample p2p will have two override some callback methods. amoung them being @override void onConnectedToUser(P2PSession session, int userId) async {
And in this callback is where I have some logic like starting the timer and other call information stuff
So when the app is in foreground it works flawless but in iOS when I answer the call in callKit. and click the app icon in callKit it opens the app as anticipated and navigate to conversationpage but the callback method onConnectedToUser is not executed.
This is where I have the app working. (Answering the app when it is not locked). https://we.tl/t-LijZuix0Oy
And is the case in which the callback method is not getting executed/called as you see the logic to start the timer is not working and no breakpoint will get caught here in this scenario https://we.tl/t-1yOdl39AAv
And here are other working scenarios just for reference https://we.tl/t-cDGuafHKc0
@override
void onConnectedToUser(P2PSession session, int userId) async {
log("onConnectedToUser userId= $userId");
_timerService.reset();
_timerService.start();
initForegroundServices();
FlutterRingtonePlayer().stop();
if (_isIncoming) {
setState(() {
callInfo = "Incoming call";
});
} else {
setState(() {
callInfo = "Outgoing call";
});
}
}
If onConnectedToUser is not called, means connection with call opponent is not established by some reasons.
Check all steps when accept call, and in CallManager CallState.ACCEPTED is need to be.
Also please review other issues to search for the solution to your problem https://github.com/ConnectyCube/connectycube-flutter-call-kit/issues/116 is a similar ticket, and https://github.com/ConnectyCube/connectycube-flutter-call-kit/issues/116#issuecomment-1822399414 is a solution.
Let me check these once again and I will report back