getDeviceToken method

Future<String> getDeviceToken()

Retrieves the device's unique Firebase Messaging Token. Can be used to send push notifications to this device.

Implementation

/// Can be used to send push notifications to this device.
  Future<String> getDeviceToken() async {
String token = await messaging.getToken() ?? "";
debugPrint('FirebaseToken: $token');
return token;
  }