Commit babfd9f1 authored by Benjamin Dobell's avatar Benjamin Dobell

Accept string device tokens

parent e4cd4b91
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
@interface RNNotifications : NSObject <RCTBridgeModule> @interface RNNotifications : NSObject <RCTBridgeModule>
+ (void)didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken; + (void)didRegisterForRemoteNotificationsWithDeviceToken:(id)deviceToken;
+ (void)didFailToRegisterForRemoteNotificationsWithError:(NSError *)error; + (void)didFailToRegisterForRemoteNotificationsWithError:(NSError *)error;
+ (void)didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings; + (void)didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings;
+ (void)didUpdatePushCredentials:(PKPushCredentials *)credentials forType:(NSString *)type; + (void)didUpdatePushCredentials:(PKPushCredentials *)credentials forType:(NSString *)type;
......
...@@ -171,11 +171,12 @@ RCT_EXPORT_MODULE() ...@@ -171,11 +171,12 @@ RCT_EXPORT_MODULE()
} }
} }
+ (void)didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken + (void)didRegisterForRemoteNotificationsWithDeviceToken:(id)deviceToken
{ {
NSString *tokenRepresentation = [deviceToken isKindOfClass:[NSString class]] ? deviceToken : [self deviceTokenToString:deviceToken];
[[NSNotificationCenter defaultCenter] postNotificationName:RNNotificationsRegistered [[NSNotificationCenter defaultCenter] postNotificationName:RNNotificationsRegistered
object:self object:self
userInfo:@{@"deviceToken": [self deviceTokenToString:deviceToken]}]; userInfo:@{@"deviceToken": tokenRepresentation}];
} }
+ (void)didFailToRegisterForRemoteNotificationsWithError:(NSError *)error { + (void)didFailToRegisterForRemoteNotificationsWithError:(NSError *)error {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment