cybex-dev / twilio_voice

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

Can not get response from TwilioVoice.instance.unregister #203

Open tunglthtv opened 9 months ago

tunglthtv commented 9 months ago
final result = await TwilioVoice.instance.unregister();
if (result == true) {
  onSuccess?.call();
} else {
  onFailure?.call("Failed to unregister");
}

@cybex-dev I can not get response from result. It's seem that stuck on IOS

![Uploading Screenshot 2023-11-18 at 15.02.15.png…]()

cybex-dev commented 9 months ago

Hi @tunglthtv,

Thanks for reporting this issue.

I can confirm, you will not receive a response as expected. All new/recently added platforms send responses as required, though legacy code does not - a rework for this is planned in future.

For now, you can simply call await TwilioVoice.instance.unregister(String) until such a time the rework is complete.

tunglthtv commented 9 months ago

@cybex-dev I have used to call await TwilioVoice.instance.unregister(String) but on IOS, it's a occur. Screenshot 2023-11-18 at 15 02 15 Do you have meet it? I am thinking that this error still no unregister device token on IOS.

cybex-dev commented 9 months ago

Hmm, that sounds like a different issue (usually occurs on registering a token sandbox/production APNs confusion). See this for some more information.

When you call unregister(String), take a look at the log output, you should see:

Do you see any of these messages in the Flutter console output?

tunglthtv commented 9 months ago

@cybex-dev I am not receive any of these message in console. If i use

final result = await TwilioVoice.instance.unregister(accessToken: voiceToken);
if (result == true) {
  onSuccess?.call();
} else {
  onFailure?.call("Failed to unregister");
}

It will block UI and not get result on IOS

Erchil66 commented 9 months ago

@tunglthtv

Hi, I think the error is from the certificate you provided because as i also face that problem to have ERROR 52134 - this is certificate related that you provided for

You need to use voip services token for this. Also some of that dont usually matter on twilio side since that is connected to notification.

cybex-dev commented 9 months ago

@cybex-dev I am not receive any of these message in console. If i use

final result = await TwilioVoice.instance.unregister(accessToken: voiceToken);
if (result == true) {
  onSuccess?.call();
} else {
  onFailure?.call("Failed to unregister");
}

It will block UI and not get result on IOS

@tunglthtv the unregister() call should not freeze the UI unless you've put a breakpoint there. I've done quite a bit of testing today and have not one run into this issue.

Can you provide an MCVe / video of the issue?

tunglthtv commented 9 months ago

@cybex-dev Thanks you for your support. Finally i also get result from unregister token on IOS. But i met other issue that after i unregister and i wanna re-register device token on IOS. I register again but it's seems that old device token sent to Twilio. So it's invalid APNs token. How can i re-generate a new device token on IOS?

2023-11-22 12:37:13.250793+0900 Runner[19255:1019086] LOG|providerDidBegin
2023-11-22 12:37:13.251102+0900 Runner[19255:1019086] LOG|pushRegistry:didUpdatePushCredentials:forType:

Only when I call this function 'TwilioVoice.instance.call.place' will the device token be registered again

cybex-dev commented 8 months ago

@tunglthtv these tokens persist for the device until they are expired. If you seem to be receiving calls meant not for the "current token", this may indicate several possible issues:

sravanthikotaru commented 8 months ago

IMG-20231217-WA0001 I got this error in my application

Punit30 commented 5 months ago

Hi @cybex-dev,

I am also getting the same issue, I had done some debugging at my end and found that I am able to register and unregister the deviceToken once in the current appLifeCycle. When I try to register device again it only register me to twilio but does not register to VoIP notification service. Don't know why I am getting the issue. Also, this issue only persist in IOS, may be some limitation from IOS end still don't know.

Please let me know if there is any solution to this.

cc: @Erchil66 @tunglthtv @sravanthikotaru

cybertouchshiv commented 5 months ago

Hi @Punit30 @cybex-dev

Shiv here, i like to connect with you , I also need this SDK setup and working on a call application, if you are available for this help I like to pay for your valuable time.

let's connect on my email shivkumawat1985@gmail.com .

Thank you