pusher_beams 0.5.3+2 copy "pusher_beams: ^0.5.3+2" to clipboard
pusher_beams: ^0.5.3+2 copied to clipboard

outdated

Unofficial Pusher Beams Flutter client library supported for iOS and Android.

Flutter Pusher Beams (Client) #

Pub.dev

Unofficial Pusher Beams Flutter client library supported for iOS and Android.

Note: the plugin API have been designed with the same parameters and functions names as the native SDKs

iOS Documentation | Android Documentation

Installation Guide #

  • You need a Pusher Beams instance to get an instanceId, you can get one from here

Follow the FlutterFore installation guide from the following packages on your Flutter app as Pusher Beams itself requires FCM to work:

Once the above have been set up, you must include this plugin on your pubspec.yaml:

    dependencies:
        firebase_messaging: "^0.5.3+2"

Get the instanceId from your Pusher Beams panel and call .start() as soon as possible on your app:

import 'package:pusher_beams/pusher_beams.dart'; // Import the plugin

// Stuff
  void main () async {
    // Your app setup
    
    // We start PusherBeams before the app
    await PusherBeams.start('YOUR INSTANCE ID');

    runApp(SomeApp());
  }

Once PusherBeams were started you can now start to add, remove or get the interests you need as follows:

import 'package:pusher_beams/pusher_beams.dart'; // Import the plugin

await PusherBeams.addDeviceInterest("hello");
await PusherBeams.removeDeviceInterest("hello");
await PusherBeams.getDeviceInterests();

Notes #

  • I decided not to write the function documentation as they were implemented the same as their native libraries, you can read it here.
  • Every function on this Plugin is a Dart Future.
  • Remember this library have been implemented as a Singleton (the native libraries follows this pattern).

Todo #

  • Send from flutter serializable AuhtorizationOptions for custom UNAuthorizationOptions.
  • setUserId implementation to add the authentication part
  • Flutter Web support

Developed with ❤️

28
likes
0
pub points
88%
popularity

Publisher

verified publisherpusher.com

Unofficial Pusher Beams Flutter client library supported for iOS and Android.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, json_annotation

More

Packages that depend on pusher_beams