-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
addNotificationResponseReceivedListener or useLastNotificationResponse is not firing when app is killed #11933
Comments
Same here (using v 0.9.0). It is triggering when both expo and app (inside expo) are killed (removed from recent apps) but it isn't triggering when only app is killed. And also not working in production. Terspychore did you find a workaround. |
I am facing the exactly same problem. When the application is killed the |
I have the same issue here. I was able to fix this on Android by puting I haven't tested it on a blank project, so IDK if it works only for my case. If anyone knows a workaround for iOS, please share it with us. P.S. |
Same here, using:
It also doesn't work on my project when using |
I'm afraid that there won't be any solution for this on Android...
firebase/quickstart-android#41 (comment)
I tried killing my WhatsApp and yeah, I didn't receive any notification when someone sent me a message. |
No workaround still. Working only when app is in background and foreground. Please Expo enlighten us ! 🙂 |
@jparksecurity is correct- fixes for this have landed and are published for the bare workflow in |
Will this include the fix for startLocationUpdatesAsync() ??? |
yes, you can view that issue and relevant PR for more details #11536 |
The issue is still there SDK 42 (managed ), using the addNotificationResponseReceivedListener or the new hook even if it's the first line in App.js , same results , However sometimes it works . |
I still experienced this issue on SDK 44 (managed) |
I also have same issue, using SDK 42 in bare workflow, and associated expo-notifications v0.12.3. Using addNotificationResponseReceivedListener, useLastNotificationResponse hook (or getLastNotificationResponseAsync equivalent) gives always the same response : null. |
On SDK43 I was unsuccessful to capture the event with Desperately I tried the My original approach was to register
My final approach:
It certainly seems like the |
How did you use |
Were you able to fix this? Can someone confirm if this is fixed March 2023? |
September 2023 and still not working... When will it be resolved? |
I confirm its working! |
For me solution above didn't want to work, but I solve that problem in other way. Thats my response from different thread.
|
@dmrugalski seems it's not working for me. When I kill app and then tap into noti, lastNotificationReponse returns null |
this is my last way and it's worked for me.
src/app/_layout.tsx:
|
Project - Expo Managed React native I used expo notifications@~0.28.9 for push notifications addNotificationResponseReceivedListener is working fine when app is in foreground ,once app is killed or removed from background , it is not working properly . import { useState, useEffect, useRef } from 'react' import Constants from 'expo-constants' export interface PushNotificationState { export const usePushNotifications = (): PushNotificationState => {
const [notification, setNotification] = useState<
const notificationListener = useRef<Notifications.Subscription>() const handleNotificationResponse = (response) => { console.log(screen,params);
} async function registerForPushNotificationsAsync() {
} useEffect(() => {
}, []) return { |
Summary
Both useLastNotificationResponse hook and addNotificationResponseReceivedListener isn't firing when my expo app is killed. Working only in background and foreground. My expo-notifications package is up-to-date : "^0.9.0".
Managed or bare workflow? If you have
ios/
orandroid/
directories in your project, the answer is bare!managed
What platform(s) does this occur on?
Android, iOS
SDK Version (managed workflow only)
40.0.1
Environment
Reproducible demo or steps to reproduce from a blank project
The text was updated successfully, but these errors were encountered: