Commit c4593454 authored by Ran Greenberg's avatar Ran Greenberg Committed by GitHub

Merge pull request #62 from Benjamin-Dobell/fcm-ios

Accept string device tokens
parents 15798eb3 babfd9f1
......@@ -9,7 +9,7 @@
@interface RNNotifications : NSObject <RCTBridgeModule>
+ (void)didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken;
+ (void)didRegisterForRemoteNotificationsWithDeviceToken:(id)deviceToken;
+ (void)didFailToRegisterForRemoteNotificationsWithError:(NSError *)error;
+ (void)didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings;
+ (void)didUpdatePushCredentials:(PKPushCredentials *)credentials forType:(NSString *)type;
......
......@@ -235,11 +235,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
object:self
userInfo:@{@"deviceToken": [self deviceTokenToString:deviceToken]}];
userInfo:@{@"deviceToken": tokenRepresentation}];
}
+ (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