-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting Notification for call from firebase method onmessage while socket is connected. #110
Comments
Can you confirm the state of the application? Are you referring to when it is in the foreground or background? (obviously not terminated). Also are you testing with the sample application or your own implementation? |
Hi @Oliver-Zimmerman , State of the application is foreground . I am testing with my own implementation . |
@Kushagra-Esmagico Please be aware that the app behaves differently in debug build than it does for a production release builds on Android namely background connections such as the socket connection actually stay awake longer for a debug build then they do for a release build. Please look into how we are handling background states here: Lastly please utilize the sample app (you can run firebase init to link your firebase to our sample) and test that way to confirm whether or not it is happening there. If not please reference our implementation for your own implementation. Thanks! |
@Oliver-Zimmerman , I will run the sample app and try to implement the same . |
@Kushagra-Esmagico can I close? |
@Oliver-Zimmerman The implementation in my code base is same as demo code , Sometime Telnyx server is sending the push notification for call . It happens when we just login into sip connection and try to make an inbound call . It is happening intermittently . Is there any threshold time frame that is used to make the decision if webrtc client is connected or not , based on that , it is sending socket message or notification message to connect the call ? |
@Kushagra-Esmagico as soon as the socket connection is closed the user is unregistered on our backend and if there is a token associated with that user then we will send a push notification. Sometimes if you are not manually disconnecting from the socket when you background the app, etc then it can take a couple of seconds for Android to terminate the socket connection. This is why we have a state listener in our sample application to actually manually disconnect as soon as we background the application - so that we force the disconnection and deregisteration from our backend. |
@Oliver-Zimmerman |
@Kushagra-Esmagico you need to disconnect from the socket when it is inactive in that case then. Right now we area doing this: else if (state == AppLifecycleState.paused)
{
logger.i(
'We are in the background setting fromBackground == true, DISCONNECTING',
),
fromBackground = true,
txClientViewModel.disconnect(),
},
}, It sounds like you need to do something like this: else if (state == AppLifecycleState.paused || state == AppLifecycleState.inactive)
{
logger.i(
'We are in the background setting fromBackground == true, DISCONNECTING',
),
fromBackground = true,
txClientViewModel.disconnect(),
},
}, If I were you I would print the exact lifecycle states through the BackgroundDetector I made and make sure you are disconnecting and reconnecting where appropriate. Ultimately I want to make it clear that you will not receive a push notification from firebase while connected to the socket. You have to be disconnected. One thing I will highlight is that through the flutter_incoming_callkit library that we use you can pop a local notification when receiving a call at any time while still connected to the socket and this should appear in the notification tray. Ultimately though @Kushagra-Esmagico I'm not even sure if I can reproduce your issue. Here is a video example of a background push notification as well as a push notification when the notification tray is open on our sample app. Screen.Recording.2025-02-26.at.09.47.21.mov |
Bug Category
SDK Version
Which version of the SDK have you added from pub.dev? Feel free to add the whole dependency implementation:
: telnyx_webrtc: ^1.0.1
Describe the bug
Getting Notification for call from firebase method onmessage while socket is connected.
Expected behaviour
It should only notify via socket , INVITE method.
To Reproduce
Steps to reproduce the behaviour:
** Device (please complete the following information):**
The text was updated successfully, but these errors were encountered: