Skip to content

Commit 118bb9a

Browse files
committed
Cleanup from comments on PR
* Removed unnecessary String from a OneSignal log * Removed sendReceiveReceipt from handleReceivedNotification method
1 parent 3bd0fc2 commit 118bb9a

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

iOS_SDK/OneSignalSDK/Source/OSNotificationPayload.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ -(void)parseOtherApnsFields {
187187
}
188188

189189
- (NSString *)description {
190-
return [NSString stringWithFormat: @"Photo: notificationID=%@ templateID=%@ templateName=%@ contentAvailable=%@ mutableContent=%@ category=%@ rawPayload=%@", _notificationID, _templateID, _templateName, _contentAvailable ? @"YES" : @"NO", _mutableContent ? @"YES" : @"NO", _category, _rawPayload];
190+
return [NSString stringWithFormat: @"notificationID=%@ templateID=%@ templateName=%@ contentAvailable=%@ mutableContent=%@ category=%@ rawPayload=%@", _notificationID, _templateID, _templateName, _contentAvailable ? @"YES" : @"NO", _mutableContent ? @"YES" : @"NO", _category, _rawPayload];
191191
}
192192

193193
@end

iOS_SDK/OneSignalSDK/Source/OneSignalHelper.m

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -421,10 +421,6 @@ + (void)handleNotificationReceived:(OSNotificationDisplayType)displayType fromBa
421421
[OneSignal onesignal_Log:ONE_S_LL_VERBOSE
422422
message:[NSString stringWithFormat:@"handleNotificationReceived lastMessageID: %@ displayType: %lu",lastMessageID, (unsigned long)displayType]];
423423

424-
[OneSignal.receiveReceiptsController sendReceiveReceiptWithPlayerId:OneSignal.mUserId
425-
notificationId:lastMessageID
426-
appId:OneSignal.app_id];
427-
428424
if (handleNotificationReceived)
429425
handleNotificationReceived(notification);
430426
}

iOS_SDK/OneSignalSDK/Source/OneSignalReceiveReceiptsController.m

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,15 @@ - (BOOL)isReceiveReceiptsEnabled {
4040
}
4141

4242
- (void)sendReceiveReceiptWithNotificationId:(NSString *)notificationId {
43-
let playerId = [OneSignalUserDefaults.initShared getSavedStringForKey:USERID defaultValue:nil];
44-
let appId = [OneSignalUserDefaults.initShared getSavedStringForKey:NSUD_APP_ID defaultValue:nil];
43+
let sharedUserDefaults = OneSignalUserDefaults.initShared;
44+
let playerId = [sharedUserDefaults getSavedStringForKey:USERID defaultValue:nil];
45+
let appId = [sharedUserDefaults getSavedStringForKey:NSUD_APP_ID defaultValue:nil];
46+
47+
if (!playerId) {
48+
let message = [NSString stringWithFormat:@"OneSignal sendReceiveReceiptWithNotificationId notificationId: %@ failed with null playerId", notificationId];
49+
[OneSignal onesignal_Log:ONE_S_LL_VERBOSE message:message];
50+
return;
51+
}
4552

4653
[self sendReceiveReceiptWithPlayerId:playerId
4754
notificationId:notificationId

0 commit comments

Comments
 (0)