-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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 FCM V1 Migration Tracking Issue #28656
Comments
Something else I noticed that might be worth noting is that notification images (not icons) don't seem to be working when the app is in the foreground. Edit: Just to clarify, I tested this by sending the request to the FCM V1 api directly |
To add on to "the notification icon is not working", on Android I'm finding that the icon displays when the app is in the foreground. But I get a blank circle as an icon when the app is in the background This is happening with a development build |
No issue with the icon when we add the correct name/value pair on the Android manifest but it seems there is no "plugin" on the package expo-notification or this one is not working as expected. But this issue can be fixed "simply" by adding a manual plugin specified here #24844 (comment) in addition to the |
Hi, I am using Expo SDK 49. |
For me, the plugin here is unnecessary because the AndroidManifest that's created seems fine. I have 2 notification_icon additions. |
I have the same issue on IOS. |
PR #28883 has been submitted to fix the Android notification response issues when app is in background or not running. |
Awesome. thank you so much for tracking this down for all of us. Any idea when it will be available? |
Second that! Really need it :) |
0.28.2 didn't fix anything :( |
In my case I can confirm that with the new version, |
@fdelu see the fix that was just added in #28883 , specifically the new method in That is the method that takes the bundle passed into If you are missing part of the payload, you should have a look to see if there are parts of the bundle that are not being mapped by |
@fdelu in looking at this further, it may be that you rebuilt your Android app with the new expo-notifications package, but did not rebuild your JS bundle to pick up the required changes on the JS side: https://github.com/expo/expo/pull/28883/files#diff-37b24aeb2e0d5d7c4365c987c51f03db4b6d20a0927f3eefe0d9e0a35b2c4df7 The |
Yes, that seems like it. I noticed later that I had "dataString" but not "data" so I'm probably missing that. Not sure how that happened though. Thanks for your help! |
After updating to [email protected] and building, this works 🎉. Thanks, @douglowder. Great work! 👏 ... the only minor issue is that the notification icon is not displaying correctly with FCM V1. |
An update on this @douglowder: I verified and it is using the latest version. When my app is in the foreground, I get a notificationd and click on it, I see the "response received" log and everything works fine. However, when my app is closed (fully), I get a notification and click on it to open the app, then I don't see that "response received" log, the "data" field is missing and the request content contains the "dataString" field. Looking at the code for Another issue I've been having is that if I get a notification when the app is open, I fully close it and then I reopen the app by clicking the notification, const notification = useLastNotificationResponse();
console.log("LAST RESPONSE", notification);
console.log(
"LAST RESPONSE CONTENT",
notification?.notification?.request?.content
);
console.log(
"LAST RESPONSE TRIGGER",
notification?.notification?.request?.trigger
); The logs:
|
@fdelu yes indeed that is a bug! I think cutting and pasting the new code from NotificationEmitter should fix it... I really appreciate you taking the time to track that down. |
Hi folks, if you're in this thread due to icon-related issues (@deivijt @zandvakiliramin @haplionheart): Can you try using a config plugin like in this comment to ensure the correct fields are in your manifest? And let me know if that changes anything? @krazykriskomar re: your comment here, I wasn't sure if you have it working or not? Can you confirm if icon behavior is correct for you when sending notifs using FCM V1? |
@rranjan14 you cannot get notification responses in terminated state.
We do not support that. It may be possible on Android, I am not sure. It is definitely not possible on iOS, as far as I know. |
Hi, I'm still having issues with notifications on Android. I'm testing on an old Samsung S9+ running Android 10. I'm using latest versions of libraries at this moment ([email protected], [email protected], [email protected]). I'm calling setNotificationChannelAsync before registering push token like this:
I'm using Expo Push notifications tool with Channel ID set do 'default' and forced FCM V1 with { "value": "123" } in data. I'm getting completely different data structure depending on the app state:
It's the same in dev client and production build. |
@jb-5murf I took a look at this today. It is expected that the structure when the app is in background is going to be completely different, as that structure is synthesized from onCreate()/onNewIntent() intent bundles. However, the missing data from |
I'm experiencing an issue where attachments included in a notification are not being displayed on iOS devices. The following code snippet shows how I'm setting up the notification: const notificationAttachment = {
identifier: 'image-001',
url: 'https://example.com/sample.jpg',
type: 'image/jpeg',
};
await Notifications.scheduleNotificationAsync({
content: {
title: 'Test Notification',
body: 'This is a test notification with an attachment.',
attachments: [notificationAttachment],
},
trigger: null,
}); |
In testing this today, the missing data seems to be expected on Android. In debugging the native code, the call to the Android broadcast receiver to get the currently presented notifications does not receive the notification triggers that contain the data objects. |
@douglowder can you please give me the current status that I had posted earlier regarding the |
@douglowder Could you give me the status regarding the custom sound not working when app in background? |
Thank you very much for your information. Do you have any idea when a fix might be released? |
My app is experiencing two issues that you marked as fixed above:
Additionally, most notifications being sent are missing. These issues have only started happening around a week ago. Before that, everything worked fine. The app is still using Expo v48. |
A few days ago, we started seeing 100% failure rates from the Expo push service when sending to the FCM legacy endpoint. Per Firebase docs, it appears that they have now actually shut down the legacy service. Accordingly, we have now modified the Expo push notification service to default to the new FCMv1 endpoint and protocol if the Apps built with SDK 48 do not have all the recent changes that have been done in SDK 51 (and to some extent in SDK 50) to support the new protocol on Android. We recommend that such apps be upgraded to SDK 51. |
It is not yet clear that this can be fixed, but we are still investigating. |
@douglowder I have followed the documentation to Add Google Service Account Keys using FCM V1 and it works great, but whether it was the right approach or not, the legacy FCM server key was used for our dev and prod environments and served notifications for both landscapes. As a result, in the new approach it appears only a single FCM V1 service account key can be added via the UI. Is there a recommended way to tackle this problem? Ideally, it'd be nice to upload two (whether that is the best approach or not) or something along those lines to replicate the prior behavior. |
@douglowder Unfortunately, I did not receive emails or instructions indicating that I needed to upgrade the Expo version soon, only to update the new FCM Server key. 🤦♂️ |
Our solution for this has been to have different Android package names for development and production... the Firebase configuration can support multiple package names each with its own entry in google-services.json, but sharing a common FCM private key. |
Would you mind sharing a small snippet of how you accomplished this (feel free to block out the sensitive values, I figured others might be interested in this in the future)? I appreciate the input! |
is this working in android? |
Good day. Over the past month or two (perhaps coinciding with the FCM v1 migration) I have started to experience inconsistent behavior while using the Expo push notification service. I am not sure where the issue lies but it is causing a significant degradation in service for my end users. So I am hopeful it can be resolved as soon as possible. At this point I do not feel it is an issue with the my application server side implementation (calling the expo push api) nor client side implementation (using the expo notifications package). I will state why as part of providing the full details below. I am a user of my own application. I have been closely monitoring each push notification I should be receiving, and what I have seen is sometimes I receive the push notification and sometimes I don't. Scenario 1: Scenario 2: In the case of scenario 1 I did call the https://exp.host/--/api/v2/push/getReceipts endpoint passing in the push ticket receipt and Expo confirmed the notification was successfully delivered. For my mobile app I am using expo ~51.0.31 and expo notifications ~0.28.16 Kindly assist in any way possible in determining why the inconsistent behavior of my app receiving only some of the notifications being sent to it. I am concerned my other users are also experiencing this same issue leading to significant degradation in the service I am providing. Thank you. |
|
Yes I am. |
@hramchandani I think more info is needed to understand what you are seeing:
|
Hi @Codelica
If there is any other information I can provide, do let me know. Thank you. |
Hello and thanks everyone for contributing to the discussion. I'm now locking the discussion because it has become almost impossible to find relevant information in it. Status update:
If all this information is clearly laid out, we will be able to debug your issue and deliver a solution faster. Conversely, we won't be able to prioritize issues where important information is missing. Thank you 🙂 |
@jb-5murf I have looked into the issue you reported in #28656 (comment). Unfortunately, there's nothing we can do about the case "2" that you reported. When calling It may be possible to work around you problem by using data-only notifications, though I cannot 100% confirm it. |
Hello, just to confirm, latest fixes are published: https://www.npmjs.com/package/expo-notifications/v/0.28.17 |
This is a tracking issue for user-reported issues related to the Spring 2024 migration of Expo Push Notifications from FCM Legacy to FCM V1 for Android devices. There have been reported instances of brokenness in production when moving from FCM Legacy to FCM V1, and this issue will serve as a central place to track our investigation and resolution of these issues.
Recommend that users should now be on
[email protected]
and[email protected]
or later.The remaining issues (as of 2024-08-06) are as follows:
Fixed issues:
data
payload in client when receiving push notificationsThe deadline for migrating to FCM V1 is 2024-07-22. See this link for up to date info from Firebase on the legacy API shutdown process.
Update 2024-09-08: It appears that the FCM legacy service is now fully shut down. Later this week, we intend to close this issue and lock comments. Any remaining or new issues should be created as new issues in this repo, per the usual process.
The text was updated successfully, but these errors were encountered: