From cce43829ebd568cbb1c9f5ef2fc6b1bacc08786e Mon Sep 17 00:00:00 2001 From: Tom Burgin Date: Fri, 16 Feb 2018 14:35:52 -0500 Subject: [PATCH] use MOLFCMClient v1.5 (#238) --- Podfile.lock | 6 +++--- Source/santactl/Commands/sync/SNTCommandSyncManager.m | 9 +++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Podfile.lock b/Podfile.lock index 551627fb..ff6f3884 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -7,7 +7,7 @@ PODS: - MOLCertificate (1.5) - MOLCodesignChecker (1.5): - MOLCertificate (~> 1.3) - - MOLFCMClient (1.3): + - MOLFCMClient (1.5): - MOLAuthenticatingURLSession (~> 2.1) - OCMock (3.4) @@ -24,9 +24,9 @@ SPEC CHECKSUMS: MOLAuthenticatingURLSession: 5a5e31eb73248c3e92c79b9a285f031194e8404c MOLCertificate: c39cae866d24d36fbc78032affff83d401b5384a MOLCodesignChecker: fc9c64147811d7b0d0739127003e0630dff9213a - MOLFCMClient: 13d8b42db9d750e772f09cc38fc453922fece09f + MOLFCMClient: 88debb79f8c0454c3dd4f6514c2453e57a963c08 OCMock: 35ae71d6a8fcc1b59434d561d1520b9dd4f15765 PODFILE CHECKSUM: acd378b3727c923d912e09812da344f7375c14fe -COCOAPODS: 1.3.1 +COCOAPODS: 1.4.0 diff --git a/Source/santactl/Commands/sync/SNTCommandSyncManager.m b/Source/santactl/Commands/sync/SNTCommandSyncManager.m index 21c9abfc..7f7a36bc 100644 --- a/Source/santactl/Commands/sync/SNTCommandSyncManager.m +++ b/Source/santactl/Commands/sync/SNTCommandSyncManager.m @@ -178,7 +178,7 @@ static void reachabilityHandler( } - (void)isFCMListening:(void (^)(BOOL))reply { - reply((self.FCMClient.FCMToken != nil)); + reply(self.FCMClient.isConnected); } #pragma mark push notification methods @@ -205,16 +205,17 @@ static void reachabilityHandler( [self processFCMMessage:message withMachineID:machineID]; }]; - self.FCMClient.connectionErrorHandler = ^(NSError *error) { + self.FCMClient.connectionErrorHandler = ^(NSHTTPURLResponse *response, NSError *error) { STRONGIFY(self); - LOGE(@"FCM connection error: %@", error); + if (response) LOGE(@"FCM fatal response: %@", response); + if (error) LOGE(@"FCM fatal error: %@", error); [self.FCMClient disconnect]; self.FCMClient = nil; [self rescheduleTimerQueue:self.fullSyncTimer secondsFromNow:kDefaultFullSyncInterval]; }; self.FCMClient.loggingBlock = ^(NSString *log) { - LOGD(@"%@", log); + LOGD(@"FCMClient: %@", log); }; [self.FCMClient connect];