You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling the failure block of send tags for bad input
Previously we would log a warning and return on bad input for the sendTags method. Now we will also call the failure block with an error object with information on what went wrong. This fixes#951
// return if the user has not granted privacy permissions
1251
-
if ([selfshouldLogMissingPrivacyConsentErrorWithMethodName:@"sendTags:onSuccess:onFailure:"])
1251
+
if ([selfshouldLogMissingPrivacyConsentErrorWithMethodName:@"sendTags:onSuccess:onFailure:"]) {
1252
+
NSError *error = [NSErrorerrorWithDomain:@"com.onesignal.tags"code:0userInfo:@{@"error" : @"Your application has called sendTags:onSuccess:onFailure: before the user granted privacy permission. Please call `consentGranted(bool)` in order to provide user privacy consent"}];
1253
+
failureBlock(error);
1252
1254
return;
1255
+
}
1256
+
1253
1257
1254
1258
if (![NSJSONSerializationisValidJSONObject:keyValuePair]) {
1255
-
onesignal_Log(ONE_S_LL_WARN, [NSStringstringWithFormat:@"sendTags JSON Invalid: The following key/value pairs you attempted to send as tags are not valid JSON: %@", keyValuePair]);
1259
+
NSString *errorMessage = [NSStringstringWithFormat:@"sendTags JSON Invalid: The following key/value pairs you attempted to send as tags are not valid JSON: %@", keyValuePair];
0 commit comments