-
Notifications
You must be signed in to change notification settings - Fork 5k
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
[expo-notifications][Android] Get notification responses when app in background or not running #28883
Merged
douglowder
merged 3 commits into
main
from
doug/eng-12137-android-notificationresponsereceivedlistener-not-called-when
May 15, 2024
Merged
[expo-notifications][Android] Get notification responses when app in background or not running #28883
douglowder
merged 3 commits into
main
from
doug/eng-12137-android-notificationresponsereceivedlistener-not-called-when
May 15, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…background or not running
The Pull Request introduced fingerprint changes against the base commit: 4a28d5b Fingerprint diff[
{
"type": "dir",
"filePath": "../../packages/expo-notifications/android",
"reasons": [
"expoAutolinkingAndroid"
],
"hash": "aa2d97bfb30fc9086276e1acb2a3672edc201bd5"
}
] Generated by PR labeler 🤖 |
christopherwalter
approved these changes
May 15, 2024
alanjhughes
approved these changes
May 15, 2024
tsapeta
approved these changes
May 15, 2024
3 tasks
BrodaNoel
reviewed
May 17, 2024
delete mappedResponse.notification.request.content.dataString; | ||
} | ||
} catch (e: any) { | ||
console.log(`Error in response: ${e}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these console.log
ok?
This was referenced May 18, 2024
This was referenced May 19, 2024
douglowder
added a commit
that referenced
this pull request
Jun 12, 2024
…background or not running (#28883)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bot: fingerprint changed
bot: passed checks
ExpoBot has nothing to complain about
published
Changes from the PR have been published to npm
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why
After the Android notifications change to FCMv1, the app is not able to get notification response listeners to fire when the app is in background or not running, and opened in response to a notification.
How
This change leverages the Expo module Android lifecycle listeners to get the notification data from the lifecycle methods, and pass them to the notification emitter that emits notifications and responses to JS.
This change also includes support for the
useLastNotificationResponse()
hook. This is especially important if the app is not running and is opened in response to a notification, since response listeners may not become active early enough in initial render.Fixes #14078 .
Test Plan
Checklist
npx expo prebuild
& EAS Build (eg: updated a module plugin).