aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--Firebase/Messaging/FIRMMessageCode.h1
-rw-r--r--Firebase/Messaging/FIRMessagingTopicOperation.m4
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;
}