getToken method

Future<String?> getToken({
  1. String? vapidKey,
  2. String? serviceWorkerScriptPath,
})

Returns the default FCM token for this device.

On web, a vapidKey is required.

On web, a custom messaging service worker can be registered with serviceWorkerScriptPath. This must point to a JavaScript file in the root of the app's web directory.

Implementation

Future<String?> getToken({
  String? vapidKey,
  String? serviceWorkerScriptPath,
}) {
  return _delegate.getToken(
    vapidKey: vapidKey,
    serviceWorkerScriptPath: serviceWorkerScriptPath,
  );
}