Skip to content

Commit 8c57492

Browse files
committed
using visual logging in OneSignalFramework
1 parent da05fb4 commit 8c57492

26 files changed

+237
-237
lines changed

iOS_SDK/OneSignalSDK/Source/OSAttributedFocusTimeProcessor.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ - (void)beginDelayBackgroundTask {
5454
}
5555

5656
- (void)endDelayBackgroundTask {
57-
[OneSignalLog onesignalLog:ONE_S_LL_DEBUG
57+
[OneSignal onesignalLog:ONE_S_LL_DEBUG
5858
message:[NSString stringWithFormat:@"OSAttributedFocusTimeProcessor:endDelayBackgroundTask:%lu", (unsigned long)delayBackgroundTask]];
5959
[UIApplication.sharedApplication endBackgroundTask:delayBackgroundTask];
6060
delayBackgroundTask = UIBackgroundTaskInvalid;
@@ -71,7 +71,7 @@ - (NSString*)unsentActiveTimeUserDefaultsKey {
7171
- (void)sendOnFocusCall:(OSFocusCallParams *)params {
7272
let unsentActive = [super getUnsentActiveTime];
7373
let totalTimeActive = unsentActive + params.timeElapsed;
74-
[OneSignalLog onesignalLog:ONE_S_LL_DEBUG
74+
[OneSignal onesignalLog:ONE_S_LL_DEBUG
7575
message:[NSString stringWithFormat:@"sendOnFocusCall attributed with totalTimeActive %f", totalTimeActive]];
7676

7777
[super saveUnsentActiveTime:totalTimeActive];
@@ -80,7 +80,7 @@ - (void)sendOnFocusCall:(OSFocusCallParams *)params {
8080

8181
- (void)sendUnsentActiveTime:(OSFocusCallParams *)params {
8282
let unsentActive = [super getUnsentActiveTime];
83-
[OneSignalLog onesignalLog:ONE_S_LL_DEBUG
83+
[OneSignal onesignalLog:ONE_S_LL_DEBUG
8484
message:[NSString stringWithFormat:@"sendUnsentActiveTime attributed with unsentActive %f", unsentActive]];
8585

8686
[self sendOnFocusCallWithParams:params totalTimeActive:unsentActive];
@@ -113,14 +113,14 @@ - (void)sendBackgroundAttributedFocusPingWithNSTimer:(NSTimer*)timer {
113113

114114
- (void)sendBackgroundAttributedFocusPingWithParams:(OSFocusCallParams *)params withTotalTimeActive:(NSNumber*)totalTimeActive {
115115
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
116-
[OneSignalLog onesignalLog:ONE_S_LL_DEBUG message:@"beginBackgroundAttributedFocusTask start"];
116+
[OneSignal onesignalLog:ONE_S_LL_DEBUG message:@"beginBackgroundAttributedFocusTask start"];
117117

118118
[OneSignal.stateSynchronizer sendOnFocusTime:totalTimeActive params:params withSuccess:^(NSDictionary *result) {
119119
[super saveUnsentActiveTime:0];
120-
[OneSignalLog onesignalLog:ONE_S_LL_DEBUG message:@"sendOnFocusCallWithParams attributed succeed, saveUnsentActiveTime with 0"];
120+
[OneSignal onesignalLog:ONE_S_LL_DEBUG message:@"sendOnFocusCallWithParams attributed succeed, saveUnsentActiveTime with 0"];
121121
[self endDelayBackgroundTask];
122122
} onFailure:^(NSDictionary<NSString *, NSError *> *errors) {
123-
[OneSignalLog onesignalLog:ONE_S_LL_DEBUG message:@"sendOnFocusCallWithParams attributed failed, will retry on next open"];
123+
[OneSignal onesignalLog:ONE_S_LL_DEBUG message:@"sendOnFocusCallWithParams attributed failed, will retry on next open"];
124124
[self endDelayBackgroundTask];
125125
}];
126126
});

iOS_SDK/OneSignalSDK/Source/OSBaseFocusTimeProcessor.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ - (int)getMinSessionTime {
4444
}
4545

4646
- (BOOL)hasMinSyncTime:(NSTimeInterval)activeTime {
47-
[OneSignalLog onesignalLog:ONE_S_LL_DEBUG message:[NSString stringWithFormat:@"OSBaseFocusTimeProcessor hasMinSyncTime getMinSessionTime: %d activeTime: %f", [self getMinSessionTime], activeTime]];
47+
[OneSignal onesignalLog:ONE_S_LL_DEBUG message:[NSString stringWithFormat:@"OSBaseFocusTimeProcessor hasMinSyncTime getMinSessionTime: %d activeTime: %f", [self getMinSessionTime], activeTime]];
4848
return activeTime >= [self getMinSessionTime];
4949
}
5050

iOS_SDK/OneSignalSDK/Source/OSDynamicTriggerController.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ - (BOOL)dynamicTriggerShouldFire:(OSTrigger *)trigger withMessageId:(NSString *)
7979
if ([trigger.kind isEqualToString:OS_DYNAMIC_TRIGGER_KIND_SESSION_TIME]) {
8080
let currentDuration = fabs([[OneSignal sessionLaunchTime] timeIntervalSinceNow]);
8181
if ([self evaluateTimeInterval:requiredTimeValue withCurrentValue:currentDuration forOperator:trigger.operatorType]) {
82-
[OneSignalLog onesignalLog:ONE_S_LL_VERBOSE message:[NSString stringWithFormat:@"session time trigger completed: %@", trigger.triggerId]];
82+
[OneSignal onesignalLog:ONE_S_LL_VERBOSE message:[NSString stringWithFormat:@"session time trigger completed: %@", trigger.triggerId]];
8383
[self.delegate dynamicTriggerCompleted:trigger.triggerId];
8484
//[self.delegate dynamicTriggerFired:trigger.triggerId];
8585
return true;
@@ -94,7 +94,7 @@ - (BOOL)dynamicTriggerShouldFire:(OSTrigger *)trigger withMessageId:(NSString *)
9494
let timestampSinceLastMessage = fabs([self.timeSinceLastMessage timeIntervalSinceNow]);
9595

9696
if ([self evaluateTimeInterval:requiredTimeValue withCurrentValue:timestampSinceLastMessage forOperator:trigger.operatorType]) {
97-
[OneSignalLog onesignalLog:ONE_S_LL_VERBOSE message:[NSString stringWithFormat:@"time since last inapp trigger completed: %@", trigger.triggerId]];
97+
[OneSignal onesignalLog:ONE_S_LL_VERBOSE message:[NSString stringWithFormat:@"time since last inapp trigger completed: %@", trigger.triggerId]];
9898
return true;
9999
}
100100
offset = requiredTimeValue - timestampSinceLastMessage;
@@ -111,7 +111,7 @@ - (BOOL)dynamicTriggerShouldFire:(OSTrigger *)trigger withMessageId:(NSString *)
111111
userInfo:@{@"trigger" : trigger}
112112
repeats:false];
113113
if (timer) {
114-
[OneSignalLog onesignalLog:ONE_S_LL_VERBOSE message:[NSString stringWithFormat:@"timer added for triggerId: %@, messageId: %@", trigger.triggerId, messageId]];
114+
[OneSignal onesignalLog:ONE_S_LL_VERBOSE message:[NSString stringWithFormat:@"timer added for triggerId: %@, messageId: %@", trigger.triggerId, messageId]];
115115
[[NSRunLoop mainRunLoop] addTimer:timer forMode:NSRunLoopCommonModes];
116116
}
117117

@@ -139,7 +139,7 @@ - (BOOL)evaluateTimeInterval:(NSTimeInterval)timeInterval withCurrentValue:(NSTi
139139
case OSTriggerOperatorTypeNotEqualTo:
140140
return !OS_ROUGHLY_EQUAL(timeInterval, currentTimeInterval);
141141
default:
142-
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:[NSString stringWithFormat:@"Attempted to apply an invalid operator on a time-based in-app-message trigger: %@", OS_OPERATOR_TO_STRING(operator)]];
142+
[OneSignal onesignalLog:ONE_S_LL_ERROR message:[NSString stringWithFormat:@"Attempted to apply an invalid operator on a time-based in-app-message trigger: %@", OS_OPERATOR_TO_STRING(operator)]];
143143
return false;
144144
}
145145
}

iOS_SDK/OneSignalSDK/Source/OSFocusTimeProcessorFactory.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ + (void)cancelFocusCall {
4545
let timeProcesor = [self.focusTimeProcessors objectForKey:key];
4646
[timeProcesor cancelDelayedJob];
4747
}
48-
[OneSignalLog onesignalLog:ONE_S_LL_DEBUG message:[NSString stringWithFormat:@"cancelFocusCall of %@", self.focusTimeProcessors]];
48+
[OneSignal onesignalLog:ONE_S_LL_DEBUG message:[NSString stringWithFormat:@"cancelFocusCall of %@", self.focusTimeProcessors]];
4949
}
5050

5151
+ (void)resetUnsentActiveTime {
@@ -54,7 +54,7 @@ + (void)resetUnsentActiveTime {
5454
[timeProcesor resetUnsentActiveTime];
5555
}
5656

57-
[OneSignalLog onesignalLog:ONE_S_LL_DEBUG message:[NSString stringWithFormat:@"resetUnsentActiveTime of %@", self.focusTimeProcessors]];
57+
[OneSignal onesignalLog:ONE_S_LL_DEBUG message:[NSString stringWithFormat:@"resetUnsentActiveTime of %@", self.focusTimeProcessors]];
5858
}
5959

6060
+ (OSBaseFocusTimeProcessor *)createTimeProcessorWithInfluences:(NSArray<OSInfluence *> *)lastInfluences focusEventType:(FocusEventType)focusEventType {
@@ -86,7 +86,7 @@ + (OSBaseFocusTimeProcessor *)createTimeProcessorWithInfluences:(NSArray<OSInflu
8686
[self.focusTimeProcessors setValue:timeProcesor forKey:key];
8787
}
8888

89-
[OneSignalLog onesignalLog:ONE_S_LL_DEBUG
89+
[OneSignal onesignalLog:ONE_S_LL_DEBUG
9090
message:[NSString stringWithFormat:@"TimeProcessor %@ for session attributed %d", timeProcesor, isAttributed]];
9191

9292
return timeProcesor;

iOS_SDK/OneSignalSDK/Source/OSInAppMessageAction.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ + (instancetype _Nullable)instanceWithData:(NSData *)data {
4141
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:data options:0 error:&error];
4242

4343
if (error || !json) {
44-
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:[NSString stringWithFormat:@"Unable to decode in-app message JSON: %@", error.description ?: @"No Data"]];
44+
[OneSignal onesignalLog:ONE_S_LL_ERROR message:[NSString stringWithFormat:@"Unable to decode in-app message JSON: %@", error.description ?: @"No Data"]];
4545
return nil;
4646
}
4747

@@ -76,7 +76,7 @@ + (instancetype _Nullable)instanceWithJson:(NSDictionary *)json {
7676
else
7777
action.closesMessage = true; // Default behavior
7878

79-
[OneSignalLog onesignalLog:ONE_S_LL_VERBOSE message:[NSString stringWithFormat:@"OSInAppMessageAction %@", json]];
79+
[OneSignal onesignalLog:ONE_S_LL_VERBOSE message:[NSString stringWithFormat:@"OSInAppMessageAction %@", json]];
8080

8181
NSMutableArray *outcomes = [NSMutableArray new];
8282
//TODO: when backend is ready check that key matches

iOS_SDK/OneSignalSDK/Source/OSInAppMessageBridgeEvent.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ + (instancetype)instanceWithData:(NSData *)data {
3535
NSError *error;
3636
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:&error];
3737
if (error || !json) {
38-
[OneSignalLog onesignalLog:ONE_S_LL_WARN message:[NSString stringWithFormat:@"Unable to decode JS-bridge event with error: %@", error.description ?: @"Unknown Error"]];
38+
[OneSignal onesignalLog:ONE_S_LL_WARN message:[NSString stringWithFormat:@"Unable to decode JS-bridge event with error: %@", error.description ?: @"Unknown Error"]];
3939
return nil;
4040
}
4141

iOS_SDK/OneSignalSDK/Source/OSInAppMessageDisplayStats.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ + (instancetype _Nullable)instanceWithData:(NSData * _Nonnull)data {
6161
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:data options:0 error:&error];
6262

6363
if (error || !json) {
64-
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:[NSString stringWithFormat:@"Unable to decode in-app display state message JSON: %@", error.description ?: @"No Data"]];
64+
[OneSignal onesignalLog:ONE_S_LL_ERROR message:[NSString stringWithFormat:@"Unable to decode in-app display state message JSON: %@", error.description ?: @"No Data"]];
6565
return nil;
6666
}
6767

@@ -112,7 +112,7 @@ - (BOOL)isDelayTimeSatisfied:(NSTimeInterval)date {
112112

113113
- (BOOL)shouldDisplayAgain {
114114
BOOL result = _displayQuantity < _displayLimit;
115-
[OneSignalLog onesignalLog:ONE_S_LL_VERBOSE message:[NSString stringWithFormat:@"In app message shouldDisplayAgain: %hhu", result]];
115+
[OneSignal onesignalLog:ONE_S_LL_VERBOSE message:[NSString stringWithFormat:@"In app message shouldDisplayAgain: %hhu", result]];
116116
return result;
117117
}
118118

iOS_SDK/OneSignalSDK/Source/OSInAppMessageInternal.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ + (instancetype)instanceWithData:(NSData *)data {
8989
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:data options:0 error:&error];
9090

9191
if (error || !json) {
92-
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:[NSString stringWithFormat:@"Unable to decode in-app message JSON: %@", error.description ?: @"No Data"]];
92+
[OneSignal onesignalLog:ONE_S_LL_ERROR message:[NSString stringWithFormat:@"Unable to decode in-app message JSON: %@", error.description ?: @"No Data"]];
9393
return nil;
9494
}
9595

@@ -142,7 +142,7 @@ + (instancetype)instanceWithJson:(NSDictionary * _Nonnull)json {
142142
if (trigger)
143143
[subTriggers addObject:trigger];
144144
else {
145-
[OneSignalLog onesignalLog:ONE_S_LL_WARN message:[NSString stringWithFormat:@"Trigger JSON is invalid: %@", triggerJson]];
145+
[OneSignal onesignalLog:ONE_S_LL_WARN message:[NSString stringWithFormat:@"Trigger JSON is invalid: %@", triggerJson]];
146146
return nil;
147147
}
148148
}

iOS_SDK/OneSignalSDK/Source/OSInAppMessageTag.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ + (instancetype)instanceWithData:(NSData *)data {
3535
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:data options:0 error:&error];
3636

3737
if (error || !json) {
38-
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:[NSString stringWithFormat:@"Unable to decode in-app message tag JSON: %@", error.description ?: @"No Data"]];
38+
[OneSignal onesignalLog:ONE_S_LL_ERROR message:[NSString stringWithFormat:@"Unable to decode in-app message tag JSON: %@", error.description ?: @"No Data"]];
3939
return nil;
4040
}
4141

iOS_SDK/OneSignalSDK/Source/OSInAppMessageView.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ - (NSString *)getTagsString {
5858
NSError *error;
5959
OSPlayerTags *tags = [OneSignal getPlayerTags];
6060
if (!tags.allTags || tags.allTags.count <= 0 ) {
61-
[OneSignalLog onesignalLog:ONE_S_LL_VERBOSE message:@"[getTagsString] no tags found for the player"];
61+
[OneSignal onesignalLog:ONE_S_LL_VERBOSE message:@"[getTagsString] no tags found for the player"];
6262
return nil;
6363
}
6464
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:tags.allTags
@@ -90,7 +90,7 @@ - (NSString *)addTagsToHTML:(NSString *)html {
9090
- (void)loadedHtmlContent:(NSString *)html withBaseURL:(NSURL *)url {
9191
// UI Update must be done on the main thread
9292
NSString *taggedHTML = [self addTagsToHTML:html];
93-
[OneSignalLog onesignalLog:ONE_S_LL_VERBOSE message:[NSString stringWithFormat:@"loadedHtmlContent with Tags: \n%@", taggedHTML]];
93+
[OneSignal onesignalLog:ONE_S_LL_VERBOSE message:[NSString stringWithFormat:@"loadedHtmlContent with Tags: \n%@", taggedHTML]];
9494
[self.webView loadHTMLString:taggedHTML baseURL:url];
9595

9696
}
@@ -145,11 +145,11 @@ - (void)resetWebViewToMaxBoundsAndResizeHeight:(void (^) (NSNumber *newHeight))
145145
[self.webView evaluateJavaScript:OS_JS_GET_PAGE_META_DATA_METHOD completionHandler:^(NSDictionary *result, NSError *error) {
146146
if (error) {
147147
NSString *errorMessage = [NSString stringWithFormat:@"Javascript Method: %@ Evaluated with Error: %@", OS_JS_GET_PAGE_META_DATA_METHOD, error];
148-
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:errorMessage];
148+
[OneSignal onesignalLog:ONE_S_LL_ERROR message:errorMessage];
149149
return;
150150
}
151151
NSString *successMessage = [NSString stringWithFormat:@"Javascript Method: %@ Evaluated with Success: %@", OS_JS_GET_PAGE_META_DATA_METHOD, result];
152-
[OneSignalLog onesignalLog:ONE_S_LL_VERBOSE message:successMessage];
152+
[OneSignal onesignalLog:ONE_S_LL_VERBOSE message:successMessage];
153153

154154
[self setupWebViewConstraints];
155155

@@ -186,7 +186,7 @@ - (NSNumber *)extractHeightFromMetaDataPayload:(NSDictionary *)result {
186186
}
187187

188188
- (void)setupWebViewConstraints {
189-
[OneSignalLog onesignalLog:ONE_S_LL_VERBOSE message:@"Setting up In-App Message WebView Constraints"];
189+
[OneSignal onesignalLog:ONE_S_LL_VERBOSE message:@"Setting up In-App Message WebView Constraints"];
190190

191191
[self.webView removeConstraints:[self.webView constraints]];
192192

0 commit comments

Comments
 (0)