pusher_beams_server 0.1.4
pusher_beams_server: ^0.1.4 copied to clipboard

A Pusher Beams Client for sending push notifications to users.

example/example.dart

import 'package:pusher_beams_server/pusher_beams_server.dart';

main() async {
  // constructor
  final beamsClient = PushNotifications(
    'your_instance_id_here',
    'your_secret_key_here',
  );

  // push notification for interests on Android
  final interests = ['pears', 'apples'];
  final fcm = {
    'notification': {
      'title': 'Hello',
      'body': 'Hello, world!',
    }
  };
  final response = await beamsClient.publishToInterests(interests, fcm: fcm);

  // push notification for users on Apple device
  final users = ["user-001", "user-002"];
  final apns = {
    'aps': {
      'alert': {
        'title': 'Hello',
        'body': 'Hello, world!',
      }
    }
  };
  final response2 = await beamsClient.publishToUsers(users, apns: apns);
}
3
likes
90
pub points
28%
popularity

Publisher

suragch.dev

A Pusher Beams Client for sending push notifications to users.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

http, jaguar_jwt

More

Packages that depend on pusher_beams_server