Skip to content
Merged
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
@@ -1,6 +1,5 @@
import Airship, {iOS} from '@ua/react-native-airship';
import shouldShowPushNotification from '@libs/Notification/PushNotification/shouldShowPushNotification';
import {getIsMuted} from '@libs/Sound/BaseSound';
import type ForegroundNotificationsModule from './types';

function configureForegroundNotifications() {
Expand All @@ -15,15 +14,7 @@ function configureForegroundNotifications() {

// Set a callback to override our foreground presentation per notification depending on the app's current state.
// Returning null keeps the default presentation. Returning [] uses no presentation (hides the notification).
Airship.push.iOS.setForegroundPresentationOptionsCallback((pushPayload) => {
if (!shouldShowPushNotification(pushPayload)) {
return Promise.resolve([]);
}
if (getIsMuted()) {
return Promise.resolve([iOS.ForegroundPresentationOption.List, iOS.ForegroundPresentationOption.Banner, iOS.ForegroundPresentationOption.Badge]);
}
return Promise.resolve(null);
});
Airship.push.iOS.setForegroundPresentationOptionsCallback((pushPayload) => Promise.resolve(shouldShowPushNotification(pushPayload) ? null : []));
}

function disableForegroundNotifications() {
Expand Down
84 changes: 0 additions & 84 deletions tests/unit/ForegroundNotificationsTest.ts

This file was deleted.

Loading