Skip to content

Commit 1e1c6b9

Browse files
Merge branch 'main' into feature/ably-instance-store-concurrency
2 parents 003ccbf + 46c6947 commit 1e1c6b9

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

ios/Classes/codec/AblyFlutterWriter.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ - (void)writeValue:(id)value {
8787
}
8888

8989
#define WRITE_VALUE(DICTIONARY, JSON_KEY, VALUE) { \
90-
if (VALUE) { \
90+
if ( (VALUE) != nil ) { \
9191
[DICTIONARY setObject:VALUE forKey:JSON_KEY]; \
9292
} \
9393
}
@@ -228,7 +228,7 @@ +(NSString *) encodeChannelEvent: (ARTChannelEvent) event {
228228
TxChannelStateChange_event,
229229
[AblyFlutterWriter encodeChannelEvent: [stateChange event]]);
230230

231-
WRITE_VALUE(dictionary, TxChannelStateChange_resumed, [stateChange resumed]?@([stateChange resumed]):nil);
231+
WRITE_VALUE(dictionary, TxChannelStateChange_resumed, [NSNumber numberWithBool: [stateChange resumed]]);
232232
WRITE_VALUE(dictionary, TxChannelStateChange_reason, encodeErrorInfo([stateChange reason]));
233233
return dictionary;
234234
};

lib/src/platform/src/codec.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,7 @@ class Codec extends StandardMessageCodec {
10141014
_readFromJson<String>(jsonMap, TxChannelStateChange.previous));
10151015
final event = _decodeChannelEvent(
10161016
_readFromJson<String>(jsonMap, TxChannelStateChange.event));
1017-
final resumed = _readFromJson<bool>(jsonMap, TxChannelStateChange.resumed);
1017+
final resumed = _readFromJson<bool>(jsonMap, TxChannelStateChange.resumed)!;
10181018
final errorInfo =
10191019
toJsonMap(_readFromJson<Map>(jsonMap, TxChannelStateChange.reason));
10201020
final reason = (errorInfo == null) ? null : _decodeErrorInfo(errorInfo);

lib/src/realtime/src/channel_state_event.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class ChannelStateChange {
3030
ErrorInfo? reason;
3131

3232
/// https://docs.ably.com/client-lib-development-guide/features/#TH4
33-
final bool? resumed;
33+
final bool resumed;
3434

3535
/// initializes with [resumed] set to false
3636
ChannelStateChange(

0 commit comments

Comments
 (0)