-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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 expo-notifications@0.28.2 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? |
@christopherwalter @bradvatne Here's the AndroidManifest section that i think you're interested in. Everything seems right, but tell me if you see something out of place. |
Hello, here is my code for the notification receiver: (note: i have this same code on an older app and it works great without the update)
|
FYI @christopherwalter @bradvatne I've got notifcations v0.28.2 out there in prod and while it's not super prevalent, Google Play Console is now showing that this error is happening to some people. Just so you know. |
Hi folks, for those of you here for icon-related issues: it seems this is not an FCM V1 versus FCM Legacy problem, but a problem with the way we're configuring the manifest when |
FYI I've updated the issue description with statuses for the bugs we're tracking here. Here's the current state of the world:
|
Thank you so much @christopherwalter for your hard work on this! |
@douglowder do you know if the fixes will be ported to SDK 50 also? It seems 0.28 has some breaking changes and is not compatible with SDK 50. Just trying to understand if I need to prioritize our SDK upgrade as the June 20th is around the corner. |
Hello @christopherwalter, unfortunately I am afraid that solution is not 100% correct yet. We use expo 51.0.8 and the newest version of expo-notifications 0.28.3 with FCM V1 service account key but push notifications are still not working well for Android. Our issue is related to Works well with Expo 49 and deprecated token. |
I'm afraid I'm seeing issues that don't like up with the current status here. I'm testing with an EAS Android build based on:
Testing with a device running Android 13. Push message sent with
|
App State | Sound | Banner | Icon | Pressed notification data |
---|---|---|---|---|
Foreground | ✅ | ✅ | ✅ | ✅ |
Background | ✅ | ✅ | ✅ | ✅ |
Killed | ✅ | ✅ | ✅ | Press launches app but notification request.content = { "body": null, "dataString": null, "title": null } |
Push message being sent with useFcmV1: true
:
App State | Sound | Banner | Icon | Pressed notification data |
---|---|---|---|---|
Foreground | ✅ | ✅ | ✅ | ✅ |
Background | ✅ | ❌ | ❌ | ✅ |
Killed | ✅ | ❌ | ❌ | Press launches app. Notification request.content has body and title , does not have data . However it contains dataString with the JSON that should be parsed for data . |
So something seems off. I definitely see different results depending on useFcmV1. Technically I could get the notification presses working with useFcmV1: true
(for now) by parsing that dataString
JSON, but it still doesn't explain the banner and icon not working which isn't supposed to be related?
@Codelica I had the |
@fdelu Thanks for the info on I just gave the case you mentioned a try and everything worked OK for me with both |
@kubmir I added this to our list of items on this tracking issue, I think @douglowder should be able to get a fix for this when he's back in the office next week. |
@Codelica Thank you for this great summary. Using in my case the |
The exact same behavior here PS: Updated my test project to SDK 51 here https://github.com/mgscreativa/expo-notifications-test |
Hi everyone, there are two issues we're prioritizing fixes for at this moment:
|
Just to clarify a couple things... Would this also address the banner not showing when using Would this also handle the alert icon color setting ? (the config plugin linked seems to imply that could be needed also) Thanks for the update! |
Has anyone else experienced crashes on Android when opening app links (deep links) after migrating to Expo 51? The error message is: |
I see the issue was updated to mention cherry-picking changes into SDK 51. Is there a timeline when they'll be pushed to SDK50 as well? |
@jludwiggreenaction we are going to prioritize getting everything working on SDK 51, and after that we will start backporting these changes to SDK 50 and do testing there. |
new release today? 👀 |
I came across this issue while migrating our app's push notifications to FCM v1. only android
sdk 51 |
Not sure if it was supposed to fix the issues, but just reporting here:
|
I can confirm that getLastNotificationResponseAsync() still doesn't have any data property in the payload. This is after upgrading to 0.28.4. |
Upgrading to expo-notifications 0.28.4 resolved the push notifications issue, but the problem with opening app links persists. This isn't a configuration issue, as everything functioned correctly before upgrading to Expo 51. Here is the call stack that indicates the issue is related to the notifications module:
|
@mlukasik-dev that does indeed appear related to the recent changes to fix notification responses. Could you file a new issue (with a repro) and link it here? |
The fix for #28938 is now published in |
@douglowder with 0.28.4, it now requires I keep the withDrawableAssets plugin hack in or it errors out complaining that it can't find the asset for the icon. Is it expected that I leave the plugin in? |
@krazykriskomar I'll have a look. I didn't need that plugin for my test app, but it could be that my app isn't configured correctly to show that icon issue. @mlukasik-dev I believe I have a fix for the NPE you are seeing with deep links. Could you try the following patch? diff --git a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/service/delegates/ExpoNotificationLifecycleListener.java b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/service/delegates/ExpoNotificationLifecycleListener.java
index 3ae6481..a03e70d 100644
--- a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/service/delegates/ExpoNotificationLifecycleListener.java
+++ b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/service/delegates/ExpoNotificationLifecycleListener.java
@@ -11,6 +11,8 @@ import android.util.Log;
import androidx.core.app.NotificationCompat;
+import java.util.Objects;
+
import expo.modules.core.interfaces.ReactActivityLifecycleListener;
import expo.modules.notifications.notifications.NotificationManager;
import expo.modules.notifications.notifications.model.Notification;
@@ -70,7 +72,10 @@ public class ExpoNotificationLifecycleListener implements ReactActivityLifecycle
Log.d("ExpoNotificationLifecycleListener", method + " : keys count = " + extra.keySet().size());
for (String key : extra.keySet()) {
- Log.d("ExpoNotificationLifecycleListener", method + " : key = " + key + " = " + extra.get(key).toString());
+ Log.d(
+ "ExpoNotificationLifecycleListener",
+ method + " : key = " + key + " = " + Objects.requireNonNull(extra.get(key)).toString()
+ );
}
}
} |
@douglowder just so you have the error; if I don't have the withDrawableAssets.js plugin set up, I get this: |
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.
The known issues are as follows:
data
payload in client when receiving push notificationsexpo-notifications@0.28.4
useLastNotificationResponse()
has null dataNew issues filed in expo/expo will be merged into this tracking issue for easier management. The deadline for migrating to FCM V1 is June 20, and we are committed to having a solution to these issues before end of May at the latest.
The text was updated successfully, but these errors were encountered: