Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,10 @@ - (OneSignalClientError *)privacyConsentErrorWithRequestType:(NSString *)type {
- (void)executeRequest:(OneSignalRequest *)request onSuccess:(OSResultSuccessBlock)successBlock onFailure:(OSClientFailureBlock)failureBlock {
// If privacy consent is required but not yet given, any non-GET request should be blocked.
if (request.method != GET && [OSPrivacyConsentController shouldLogMissingPrivacyConsentErrorWithMethodName:nil]) {
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:@"Attempted to perform an HTTP request (%@) before the user provided privacy consent."];
OneSignalClientError *consentError = [self privacyConsentErrorWithRequestType:NSStringFromClass(request.class)];
[OneSignalLog onesignalLog:ONE_S_LL_WARN message:consentError.message];
if (failureBlock) {
failureBlock([self privacyConsentErrorWithRequestType:NSStringFromClass(request.class)]);
failureBlock(consentError);
}

return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ + (void)setRequiresPrivacyConsent:(BOOL)required {
return;

if ([self requiresUserPrivacyConsent] && !required) {
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:@"Cannot change setConsentRequired() from TRUE to FALSE"];
[OneSignalLog onesignalLog:ONE_S_LL_WARN message:@"Cannot change setConsentRequired() from TRUE to FALSE"];
return;
}
[OneSignalUserDefaults.initShared saveBoolForKey:OSUD_REQUIRES_USER_PRIVACY_CONSENT withValue:required];
Expand Down
22 changes: 11 additions & 11 deletions iOS_SDK/OneSignalSDK/OneSignalCore/Source/OSStubInAppMessages.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,48 +36,48 @@ @implementation OSStubInAppMessages
}

+ (void)addClickListener:(NSObject<OSInAppMessageClickListener> * _Nullable)listener {
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:@"OneSignalInAppMessages not found. In order to use OneSignal's In App Messaging features the OneSignalInAppMessages module must be added."];
[OneSignalLog onesignalLog:ONE_S_LL_WARN message:@"OneSignalInAppMessages not found. In order to use OneSignal's In App Messaging features the OneSignalInAppMessages module must be added."];
}

+ (void)addLifecycleListener:(NSObject<OSInAppMessageLifecycleListener> * _Nullable)listener {
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:@"OneSignalInAppMessages not found. In order to use OneSignal's In App Messaging features the OneSignalInAppMessages module must be added."];
[OneSignalLog onesignalLog:ONE_S_LL_WARN message:@"OneSignalInAppMessages not found. In order to use OneSignal's In App Messaging features the OneSignalInAppMessages module must be added."];
}

+ (void)addTrigger:(NSString * _Nonnull)key withValue:(NSString * _Nonnull)value {
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:@"OneSignalInAppMessages not found. In order to use OneSignal's In App Messaging features the OneSignalInAppMessages module must be added."];
[OneSignalLog onesignalLog:ONE_S_LL_WARN message:@"OneSignalInAppMessages not found. In order to use OneSignal's In App Messaging features the OneSignalInAppMessages module must be added."];
}

+ (void)addTriggers:(NSDictionary<NSString *,NSString *> * _Nonnull)triggers {
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:@"OneSignalInAppMessages not found. In order to use OneSignal's In App Messaging features the OneSignalInAppMessages module must be added."];
[OneSignalLog onesignalLog:ONE_S_LL_WARN message:@"OneSignalInAppMessages not found. In order to use OneSignal's In App Messaging features the OneSignalInAppMessages module must be added."];
}

+ (void)clearTriggers {
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:@"OneSignalInAppMessages not found. In order to use OneSignal's In App Messaging features the OneSignalInAppMessages module must be added."];
[OneSignalLog onesignalLog:ONE_S_LL_WARN message:@"OneSignalInAppMessages not found. In order to use OneSignal's In App Messaging features the OneSignalInAppMessages module must be added."];
}

+ (BOOL)paused {
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:@"OneSignalInAppMessages not found. In order to use OneSignal's In App Messaging features the OneSignalInAppMessages module must be added."];
[OneSignalLog onesignalLog:ONE_S_LL_WARN message:@"OneSignalInAppMessages not found. In order to use OneSignal's In App Messaging features the OneSignalInAppMessages module must be added."];
return true;
}

+ (void)paused:(BOOL)pause {
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:@"OneSignalInAppMessages not found. In order to use OneSignal's In App Messaging features the OneSignalInAppMessages module must be added."];
[OneSignalLog onesignalLog:ONE_S_LL_WARN message:@"OneSignalInAppMessages not found. In order to use OneSignal's In App Messaging features the OneSignalInAppMessages module must be added."];
}

