sarakhan
sarakhan

Reputation: 101

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.

Upvotes: 0

Views: 2042

Answers (1)

Hammad Ali
Hammad Ali

Reputation: 407

For Device Info:

Integrate this plugin:device_info_plus: ^4.0.0

Upvotes: 0

Related Questions