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.

1 Like

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.