ably / ably-flutter

A wrapper around our Cocoa and Java client library SDKs, providing iOS and Android support for those using Flutter and Dart.
https://ably.com/download
Apache License 2.0
60 stars 16 forks source link

error with ios 17 and getting the device id #494

Closed asoap closed 1 year ago

asoap commented 1 year ago

I am getting the device id from the ablyClient after connecting to Ably:

ably.LocalDevice device = await ablyClient!.device();
print(device.id);

This works just fine with iOS 14. But when switching to iOS 17 we get this error:

[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
codec.dart:799
#4      Codec._decodeDeviceDetails
codec.dart:783
#5      Codec._decodeLocalDevice
codec.dart:809
#6      _CodecPair.decode
codec.dart:51
#7      Codec.readValueOfType
codec.dart:230
#8      StandardMessageCodec.readValue
message_codecs.dart:478
#9      StandardMethodCodec.decodeEnvelope (package:flutter/src/servic<…>
sync-by-unito[bot] commented 1 year ago

➤ Automation for Jira commented:

The link to the corresponding Jira issue is https://ably.atlassian.net/browse/SDK-3939

stmoreau commented 1 year ago

Hi @asoap thanks for raising this, we seem to have looked into a very similar error https://github.com/ably/ably-flutter/pull/492 which we released. Could you please share what version of flutter you're using and if it's still an issue using the latest release?

stmoreau commented 1 year ago

Closing due to inactivity. Re-open if you're still facing the same issue and please remember to provide additional information needed.

asoap commented 1 year ago

We switched from using the device ID, to the client ID. So we weren't able to test this. The developer that was using ios wasn't using the latest version of flutter, but it wasn't a very old version. Sorry, we won't be able to help on this one.