We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
On iOS, unable to get the device ID and client ID from the LocalDevice object due to unhandled exception when loading LocalDevice info.
Unhandled Exception: type '_Map<Object?, Object?>' is not a subtype of type 'String' in type cast
Exception throw from:
ably-flutter/example/lib/push_notifications/push_notification_service.dart
Line 111 in c4b8ed6
Actual problem from:
ably-flutter/lib/src/platform/src/codec.dart
Line 799 in c4b8ed6
This problem only happen on iOS due to the recipient contains object in the value.
recipient
{ "state": null, "errorReason": null, "recipient": { "transportType": "apns", "apnsDeviceTokens": { "default": "xxxxxxxxxxxxx" } } }
However, It is working fine on Android because the recipient is a simple Map<String, String>.
Map<String, String>
{ "recipient": { "transportType": "fcm", "registrationToken": "xxxxxxx:xxxxxxx" } }
Flutter: 3.13.5 Device: iPhone 11 (physical device), iOS 16.6.1 Editor: VS Code Sample code: Ably example code from latest master branch (commit: c4b8ed6)
The text was updated successfully, but these errors were encountered:
Exception trace:
[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: type '_Map<Object?, Object?>' is not a subtype of type 'String' in type cast #0 new LinkedHashMap.from.<anonymous closure> (dart:collection/linked_hash_map.dart:187:26) #1 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:625:13) #2 new LinkedHashMap.from (dart:collection/linked_hash_map.dart:186:11) #3 Codec._decodeDevicePushDetails (package:ably_flutter/src/platform/src/codec.dart:799:33) #4 Codec._decodeDeviceDetails (package:ably_flutter/src/platform/src/codec.dart:783:13) #5 Codec._decodeLocalDevice (package:ably_flutter/src/platform/src/codec.dart:809:24) #6 _CodecPair.decode (package:ably_flutter/src/platform/src/codec.dart:51:21) #7 Codec.readValueOfType (package:ably_flutter/src/platform/src/codec.dart:230:19) #8 StandardMessageCodec.readValue (package:flutter/src/services/message_codecs.dart:478:12) #9 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:645:27) #10 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:310:18) <asynchronous suspension> #11 Platform.invokePlatformMethod (package:ably_flutter/src/platform/src/platform.dart:52:14) <asynchronous suspension> #12 PlatformObject.invokeRequest (package:ably_flutter/src/platform/src/platform_object.dart:74:22) <asynchronous suspension> #13 PushNotificationService.getDevice (package:ably_flutter_example/push_notifications/push_notification_service.dart:111:27) <asynchronous suspension>
Sorry, something went wrong.
➤ Automation for Jira commented:
The link to the corresponding Jira issue is https://ably.atlassian.net/browse/SDK-3919
ttypic
No branches or pull requests
Issue:
On iOS, unable to get the device ID and client ID from the LocalDevice object due to unhandled exception when loading LocalDevice info.
Error Message:
Exception throw from:
ably-flutter/example/lib/push_notifications/push_notification_service.dart
Line 111 in c4b8ed6
Actual problem from:
ably-flutter/lib/src/platform/src/codec.dart
Line 799 in c4b8ed6
More details:
This problem only happen on iOS due to the
recipient
contains object in the value.However, It is working fine on Android because the
recipient
is a simpleMap<String, String>
.Other Info:
Flutter: 3.13.5
Device: iPhone 11 (physical device), iOS 16.6.1
Editor: VS Code
Sample code: Ably example code from latest master branch (commit: c4b8ed6)
The text was updated successfully, but these errors were encountered: