Skip to content

Commit

Permalink
Empty handle check.
Browse files Browse the repository at this point in the history
  • Loading branch information
maratal committed Aug 10, 2024
1 parent 18d1207 commit 9259fc9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ios/Classes/AblyFlutter.m
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
#pragma mark - Push Notifications Registration - UIApplicationDelegate

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
if (PushHandlers.pushActivatorHandle == nil)
return;
ARTRealtime *const realtime = [_instanceStore realtimeFrom:PushHandlers.pushActivatorHandle];
if (realtime) {
[ARTPush didRegisterForRemoteNotificationsWithDeviceToken:deviceToken realtime:realtime];
Expand All @@ -807,6 +809,8 @@ - (void)application:(UIApplication *)application didRegisterForRemoteNotificatio
}

- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error {
if (PushHandlers.pushActivatorHandle == nil)
return;
ARTRealtime *const realtime = [_instanceStore realtimeFrom:PushHandlers.pushActivatorHandle];
if (realtime) {
[ARTPush didFailToRegisterForRemoteNotificationsWithError:error realtime:realtime];
Expand Down

0 comments on commit 9259fc9

Please sign in to comment.