firebase_cloud_messaging_backend 1.0.1 icon indicating copy to clipboard operation
firebase_cloud_messaging_backend: ^1.0.1 copied to clipboard

Use Firebase Cloud Messaging in your dart server code

Send messages with Firebase Cloud Messaging from your dart backend!

Created using the HTTPv1 API of Firebase Cloud Messaging - you can find more on their website.

Not affiliated in any way with the official Firebase team or Google.

Usage #

Acquire required informations for the JWTClaim: Firebase > Project > Settings > Copy your project-id then go on: Settings > Service Accounts > Generate new key > Copy important informations directly from the created file or load it with JWTClaim.from(jsonFile)

A simple usage example:

import 'package:firebase_cloud_messaging_backend/firebase_cloud_messaging_backend.dart';

main() async{
  var server = FirebaseCloudMessagingServer(
      JWTClaim(
          client_email:
              "$clientEmail",
          client_id: "$clientId",
          private_key: authKey,
          private_key_id: "$privateKeyId"),
      "$projectId");

  var result = await server.send(Send(
      validate_only: false,
      message: Message(
          notification: Notification(
              title: "New content:", body: "John added something new!"),
          android: AndroidConfig(
              notification: AndroidNotification(
                  icon: "ic_notification", color: "#009999")),
          token: token)));
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

6
likes
85
pub points
23%
popularity

Publisher

verified publisher iconpdad.de

Use Firebase Cloud Messaging in your dart server code

Repository (GitHub)

Documentation

API reference

License

Icon for licenses.BSD-3-Clause (LICENSE)

Dependencies

googleapis_auth, http, json_annotation, json_serializable

More

Packages that depend on firebase_cloud_messaging_backend