xpusher 1.0.3 copy "xpusher: ^1.0.3" to clipboard
xpusher: ^1.0.3 copied to clipboard

Plugin pusher client for flutter.

XPusher #

XPusher is unofficial plugin pusher for Flutter.

  • On Android it was tested on Android-SDK 34
  • On iOS : Maintenance

Supported Platform #

  • Android
  • iOS : Maintenance

Installation #

Add to your pubspec.yaml

dependencies:
    xpusher: 

Subscription to Channels #

Public Channel #

String channel = "my-channel";

Private Channel #

String channel = "private-my-channel";

API Overview #

Initialization #

XPusher pusher = XPusher();

Public #

  pusher.init(
    apiKey: "YOUR_API_KEY",
    cluster: "YOUR_CLUSTER",
    channelName: "YOUR_CHANNEL_NAME",
    eventName: "YOUT_EVENT_NAME",
    onConnectionState: (currentState, previousState) {
      print("state: $currentState, $previousState");
    },
    onEvent: (data) {
      print("data: $data");
    },
  );

Private Channel #

  pusher.init(
    apiKey: "YOUR_API_KEY",
    cluster: "YOUR_CLUSTER",
    channelName: "YOUR_CHANNEL_NAME",
    eventName: "YOUT_EVENT_NAME",
    auths: "", // default = {}
    endPoint: "YOUR_END_POINT_AUTH",
    host: "pushnow.my.id", // default = "pushnow.my.id"
    wssPort: 6002, // default = 6002
    onConnectionState: (currentState, previousState) {
      print("state: $currentState, $previousState");
    },
    onEvent: (data) {
      print("data: $data");
    },
  );

Callback Function #

onConnectionState #

onConnectionState to get status of your connections.

    onConnectionState: (currentState, previousState) {
      print("state: $currentState, $previousState");
    },
Status Description
CONNECTED Successful
DISCONNECT Failed
CONNECTING Process to Connect

onEvent #

onEvent it will give you a dynamic result

    onEvent: (data) {
      print("data: $data");
    },
1
likes
140
points
1
downloads

Publisher

unverified uploader

Weekly Downloads

Plugin pusher client for flutter.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on xpusher

Packages that implement xpusher