setDeviceToken method

  1. @override
  2. @android
Future<void> setDeviceToken(
  1. String token
)
override

Sets the device native channel push notification token, i.e. Firebase token. This is only required if you are using our Firebase push support.

Implementation

@override
@TargetPlatform.android
Future<void> setDeviceToken(String token) async {
  try {
    await methodChannel.invokeMethod('setDeviceToken', token);
  } on PlatformException catch (e) {
    print('Cannot set the device token: $e');
  }
}