简体   繁体   中英

Expo Push Notifications: “Error: Couldn't get GCM token on device.”

I'm trying to receive push notifications with my Expo app, but at this line, the aforementioned error is thrown:

token = await Notifications.getExpoPushTokenAsync();

I already tried:

  • setting up a FireBase account and linking the server API key with expo push:android:upload --api-key <token>
  • downloading the google-services.json , linking it in app.json and making sure that android.package is set to the correct value
  • logging into my expo account with expo login
  • upgrading Expo to the newest version
  • building the app and running it as a standalone app on a physical device

Unfortunately, nothing worked and I'm running out of ideas. Any suggestions?

Okay, I just solved it by upgrading Expo to version 3.17.24 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM