flutter-webrtc / callkeep

iOS CallKit and Android ConnectionService for Flutter
MIT License
131 stars 142 forks source link

How to integrate with WebRtc? How open connection programmatically? #68

Open FetFrumos opened 3 years ago

FetFrumos commented 3 years ago

I am new to using flutter-webrtc and need help.

I have the following "user case" in my app:

Any examples. I will be grateful. This is a great package, but more detailed documentation will be very helpful.

safdaralimalik commented 3 years ago

@FetFrumos following you, please write here if you found the solution. Thanks

xyzbilal commented 3 years ago

receive message, bring app to foreground, go specific page, establish peer to peer connection.

As you see there is no callkeep in steps. I build webrtc _sip application. first tried to use callkeep but it didnt worked as I expected. then I recoded webrtc related side in native side and implement foreground services that establishes webrtc connection and added custom notifications to show incoming call after connection established. I almost work on this topic for 8 months and at the and best solution is work with native code and dart code in collabration. callkeep gave me ideas both ios and android native side, I implemented native methods inspiring callkeeps native methods. if you are learning just look for third parties like agora.io to implement fully functional apps.

Please dont request any example code because my codes are company related commercial app and there is nda for the codes.

muhammedrashidm commented 3 years ago

receive message, bring app to foreground, go specific page, establish peer to peer connection.

As you see there is no callkeep in steps. I build webrtc _sip application. first tried to use callkeep but it didnt worked as I expected. then I recoded webrtc related side in native side and implement foreground services that establishes webrtc connection and added custom notifications to show incoming call after connection established. I almost work on this topic for 8 months and at the and best solution is work with native code and dart code in collabration. callkeep gave me ideas both ios and android native side, I implemented native methods inspiring callkeeps native methods. if you are learning just look for third parties like agora.io to implement fully functional apps.

Please dont request any example code because my codes are company related commercial app and there is nda for the codes.

ho, i am in exact same situation, and it's been 6 months. as your comment, i assume it's better to create a native class and with that class, bring the flutter webrtc page into action. or you completely avoided flutter on webrtc side? also pleas give any reference if you have, that i can boost the process.

cloudwebrtc commented 3 years ago

There is no direct interaction between callkeep and webrtc. You need to use push to wake up the app that integrates callkeep, and then establish actual communication through webrtc offer/answer.

muhammedrashidm commented 3 years ago

it's all done, the webrtc part is all working. the only problem is when i bring the app into foreground using call keep, I can't route to another page. ie: video call page, all i can see is a blank white screen

xaviersydney48 commented 2 years ago

The bestoption isusing flags to diferentiate between calls and normal openings of your app,lets say if it is call your flag or value be 200 then navigate to Video call ,,

muhammedrashidm commented 2 years ago

The bestoption isusing flags to diferentiate between calls and normal openings of your app,lets say if it is call your flag or value be 200 then navigate to Video call ,,

ye, I am flagging it as a call and while those notification arrives, the app automatically opens, but into a white screen only

surveshoeb commented 2 years ago

@muhammedrashidm try this

backgroundMessageHandler(Map<String, dynamic> payload) {
  print('backgroundMessage: message => ${payload.toString()}');

  //Your operation with received payload

  locator<NavigationService>().navigateTo(Routes.videoCall);
}

I think your white screen issue occur while navigating to video call page with context, You can use stacked_services for navigation without context.