PusherBeams class
App-facing Implementation for PusherBeamsPlatform
plugin.
It's designed to be a singleton and must be consumed with PusherBeams.instance.
- Inheritance
-
- Object
- PlatformInterface
- PusherBeamsPlatform
- PusherBeams
- Mixed-in types
-
- CallbackHandlerApi
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addDeviceInterest(
String interest) → Future< void> -
Adds an
interest
in this device.override -
clearAllState(
) → Future< void> -
Clear all the state from PusherBeams library, leaving an empty state.
override
-
clearDeviceInterests(
) → Future< void> -
Unsubscribes all interests from this device.
override
-
getDeviceInterests(
) → Future< List< String?> > -
Get the interests registered in this device. Returns a List containing the interests as String.
override
-
getInitialMessage(
) → Future< Map< String, dynamic> ?> -
Reads the
info
key included in a Push Notification when opening the app by tapping on it.override -
handleCallback(
String callbackId, String callbackName, List args) → void -
Handler which receives callbacks from the native platforms.
This currently supports onInterestChanges and setUserId callbacks
but by default it just call the Function set.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onInterestChanges(
OnInterestsChange callback) → Future< void> -
Registers a listener which calls back the
OnInterestsChange
function on interests modifications within this device. This is not implemented on web.override -
onMessageReceivedInTheForeground(
OnMessageReceivedInTheForeground callback) → Future< void> -
Registers a listener which calls back the
OnMessageReceivedInTheForeground
function when the app receives a push notification in the foreground. This is not implemented on web.override -
removeDeviceInterest(
String interest) → Future< void> -
Removes an
interest
in this device.override -
setDeviceInterests(
List< String> interests) → Future<void> -
Sets the
interests
provided with a List. This overrides and unsubscribe any interests not listed ininterests
.override -
setUserId(
String userId, BeamsAuthProvider provider, OnUserCallback callback) → Future< void> -
Sets authentication for this device, so you can send notifications specifically for this device.
You must create a BeamsAuthProvider in order to pass the
provider
argument.override -
start(
String instanceId) → Future< void> -
This function register this device to Pusher Beams service with the given
instanceId
.override -
stop(
) → Future< void> -
Stops by deleting all the state, remotely and locally.
You must call
PusherBeams.instance.start()
again if you want to receive notifications.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → PusherBeams
-
The instance of PusherBeams.
This is intended to be a singleton
no setter