From c33cbb46c8d4569f188943d261777e9eef7042f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96d=C3=B6n=20=C3=96rzsik?= Date: Mon, 8 Oct 2018 12:13:37 +0200 Subject: [PATCH 1/2] fcm and apns token compatibility added --- src/ios/PushPlugin.m | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/ios/PushPlugin.m b/src/ios/PushPlugin.m index eb7b69ef0..38c9883f7 100644 --- a/src/ios/PushPlugin.m +++ b/src/ios/PushPlugin.m @@ -67,7 +67,7 @@ -(void)initRegistration; } } - [self registerWithToken:registrationToken]; + [self registerWithToken:registrationToken withRegistrationType:@"FCM"]; } else { NSLog(@"FCM token is null"); } @@ -405,9 +405,7 @@ - (void)didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { [results setValue:dev.model forKey:@"deviceModel"]; [results setValue:dev.systemVersion forKey:@"deviceSystemVersion"]; - if(![self usesFCM]) { - [self registerWithToken: token]; - } + [self registerWithToken: token withRegistrationType:@"APNS"]; #endif } @@ -547,15 +545,12 @@ -(void)successWithMessage:(NSString *)myCallbackId withMsg:(NSString *)message } } --(void)registerWithToken:(NSString*)token; { +-(void)registerWithToken:(NSString*)token withRegistrationType:(NSString*)registrationType +{ // Send result to trigger 'registration' event but keep callback NSMutableDictionary* message = [NSMutableDictionary dictionaryWithCapacity:2]; [message setObject:token forKey:@"registrationId"]; - if ([self usesFCM]) { - [message setObject:@"FCM" forKey:@"registrationType"]; - } else { - [message setObject:@"APNS" forKey:@"registrationType"]; - } + [message setObject:registrationType forKey:@"registrationType"]; CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:message]; [pluginResult setKeepCallbackAsBool:YES]; [self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId]; From c1ce2f8390d76b66078c1aea9f65b45c9031e3e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96d=C3=B6n=20=C3=96rzsik?= Date: Tue, 9 Oct 2018 13:09:05 +0200 Subject: [PATCH 2/2] FCM version for firebase messaging set to 11.6.2 --- plugin.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugin.xml b/plugin.xml index f1d5b63e9..69c13d6ed 100755 --- a/plugin.xml +++ b/plugin.xml @@ -40,7 +40,8 @@ - + +