Skip to content

Commit

Permalink
rename cbk to callback
Browse files Browse the repository at this point in the history
  • Loading branch information
tiholic committed May 20, 2021
1 parent 7179b2d commit 5dc16a3
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions ios/Classes/AblyFlutterPlugin.m
Expand Up @@ -95,7 +95,7 @@ -(void)registerWithCompletionHandler:(FlutterResult)completionHandler;
ARTDataQuery *const dataQuery = (ARTDataQuery*)[_dataMap objectForKey: TxTransportKeys_params];
ARTRest *const client = [ably getRest:messageData.handle];
ARTRestChannel *const channel = [client.channels get:channelName];
const id cbk = ^(ARTPaginatedResult<ARTMessage *> * _Nullable paginatedResult, ARTErrorInfo * _Nullable error) {
const id callback = ^(ARTPaginatedResult<ARTMessage *> * _Nullable paginatedResult, ARTErrorInfo * _Nullable error) {
if(error){
result([
FlutterError
Expand All @@ -109,9 +109,9 @@ -(void)registerWithCompletionHandler:(FlutterResult)completionHandler;
}
};
if (dataQuery) {
[channel history:dataQuery callback:cbk error: nil];
[channel history:dataQuery callback:callback error: nil];
} else {
[channel history:cbk];
[channel history:callback];
}
};

Expand All @@ -124,7 +124,7 @@ -(void)registerWithCompletionHandler:(FlutterResult)completionHandler;
ARTPresenceQuery *const dataQuery = (ARTPresenceQuery*)[_dataMap objectForKey: TxTransportKeys_params];
ARTRest *const client = [ably getRest:messageData.handle];
ARTRestChannel *const channel = [client.channels get:channelName];
const id cbk = ^(ARTPaginatedResult<ARTMessage *> * _Nullable paginatedResult, ARTErrorInfo * _Nullable error) {
const id callback = ^(ARTPaginatedResult<ARTMessage *> * _Nullable paginatedResult, ARTErrorInfo * _Nullable error) {
if(error){
result([
FlutterError
Expand All @@ -138,9 +138,9 @@ -(void)registerWithCompletionHandler:(FlutterResult)completionHandler;
}
};
if (dataQuery) {
[[channel presence] get:dataQuery callback:cbk error:nil];
[[channel presence] get:dataQuery callback:callback error:nil];
} else {
[[channel presence] get:cbk];
[[channel presence] get:callback];
}
};

Expand All @@ -153,7 +153,7 @@ -(void)registerWithCompletionHandler:(FlutterResult)completionHandler;
ARTPresenceQuery *const dataQuery = (ARTPresenceQuery*)[_dataMap objectForKey: TxTransportKeys_params];
ARTRest *const client = [ably getRest:messageData.handle];
ARTRestChannel *const channel = [client.channels get:channelName];
const id cbk = ^(ARTPaginatedResult<ARTMessage *> * _Nullable paginatedResult, ARTErrorInfo * _Nullable error) {
const id callback = ^(ARTPaginatedResult<ARTMessage *> * _Nullable paginatedResult, ARTErrorInfo * _Nullable error) {
if(error){
result([
FlutterError
Expand All @@ -167,9 +167,9 @@ -(void)registerWithCompletionHandler:(FlutterResult)completionHandler;
}
};
if (dataQuery) {
[[channel presence] history:dataQuery callback:cbk error:nil];
[[channel presence] history:dataQuery callback:callback error:nil];
} else {
[[channel presence] history:cbk];
[[channel presence] history:callback];
}
};

Expand Down Expand Up @@ -291,7 +291,7 @@ -(void)registerWithCompletionHandler:(FlutterResult)completionHandler;
ARTRealtimeChannelOptions *const channelOptions = (ARTRealtimeChannelOptions*)[realtimePayload objectForKey:TxTransportKeys_options];

ARTRealtimeChannel *const channel = [realtimeWithHandle.channels get:channelName];
const id cbk = ^(ARTPaginatedResult<ARTMessage *> * _Nullable paginatedResult, ARTErrorInfo * _Nullable error) {
const id callback = ^(ARTPaginatedResult<ARTMessage *> * _Nullable paginatedResult, ARTErrorInfo * _Nullable error) {
if (error) {
result([
FlutterError
Expand All @@ -304,7 +304,7 @@ -(void)registerWithCompletionHandler:(FlutterResult)completionHandler;
result([[AblyFlutterMessage alloc] initWithMessage:paginatedResult handle: paginatedResultHandle]);
}
};
[channel setOptions:channelOptions callback:cbk];
[channel setOptions:channelOptions callback:callback];
result(nil);
};

Expand All @@ -317,7 +317,7 @@ -(void)registerWithCompletionHandler:(FlutterResult)completionHandler;
ARTRealtimeHistoryQuery *const dataQuery = (ARTRealtimeHistoryQuery*)[_dataMap objectForKey: TxTransportKeys_params];
ARTRealtime *const client = [ably realtimeWithHandle:messageData.handle];
ARTRealtimeChannel *const channel = [client.channels get:channelName];
const id cbk = ^(ARTPaginatedResult<ARTMessage *> * _Nullable paginatedResult, ARTErrorInfo * _Nullable error) {
const id callback = ^(ARTPaginatedResult<ARTMessage *> * _Nullable paginatedResult, ARTErrorInfo * _Nullable error) {
if (error) {
result([
FlutterError
Expand All @@ -331,9 +331,9 @@ -(void)registerWithCompletionHandler:(FlutterResult)completionHandler;
}
};
if (dataQuery) {
[channel history:dataQuery callback:cbk error: nil];
[channel history:dataQuery callback:callback error: nil];
} else {
[channel history:cbk];
[channel history:callback];
}
};

Expand All @@ -346,7 +346,7 @@ -(void)registerWithCompletionHandler:(FlutterResult)completionHandler;
ARTRealtimePresenceQuery *const dataQuery = (ARTRealtimePresenceQuery*)[_dataMap objectForKey: TxTransportKeys_params];
ARTRealtime *const client = [ably realtimeWithHandle:messageData.handle];
ARTRealtimeChannel *const channel = [client.channels get:channelName];
const id cbk = ^(NSArray<ARTPresenceMessage *> * _Nullable presenceMembers, ARTErrorInfo * _Nullable error) {
const id callback = ^(NSArray<ARTPresenceMessage *> * _Nullable presenceMembers, ARTErrorInfo * _Nullable error) {
if (error) {
result([
FlutterError
Expand All @@ -359,9 +359,9 @@ -(void)registerWithCompletionHandler:(FlutterResult)completionHandler;
}
};
if (dataQuery) {
[[channel presence] get:dataQuery callback:cbk];
[[channel presence] get:dataQuery callback:callback];
} else {
[[channel presence] get:cbk];
[[channel presence] get:callback];
}
};

Expand All @@ -374,7 +374,7 @@ -(void)registerWithCompletionHandler:(FlutterResult)completionHandler;
ARTRealtimeHistoryQuery *const dataQuery = (ARTRealtimeHistoryQuery*)[_dataMap objectForKey: TxTransportKeys_params];
ARTRealtime *const client = [ably realtimeWithHandle:messageData.handle];
ARTRealtimeChannel *const channel = [client.channels get:channelName];
const id cbk = ^(ARTPaginatedResult<ARTMessage *> * _Nullable paginatedResult, ARTErrorInfo * _Nullable error) {
const id callback = ^(ARTPaginatedResult<ARTMessage *> * _Nullable paginatedResult, ARTErrorInfo * _Nullable error) {
if (error) {
result([
FlutterError
Expand All @@ -388,9 +388,9 @@ -(void)registerWithCompletionHandler:(FlutterResult)completionHandler;
}
};
if (dataQuery) {
[[channel presence] history:dataQuery callback:cbk error:nil];
[[channel presence] history:dataQuery callback:callback error:nil];
} else {
[[channel presence] history:cbk];
[[channel presence] history:callback];
}
};

Expand Down

0 comments on commit 5dc16a3

Please sign in to comment.