Skip to content

Commit c40cf0f

Browse files
Nightsd01jkasten2
authored andcommitted
Fix Timeout Bug
• Fixes an issue where the delegate could get executed twice under some situations when the timeout is reached (if they implement the `OSNotificationDisplayTypeDelegate` but don't ever call the callback, the SDK times out after a while and uses the default display type)
1 parent 0181aba commit c40cf0f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

iOS_SDK/OneSignalSDK/Source/OneSignal.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1836,6 +1836,8 @@ + (void)watchdogTimerFired:(NSTimer *)timer {
18361836

18371837
[_pendingDisplayTypeCallbacks removeObjectForKey:notificationId];
18381838

1839+
_displayTypeMap[notificationId] = @(_inFocusDisplayType);
1840+
18391841
for (OSNotificationDisplayTypeResponse completion in callbacks)
18401842
completion(_inFocusDisplayType);
18411843
}

0 commit comments

Comments
 (0)