I’ve faced a problem with notifications on self-prepared APK build (by turtle-cli). I send a request for new expo token, but I always get in response the same message: Couldn't get GCM token for device; I’ve also checked the same code but using expo build:android instead of turtle, and it works. Is there any problem with expo’s notifications on turtle-built applications or maybe I should do some extra steps before build?
Hi! Have you already followed these instructions for FCM? (including uploading server key w/ expo push:android:upload --api-key <your-token-here>) Make sure you’re logged into the same expo account when you do this
Odd that this only happens in turtle-built apps…what version of turtle are you using, and what version of expo-cli?
I added API key by expo push and I was logged in, but, when I build my APK, I use turtle build:android without credentials (I pass --public-url instead of them); Should I be logged in to expo before I run turtle build?
$ turtle --version
0.9.1
$ expo --version
2.21.2
UPDATED:
I’ve just tried to run turtle build:android with credentials (params username and password`) and being logged in to expo. Unfortunately, I still have the same error
UPDATED:
Tested on higher versions of turtle/expo, the same result:
One more thought. Do I need a created project on my account? I have no projects there so far because I published/built everything on my servers. Maybe this is the case?
Hm, what does it mean exactly published your project? I published my assets on my personal hosting and I defined it in --public-url, is it not sufficient?
Problem is solved. For everyone who is interested in the solution:
Make sure you have proper id in exported assets (especially: android-index.json). I don’t know why I had @anonymous/project-name there. Finally, after several tries, logins and logouts, I exported assets with id field: @_robertd/project-name and it solved my problem with FCM. I don’t know the reason why previous export had an anonymous id, but it was a problem.