+ (void)removeClickListener:(NSObject<OSInAppMessageClickListener> * _Nullable)listener {
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:@"OneSignalInAppMessages not found. In order to use OneSignal's In App Messaging features the OneSignalInAppMessages module must be added."];
[OneSignalLog onesignalLog:ONE_S_LL_WARN message:@"OneSignalInAppMessages not found. In order to use OneSignal's In App Messaging features the OneSignalInAppMessages module must be added."];
}

+ (void)removeLifecycleListener:(NSObject<OSInAppMessageLifecycleListener> * _Nullable)listener {
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:@"OneSignalInAppMessages not found. In order to use OneSignal's In App Messaging features the OneSignalInAppMessages module must be added."];
[OneSignalLog onesignalLog:ONE_S_LL_WARN message:@"OneSignalInAppMessages not found. In order to use OneSignal's In App Messaging features the OneSignalInAppMessages module must be added."];
}

+ (void)removeTrigger:(NSString * _Nonnull)key {
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:@"OneSignalInAppMessages not found. In order to use OneSignal's In App Messaging features the OneSignalInAppMessages module must be added."];
[OneSignalLog onesignalLog:ONE_S_LL_WARN message:@"OneSignalInAppMessages not found. In order to use OneSignal's In App Messaging features the OneSignalInAppMessages module must be added."];
}

+ (void)removeTriggers:(NSArray<NSString *> * _Nonnull)keys {
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:@"OneSignalInAppMessages not found. In order to use OneSignal's In App Messaging features the OneSignalInAppMessages module must be added."];
[OneSignalLog onesignalLog:ONE_S_LL_WARN message:@"OneSignalInAppMessages not found. In order to use OneSignal's In App Messaging features the OneSignalInAppMessages module must be added."];
}

@end
6 changes: 3 additions & 3 deletions iOS_SDK/OneSignalSDK/OneSignalCore/Source/OSStubLocation.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@ @implementation OSStubLocation
}

+ (BOOL)isShared {
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:@"OneSignalLocation not found. In order to use OneSignal's location features the OneSignalLocation module must be added."];
[OneSignalLog onesignalLog:ONE_S_LL_WARN message:@"OneSignalLocation not found. In order to use OneSignal's location features the OneSignalLocation module must be added."];
return false;
}

+ (void)requestPermission {
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:@"OneSignalLocation not found. In order to use OneSignal's location features the OneSignalLocation module must be added."];
[OneSignalLog onesignalLog:ONE_S_LL_WARN message:@"OneSignalLocation not found. In order to use OneSignal's location features the OneSignalLocation module must be added."];
}

+ (void)setShared:(BOOL)enable {
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:@"OneSignalLocation not found. In order to use OneSignal's location features the OneSignalLocation module must be added."];
[OneSignalLog onesignalLog:ONE_S_LL_WARN message:@"OneSignalLocation not found. In order to use OneSignal's location features the OneSignalLocation module must be added."];
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ @implementation DirectDownloadDelegate
-(void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask didReceiveData:(NSData *)data {
NSError *fileHandleError;
if (![outputHandle writeData:data error:&fileHandleError]) {
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:[NSString stringWithFormat:@"OneSignal Error encountered while downloading attachment: %@", fileHandleError]];
[OneSignalLog onesignalLog:ONE_S_LL_WARN message:[NSString stringWithFormat:@"OneSignal Error encountered while downloading attachment: %@", fileHandleError]];
}
}

Expand Down Expand Up @@ -271,7 +271,7 @@ + (NSString *)downloadMediaAndSaveInBundle:(NSString *)urlString {
let mimeType = [NSURLSession downloadItemAtURL:url toFile:filePath error:&error];

if (error) {
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:[NSString stringWithFormat:@"Encountered an error while attempting to download file with URL: %@", error]];
[OneSignalLog onesignalLog:ONE_S_LL_WARN message:[NSString stringWithFormat:@"Encountered an error while attempting to download file with URL: %@", error]];
return nil;
}

Expand All @@ -286,7 +286,7 @@ + (NSString *)downloadMediaAndSaveInBundle:(NSString *)urlString {
[[NSFileManager defaultManager] moveItemAtPath:filePath toPath:newPath error:&error];

if (error) {
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:[NSString stringWithFormat:@"Encountered an error while attempting to download file with URL: %@", error]];
[OneSignalLog onesignalLog:ONE_S_LL_WARN message:[NSString stringWithFormat:@"Encountered an error while attempting to download file with URL: %@", error]];
return nil;
}

