Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: expect NSString token instead NSData
  • Loading branch information
diegomura committed Jun 14, 2021
commit c11cd6b0765ed03b65a970a56fd972d285bf0c52
4 changes: 2 additions & 2 deletions RNNotifications/RNNRouter.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


@protocol RNNRerouterDelegate <NSObject>
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken;
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSString *)deviceToken;
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error;
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler;
- (void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler;
Expand All @@ -27,7 +27,7 @@

@property (nonatomic, weak) id <RNNRerouterDelegate> _Nullable delegate;

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken;
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSString *)deviceToken;
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error;
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(nullable void (^)(UIBackgroundFetchResult))completionHandler;
- (void)didUpdatePushCredentials:(PKPushCredentials *)credentials forType:(NSString *)type;
Expand Down
14 changes: 7 additions & 7 deletions RNNotifications/RNNRouter.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ - (instancetype)init
if(self)
{
_pendingDelegateCalls = [NSMutableArray new];

}
return self;
}
Expand All @@ -48,15 +48,15 @@ - (instancetype)init
- (void)setDelegate:(id<RNNRerouterDelegate,UNUserNotificationCenterDelegate>)delegate
{
_delegate = delegate;

while (self.pendingDelegateCalls.count > 0)
{
void(^block)(void) = _pendingDelegateCalls.lastObject;
block();
[_pendingDelegateCalls removeLastObject];
}


}


Expand All @@ -78,7 +78,7 @@ - (void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNot
void(^callLaterBlock)(void) = ^{
[self->_delegate userNotificationCenter:center willPresentNotification:notification withCompletionHandler:completionHandler];
};

if(_delegate)
{
callLaterBlock();
Expand All @@ -94,7 +94,7 @@ - (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNoti
void(^callLaterBlock)(void) = ^{
[self->_delegate userNotificationCenter:center didReceiveNotificationResponse:response withCompletionHandler:completionHandler];
};

if(_delegate)
{
callLaterBlock();
Expand All @@ -105,7 +105,7 @@ - (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNoti
}
}

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSString *)deviceToken
{
if (self.delegate != nil)
{
Expand Down
Loading