Skip to content
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

Invalid argument(s): DEVICETOKEN is not a valid CallState. #241

Open
jd-bus opened this issue Jun 23, 2024 · 1 comment
Open

Invalid argument(s): DEVICETOKEN is not a valid CallState. #241

jd-bus opened this issue Jun 23, 2024 · 1 comment
Assignees
Labels
bug Something isn't working iOS

Comments

@jd-bus
Copy link

jd-bus commented Jun 23, 2024

Issue Summary

Fatal Exception: FlutterError
Invalid argument(s): DEVICETOKEN is not a valid CallState.
0
twilio_voice_method_channel.dart - Line 430
MethodChannelTwilioVoice.parseCallEvent + 430
1
twilio_voice_method_channel.dart - Line 32
MethodChannelTwilioVoice.callEventsListener.<fn> + 32

Steps to Reproduce

Looking at the source, apparently this implies that the String "DEVICETOKEN" was passed as the parameter to parseCallEvent. parseCallEvent seems to handle a String starting with "DEVICETOKEN|" but does not handle just the String DEVICETOKEN:

  @override
  CallEvent parseCallEvent(String state) {
    if (state.startsWith("DEVICETOKEN|")) {
      var token = state.split('|')[1];
      if (deviceTokenChanged != null) {
        deviceTokenChanged!(token);
      }
      return CallEvent.log;
    } else ....

Maybe a simple fix? But I'm not sure of the root cause or why this would be unexpected. Maybe it means that the device token became null?

@cybex-dev cybex-dev self-assigned this Sep 3, 2024
@cybex-dev
Copy link
Owner

Hi @jd-bus

Great catch, thanks for posting this issue. I'll investigate but clearly it's not meant to be the case. I'll address it in this next update.

@cybex-dev cybex-dev added bug Something isn't working iOS labels Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working iOS
Projects
None yet
Development

No branches or pull requests

2 participants