Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(iOS): Allow the original delegate to handle non-Notifee notifications first #985

Merged
merged 2 commits into from
Jun 11, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 7 additions & 7 deletions ios/NotifeeCore/NotifeeCore+UNUserNotificationCenter.m
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,13 @@ - (void)userNotificationCenter:(UNUserNotificationCenter *)center

// handle notification outside of notifee
if (notifeeNotification == nil) {
notifeeNotification =
[NotifeeCoreUtil parseUNNotificationRequest:response.notification.request];
if (_originalDelegate != nil && originalUNCDelegateRespondsTo.didReceiveNotificationResponse) {
[_originalDelegate userNotificationCenter:center
didReceiveNotificationResponse:response
withCompletionHandler:completionHandler];
} else {
notifeeNotification = [NotifeeCoreUtil parseUNNotificationRequest:response.notification.request];
}
}

if (notifeeNotification != nil) {
Expand Down Expand Up @@ -247,11 +252,6 @@ - (void)userNotificationCenter:(UNUserNotificationCenter *)center
completionHandler();
});

} else if (_originalDelegate != nil &&
originalUNCDelegateRespondsTo.didReceiveNotificationResponse) {
[_originalDelegate userNotificationCenter:center
didReceiveNotificationResponse:response
withCompletionHandler:completionHandler];
}
}

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@
"tests_rn:packager": "cd tests_react_native && npx react-native start",
"tests_rn:packager:reset-cache": "cd tests_react_native && npx react-native start --reset-cache",
"run:android": "cd tests_react_native && npx react-native run-android --variant 'debug'",
"run:ios": "cd tests_react_native && npx react-native run-ios --scheme=Notifee --simulator 'iPhone 14'",
"run:ios": "cd tests_react_native && npx react-native run-ios --scheme=Notifee --simulator 'iPhone 15'",
"tests_rn:test": "cd tests_react_native && jest",
"tests_rn:test-watch": "cd tests_react_native && jest --watch",
"tests_rn:test-coverage": "cd tests_react_native && jest --coverage",
"tests_rn:android:build": "cd tests_react_native/android && ./gradlew assembleDebug -DtestBuildType=debug",
"tests_rn:android:test": "cd tests_react_native && npm_config_yes=true npx cavy-cli run-android --no-jetifier",
"tests_rn:ios:test": "cd tests_react_native && npm_config_yes=true npx cavy-cli run-ios --scheme=Notifee --simulator 'iPhone 14'",
"tests_rn:ios:test": "cd tests_react_native && npm_config_yes=true npx cavy-cli run-ios --scheme=Notifee --simulator 'iPhone 15'",
"tests_rn:ios:pod:install": "cd tests_react_native && npm_config_yes=true npx pod-install && cd .."
},
"devDependencies": {
Expand Down