Skip to content

Commit e694cb9

Browse files
Nightsd01jkasten2
authored andcommitted
Update Dev Project
• Updates the dev project to use the completion block approach
1 parent 7865d58 commit e694cb9

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

iOS_SDK/OneSignalDevApp/OneSignalDevApp/AppDelegate.m

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
7777
[OneSignal addSubscriptionObserver:self];
7878
[OneSignal addEmailSubscriptionObserver:self];
7979

80-
[OneSignal setInFocusNotificationDisplayTypeDelegate:self];
80+
[OneSignal setNotificationDisplayTypeDelegate:self];
8181

8282
NSLog(@"UNUserNotificationCenter.delegate: %@", UNUserNotificationCenter.currentNotificationCenter.delegate);
8383

@@ -99,11 +99,13 @@ -(void)onOSEmailSubscriptionChanged:(OSEmailSubscriptionStateChanges *)stateChan
9999

100100
}
101101

102-
- (void)willPresentInFocusNotificationWithPayload:(OSNotificationPayload *)payload forDisplayType:(OSNotificationDisplayType *)type {
102+
- (void)willPresentInFocusNotificationWithPayload:(OSNotificationPayload *)payload withDefaultDisplayType:(OSNotificationDisplayType)displayType withCompletion:(OSNotificationDisplayTypeResponse)completion {
103103
if (payload.additionalData[@"overrideDisplayType"]) {
104-
OSNotificationDisplayType newType = (OSNotificationDisplayType)[payload.additionalData[@"displayType"] intValue];
104+
OSNotificationDisplayType newType = (OSNotificationDisplayType)[payload.additionalData[@"overrideDisplayType"] intValue];
105105

106-
*type = newType;
106+
completion(newType);
107+
} else {
108+
completion(displayType);
107109
}
108110
}
109111

0 commit comments

Comments
 (0)