简体   繁体   中英

How to get device token in flutter

I'm trying to get the device token from this code

FirebaseMessaging.instance.getToken().then((value) => print("token is $value"));

it prints the token when i run the app on emulator, but it gives me this error when i run the app on physical device

java.util.concurrent.ExecutionException: com.google.firebase.installations.FirebaseInstallationsException: Firebase Installations Service is unavailable. Please try again later.

please help how to fix it.

For Device Info:

Integrate this plugin: device_info_plus: ^4.0.0

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