firebase_cloud_messaging_interop 1.0.0 copy "firebase_cloud_messaging_interop: ^1.0.0" to clipboard
firebase_cloud_messaging_interop: ^1.0.0 copied to clipboard

outdated

A dart plugin allowing you to retrieve the firebase token of the client and to send push notification (via firebase).

example/firebase_cloud_messaging_interop_example.dart

import 'package:firebase_cloud_messaging_interop/firebase_cloud_messaging_interop.dart';
import 'dart:html';

main() {
  Messaging messaging = firebase.messaging();

  messaging.usePublicVapidKey("YOUR_VAPID_KEY");

  /// Ask for permission to send notification
  Notification.requestPermission().then((permission) {
    if (permission == 'granted') {
      futureFromPromise(messaging.getToken().then((e) {
        /// SEND TOKEN TO THE BACKEND SERVER
      }));
    }
    else {
      /// User does'nt want notification :(
    }
  });
}
16
likes
0
pub points
57%
popularity

Publisher

verified publishergaspardmerten.dev

A dart plugin allowing you to retrieve the firebase token of the client and to send push notification (via firebase).

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

js

More

Packages that depend on firebase_cloud_messaging_interop