Expo Notification working with apk but not with app-bundle

1 Platforms(Android/iOS/web/all):Android

When I uploaded app-bundle on play-store expo notification stopped working but still working fine if I upload .apk instead of bundle(.abb)

Is their anything else I need to do to make it work in case of app-bundle please provide some suggestions??

P.S:- I have already uploaded server credentials and included firebase google-services.json in my project

1 Like

There shouldnā€™t be any difference between AABs and APKs for notifications as far as I know- what do you mean by ā€œnot workingā€?

Iā€™m experiencing the exact same problem for a couple of weeks now (luckily we havenā€™t released the app yet). Notifications work fine on iOS (internal test track), Expo local (iOS/Android), APK build installed directly on the device, but just not when I create an app bundle for the internal test track @ google play. I quadruple checked the server key in firebase/current_api key in google-services.json. @charliecruzan maybe this is the extra information you need?

Edit: Iā€™m using the managed workflow and expo-server-sdk-java in the backend.

Alright. It seems my aab builds uploaded to the internal test are not getting an expo push token. I implemented this SDK37 standalone app: ā€œCouldnā€™t get GCM token on deviceā€ Ā· Issue #7727 Ā· expo/expo (github.com) but that doesnā€™t seem to work. Itā€™s not a problem with FCM but with expo-notifications I guess. Iā€™ll continue to investigate.

edit: I just made a whole lot of builds (sorry expo) printing various statuses. It seems getExpoPushTokenAsync does nothing. Nothing at all. No promise, no data. Only fails on AAB builds. Works fine on Expo/APKā€¦ Anyone? =(((

Again, we need to know what is meant by ā€œnot workingā€ or ā€œdoes nothingā€

Does getExpoPushTokenAsync hang? Does throw an exception that isnā€™t being caught? If it returns an error, what does that error say?

I can only print the output in the final build (that I put up in the internal test). I use JSON.stringify(output) and wrap that in a component. In all the builds mentioned before, except the AAB it returns an object with ā€œtypeā€ and ā€œdataā€, both filled, both correct data. In the uploaded AAB (internal test android app store) there is no output. I donā€™t know how to debug that. It might just hang, or outputs nothing. If there is a way to test that Iā€™d love to know, Iā€™ve been searching high and low =).

edit: Iā€™m someone else btw, I never responded with ā€˜not workingā€™ (editĀ²: okay I kinda did =P). If itā€™s a better idea I can start my own thread but TS seems to have the same problem so maybe my solution might be his/hers.

I just made another APK and installed it directly on my phone: All is fine. The output from getExpoPushTokenAsync wrapped in my component is an object {"type": "expo", "data": "ExponentPushToken[tokenstring]"}. If I now create the app bundle and upload it to my internal test track there is no output. I donā€™t know if JSON.stringify also would print errors there but it seems like itā€™s just an empty string.

that method either returns an object with type and data, or itā€™ll throw, so maybe you need to wrap it in a try catch - expo/getExpoPushTokenAsync.ts at master Ā· expo/expo Ā· GitHub

My issue is already fixed, I tried 2 things, not sure which one made it working fine

I tried these steps:-

  1. Added playstore SHA certificate fingerprints in Firebase project and then added googel-services.json file inside inside project
  2. Installed expo-updates module and also added sentry for logging

@vivek22719 thanks for your response by the way! I might try expo-updates in a bit!

I just added the sha-1 signing key to firebase and the google cloud api key. I was using the upload key from expo for that (which I left in there). Updatet my google-services.json afterwards. I now get undefined instead of nothing as a response from getExpoPushTokenAsync. I might play a videogame or two and get back at it in an hour or so. @charliecruzan what do you think I can still try?

I created my own topic: Not receiving a token in AAB build. Notifications in all other builds work fine. - Help: Expo SDK - Forums. Itā€™s still not working =(.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.