flutter-webrtc / callkeep

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

how to pass variable received onBackgroundMessage when app is back to foreground #37

Open ahmedJD opened 3 years ago

ahmedJD commented 3 years ago

i'm using agora with callkeep to join the same channel when app is in background or in foreground. how can i pass the channel id received in onBackgroundMessage(fcm) to callkeep answerCall() method.

arif2k17 commented 3 years ago

Did you find solution for this?

ahmedJD commented 3 years ago

i used shared prefrences to pass variable from background Message handler to answerCall method but i think it's not the better solution

shreyansh2211 commented 3 years ago

@ahmedJD Use IsolateNameServer to pass data from onbackgroundMessagehandler to application and at reciever port end store them in class level variables. Now you will be able to use these variables in answercall.

ahmedJD commented 3 years ago

@shreyansh2211 do you have an example how to use IsolateNameServer to push data and get them in other function method