Expand All @@ -304,7 +304,7 @@ + (NSString *)downloadMediaAndSaveInBundle:(NSString *)urlString {
[standardUserDefaults saveObjectForKey:OSUD_TEMP_CACHED_NOTIFICATION_MEDIA withValue:appendedCache];
return name;
} @catch (NSException *exception) {
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:[NSString stringWithFormat:@"OneSignal encountered an exception while downloading file (%@), exception: %@", url, exception.description]];
[OneSignalLog onesignalLog:ONE_S_LL_WARN message:[NSString stringWithFormat:@"OneSignal encountered an exception while downloading file (%@), exception: %@", url, exception.description]];

return nil;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ + (void)onNotificationReceived:(NSString *)receivedNotificationId withBlockingTa
dispatch_semaphore_signal(semaphore);
}
} failureBlock:^(NSError *error) {
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:[NSString stringWithFormat:@"OneSignal onNotificationReceived sendReceiveReceipt Failed for playerId: %@ error: %@", playerId, error]];
[OneSignalLog onesignalLog:ONE_S_LL_INFO message:[NSString stringWithFormat:@"OneSignal onNotificationReceived sendReceiveReceipt Failed for playerId: %@ error: %@", playerId, error]];
if (semaphore) {
dispatch_semaphore_signal(semaphore);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ - (void)resetRedisplayMessagesBySession {

- (void)deleteInactiveMessage:(OSInAppMessageInternal *)message {
let deleteMessage = [NSString stringWithFormat:@"Deleting inactive in-app message from cache: %@", message.messageId];
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:deleteMessage];
[OneSignalLog onesignalLog:ONE_S_LL_DEBUG message:deleteMessage];
NSMutableArray *newMessagesArray = [NSMutableArray arrayWithArray:self.messages];
[newMessagesArray removeObject: message];
self.messages = newMessagesArray;
Expand Down Expand Up @@ -872,7 +872,7 @@ - (void)messageViewPageImpressionRequest:(OSInAppMessageInternal *)message withP
}
onFailure:^(OneSignalClientError *error) {
NSString *errorMessage = [NSString stringWithFormat:@"In App Message with message id: %@ and page id: %@, failed POST page impression update with error: %@", message.messageId, pageId, error.message];
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:errorMessage];
[OneSignalLog onesignalLog:ONE_S_LL_INFO message:errorMessage];
if (message) {
[self.viewedPageIDs removeObject:messagePrefixedPageId];
}
Expand Down Expand Up @@ -912,7 +912,7 @@ - (void)messageViewImpressionRequest:(OSInAppMessageInternal *)message {
}
onFailure:^(OneSignalClientError *error) {
NSString *errorMessage = [NSString stringWithFormat:@"In App Message with id: %@, failed POST impression update with error: %@", message.messageId, error.message];
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:errorMessage];
[OneSignalLog onesignalLog:ONE_S_LL_INFO message:errorMessage];

// If the post failed, remove the messageId from the impressionedInAppMessages set
[self.impressionedInAppMessages removeObject:message.messageId];
Expand Down Expand Up @@ -1333,7 +1333,7 @@ - (void)sendClickRESTCall:(OSInAppMessageInternal *)message withAction:(OSInAppM
}
onFailure:^(OneSignalClientError *error) {
NSString *errorMessage = [NSString stringWithFormat:@"In App Message with id: %@, failed POST click update for click id: %@, with error: %@", message.messageId, action.clickId, error.message];
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:errorMessage];
[OneSignalLog onesignalLog:ONE_S_LL_INFO message:errorMessage];

// Remove clickId from local clickedClickIds since click was not tracked
[self.clickedClickIds removeObject:action.clickId];
Expand All @@ -1359,7 +1359,7 @@ - (void)sendOutcomes:(NSArray<OSInAppMessageOutcome *>*)outcomes forMessageId:(N

- (void)sendClickActionOutcomes:(NSArray<OSInAppMessageOutcome *> *)outcomes {
if (![OSOutcomes sharedController]) {
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:@"Make sure OneSignal init is called first"];
[OneSignalLog onesignalLog:ONE_S_LL_WARN message:@"Make sure OneSignal init is called first"];
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ - (void)handlePrompt:(void (^)(PromptActionResult result))completionHandler {
[invocation setArgument: &completionHandler atIndex: 3];
[invocation invoke];
} else {
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:@"OneSignalLocation not found. In order to use OneSignal's location features the OneSignalLocation module must be added."];
[OneSignalLog onesignalLog:ONE_S_LL_WARN message:@"OneSignalLocation not found. In order to use OneSignal's location features the OneSignalLocation module must be added."];
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ - (void)resetWebViewToMaxBoundsAndResizeHeight:(void (^) (NSNumber *newHeight))
[self.webView evaluateJavaScript:OS_JS_GET_PAGE_META_DATA_METHOD completionHandler:^(NSDictionary *result, NSError *error) {
if (error) {
NSString *errorMessage = [NSString stringWithFormat:@"Javascript Method: %@ Evaluated with Error: %@", OS_JS_GET_PAGE_META_DATA_METHOD, error];
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:errorMessage];
[OneSignalLog onesignalLog:ONE_S_LL_INFO message:errorMessage];
return;
}
NSString *successMessage = [NSString stringWithFormat:@"Javascript Method: %@ Evaluated with Success: %@", OS_JS_GET_PAGE_META_DATA_METHOD, result];
Expand All @@ -182,7 +182,7 @@ - (void)updateSafeAreaInsets {
[self.webView evaluateJavaScript:setInsetsString completionHandler:^(NSDictionary *result, NSError * _Nullable error) {
if (error) {
NSString *errorMessage = [NSString stringWithFormat:@"Javascript Method: %@ Evaluated with Error: %@", OS_SET_SAFE_AREA_INSETS_METHOD, error];
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:errorMessage];
[OneSignalLog onesignalLog:ONE_S_LL_INFO message:errorMessage];
return;
}
NSString *successMessage = [NSString stringWithFormat:@"Javascript Method: %@ Evaluated with Success: %@", OS_SET_SAFE_AREA_INSETS_METHOD, result];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ - (void)encounteredErrorLoadingMessageContent:(NSError * _Nullable)error {
if (error.code == 410 || error.code == 404) {
[self.delegate messageIsNotActive:self.message];
}
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:message];
[OneSignalLog onesignalLog:ONE_S_LL_INFO message:message];
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ -(void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigati
}

-(void)webView:(WKWebView *)webView didFailNavigation:(WKNavigation *)navigation withError:(NSError *)error {
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:[NSString stringWithFormat:@"webView: An error occurred during navigation: %@", error]];
[OneSignalLog onesignalLog:ONE_S_LL_INFO message:[NSString stringWithFormat:@"webView: An error occurred during navigation: %@", error]];
}

- (void)pinSubviewToMarginsWithSubview:(UIView *)subview withSuperview:(UIView *)superview {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ + (void)internalGetLocation:(bool)prompt fallbackToSettings:(BOOL)fallback {
}

else {
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:@"Include a privacy NSLocationAlwaysUsageDescription or NSLocationWhenInUseUsageDescription in your info.plist to request location permissions."];
[OneSignalLog onesignalLog:ONE_S_LL_WARN message:@"Include a privacy NSLocationAlwaysUsageDescription or NSLocationWhenInUseUsageDescription in your info.plist to request location permissions."];
[self sendAndClearLocationListener:LOCATION_PERMISSIONS_MISSING_INFO_PLIST];
}

Expand Down Expand Up @@ -406,7 +406,7 @@ - (void)locationManager:(id)manager didUpdateLocations:(NSArray *)locations {
}

- (void)locationManager:(id)manager didFailWithError:(NSError *)error {
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:[NSString stringWithFormat:@"CLLocationManager did fail with error: %@", error]];
[OneSignalLog onesignalLog:ONE_S_LL_INFO message:[NSString stringWithFormat:@"CLLocationManager did fail with error: %@", error]];
[OneSignalLocationManager sendAndClearLocationListener:ERROR];
if ([OneSignalLocationManager backgroundTaskIsActive]) {
[OneSignalLocationManager endTask];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ - (void)setCompletionBlock:(OSNotificationDisplayResponse)completion {

- (void)display {
if (!_completion) {
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:@"OSNotificationWillDisplayEvent.notification.display cannot be called due to timing out or notification was already displayed."];
[OneSignalLog onesignalLog:ONE_S_LL_WARN message:@"OSNotificationWillDisplayEvent.notification.display cannot be called due to timing out or notification was already displayed."];
}
[self complete:self];
}
Expand Down
Loading
Loading