cybex-dev / twilio_voice

Flutter Twilio Voice Plugin
https://twilio-voice-web.web.app/
MIT License
39 stars 79 forks source link

[IOS] Not receiving calls if App is not opened for few days #239

Open soapthepro opened 2 months ago

soapthepro commented 2 months ago

Issue Summary

If my IOS app is in terminated state for a few days (3-4 days) then it just stops receiving phone call. In twilio console I can see that an attempt was made to call on my client but there's no ring. Its like the second the call is made from twilio to my client, the very next second the call ends with "no-answer" status and twilio console shows no error logs. But If I open my app, logout or login and then try, then it works perfectly fine.

Steps to Reproduce

  1. Keep the app in terminated state for few days then try calling
bazl-E commented 2 months ago

@soapthepro It's not because of the package error, it's because the call token will only have a maximum validity of 24 hours you should implement some other methods to token every 24 hours

soapthepro commented 2 months ago

@bazl-E Hey, I have seen many forums and ticket and from my understanding, after the device is registered with a valid token and if that token expires after any x amount of time, the incoming call shouldn't face any issues because firebase handles it differently and they have some other type of token and works on device token rather than the twilio token that we generate. The token that we generate is mainly used for outbound calls only.

And regarding refreshing it every 24 hours or early, I don't think it is possible in IOS. I have seen some packages that allow to execute some code in background but almost all of them have certain restrictions for IOS which makes it really difficult to execute the code of this package in background when the app is terminated.

I am still awaiting the reply from @cybex-dev on this but I am pretty sure that after successfully registering once with valid token, we should receive the call even after that token is expired.