diff options
author | Chen Liang <chliang@google.com> | 2018-04-02 16:34:54 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-02 16:34:54 -0700 |
commit | dfc7d5e5fa1966ba3b08ec9eed70d940ab987e6b (patch) | |
tree | f27382683633374531fd23c40c43ce8a05f15d32 /Firebase/Messaging | |
parent | c46e7f2928f9af3ad7767d072d6c9d4d8ad81012 (diff) |
improve logging when subscription failed (#1017)
Diffstat (limited to 'Firebase/Messaging')
-rw-r--r-- | Firebase/Messaging/FIRMMessageCode.h | 1 | ||||
-rw-r--r-- | Firebase/Messaging/FIRMessagingTopicOperation.m | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/Firebase/Messaging/FIRMMessageCode.h b/Firebase/Messaging/FIRMMessageCode.h index 2b6ddad..1ec3a39 100644 --- a/Firebase/Messaging/FIRMMessageCode.h +++ b/Firebase/Messaging/FIRMMessageCode.h @@ -172,6 +172,7 @@ typedef NS_ENUM(NSInteger, FIRMessagingMessageCode) { kFIRMessagingMessageCodeTopicOption001 = 17001, // I-FCM017001 kFIRMessagingMessageCodeTopicOption002 = 17002, // I-FCM017002 kFIRMessagingMessageCodeTopicOptionTopicEncodingFailed = 17003, // I-FCM017003 + kFIRMessagingMessageCodeTopicOperationEmptyResponse = 17004, // I-FCM017004 // FIRMessagingUtilities.m kFIRMessagingMessageCodeUtilities000 = 18000, // I-FCM018000 kFIRMessagingMessageCodeUtilities001 = 18001, // I-FCM018001 diff --git a/Firebase/Messaging/FIRMessagingTopicOperation.m b/Firebase/Messaging/FIRMessagingTopicOperation.m index 1546d47..6703178 100644 --- a/Firebase/Messaging/FIRMessagingTopicOperation.m +++ b/Firebase/Messaging/FIRMessagingTopicOperation.m @@ -226,6 +226,8 @@ NSString *FIRMessagingSubscriptionsServer() { } NSString *response = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; if (response.length == 0) { + FIRMessagingLoggerDebug(kFIRMessagingMessageCodeTopicOperationEmptyResponse, + @"Invalid registration response - zero length."); [self finishWithError:[NSError errorWithFCMErrorCode:kFIRMessagingErrorCodeUnknown]]; return; } @@ -233,7 +235,7 @@ NSString *FIRMessagingSubscriptionsServer() { _FIRMessagingDevAssert(parts.count, @"Invalid registration response"); if (![parts[0] isEqualToString:@"token"] || parts.count <= 1) { FIRMessagingLoggerDebug(kFIRMessagingMessageCodeTopicOption002, - @"Invalid registration request, response"); + @"Invalid registration response %@", response); [self finishWithError:[NSError errorWithFCMErrorCode:kFIRMessagingErrorCodeUnknown]]; return; } |