Skip to content

Commit

Permalink
Fixed connection fields accessor issues for ios
Browse files Browse the repository at this point in the history
  • Loading branch information
sacOO7 committed Feb 21, 2024
1 parent 5fd1f1f commit 3a109df
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions ios/Classes/AblyFlutter.m
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,6 @@ -(void)reset;

static const FlutterHandler _restTime = ^void(AblyFlutter *const ably, FlutterMethodCall *const call, const FlutterResult result) {
AblyFlutterMessage *const ablyMessage = call.arguments;

AblyInstanceStore *const instanceStore = [ably instanceStore];
ARTRest *const rest = [instanceStore restFrom:ablyMessage.handle];

Expand All @@ -603,31 +602,31 @@ -(void)reset;
AblyFlutterMessage *const ablyMessage = call.arguments;
AblyInstanceStore *const instanceStore = [ably instanceStore];
ARTRealtime *const realtime = [instanceStore realtimeFrom:ablyMessage.handle];
NSString *const connectionId = [realtime.connection.id];
NSString *const connectionId = [realtime.connection id];
result(connectionId);
};

static const FlutterHandler _connectionKey = ^void(AblyFlutter *const ably, FlutterMethodCall *const call, const FlutterResult result) {
AblyFlutterMessage *const ablyMessage = call.arguments;
AblyInstanceStore *const instanceStore = [ably instanceStore];
ARTRealtime *const realtime = [instanceStore realtimeFrom:ablyMessage.handle];
NSString *const connectionKey = [realtime.connection.key];
NSString *const connectionKey = [realtime.connection key];
result(connectionKey);
};

static const FlutterHandler _connectionError = ^void(AblyFlutter *const ably, FlutterMethodCall *const call, const FlutterResult result) {
static const FlutterHandler _connectionErrorReason = ^void(AblyFlutter *const ably, FlutterMethodCall *const call, const FlutterResult result) {
AblyFlutterMessage *const ablyMessage = call.arguments;
AblyInstanceStore *const instanceStore = [ably instanceStore];
ARTRealtime *const realtime = [instanceStore realtimeFrom:ablyMessage.handle];
ARTErrorInfo* connectionError = [realtime.connection.reason];
ARTErrorInfo* connectionError = [realtime.connection errorReason];
result(connectionError);
};

static const FlutterHandler _connectionRecoveryKey = ^void(AblyFlutter *const ably, FlutterMethodCall *const call, const FlutterResult result) {
AblyFlutterMessage *const ablyMessage = call.arguments;
AblyInstanceStore *const instanceStore = [ably instanceStore];
ARTRealtime *const realtime = [instanceStore realtimeFrom:ablyMessage.handle];
NSString *const connectionRecoveryKey = [realtime.connection.recoveryKey];
NSString *const connectionRecoveryKey = [realtime.connection recoveryKey];
result(connectionRecoveryKey);
};

Expand Down

0 comments on commit 3a109df

Please sign in to comment.