File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -1761,7 +1761,9 @@ + (void)setLastnonActiveMessageId:(NSString*)value { _lastnonActiveMessageId = v
17611761+ (OSNotificationDisplayType)displayTypeForNotificationPayload : (NSDictionary *)payload {
17621762 var type = self.inFocusDisplayType ;
17631763
1764- if (![OneSignalHelper isOneSignalPayload: payload])
1764+ // check to make sure the app is in focus and it's a OneSignal notification
1765+ if (![OneSignalHelper isOneSignalPayload: payload]
1766+ || UIApplication.sharedApplication .applicationState != UIApplicationStateActive)
17651767 return type;
17661768
17671769 let osPayload = [OSNotificationPayload parseWithApns: payload];
Original file line number Diff line number Diff line change @@ -2302,6 +2302,8 @@ - (void)testOverrideNotificationDisplayType {
23022302
23032303 [OneSignal setInFocusDisplayType: OSNotificationDisplayTypeNone];
23042304
2305+ UIApplicationOverrider.currentUIApplicationState = UIApplicationStateActive;
2306+
23052307 [UnitTestCommonMethods resumeApp ];
23062308 [UnitTestCommonMethods runBackgroundThreads ];
23072309
You can’t perform that action at this time.
0 commit comments