PushPole class
@author Mahdi Malvandi Main plugin class handling most of SDK's works.
Constructors
- PushPole()
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
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
getId(
) → Future< String> - Get the unique id of the devices generated by android id or ad id
-
initialize(
{bool showDialog = true}) → Future< void> -
To start registering PushPole, you will call this method.
showDialog
: If device had no GooglePlayServices or it was old, a dialog will appear to let user update it using any market. -
isNotificationOn(
) → Future< bool> -
isPushPoleInitialized(
) → Future< bool> - Check if PushPole is registered to server or not. This method is not completely reliable.
-
sendAdvancedNotifToUser(
String pushpoleId, String notificationJson) → Future< void> - To send a JSON formatted advanced notification to another device using it's PushPoleId
-
sendSimpleNotifToUser(
String pushpoleId, String title, String content) → Future< void> - To send a simple notification to another user using his/her PushPoleId
-
setNotificationListener(
{dynamic onReceived(NotificationData?)?, dynamic onClicked(NotificationData?)?, dynamic onDismissed(NotificationData?)?, dynamic onButtonClicked(NotificationData?, NotificationButtonData?)?, dynamic onCustomContentReceived(String)?, bool applicationOverridden = false}) → dynamic -
Set callbacks for different types of events for notifications (in foreground or when app is open in the background)
onReceived
is called when notification was received.onClicked
is called when notification was clicked.onDismissed
is called when notification was swiped away.onButtonClicked
is called when notification contains button and a button was clicked.onCustomContentReceived
is called when notification includes custom json. It will a json in string format.applicationOverridden
: If you have addedandroid:name="com.pushpole.sdk.flutter.PushPoleApplication"
to your AndroidManifest application attribute, the callbacks will be callable since user starts the app. But if not, callbacks will be available when you call setNotificationListener and before that callbacks won't work. This doesn't make so much difference. But in future case when Flutter added background fcm support, this can make difference. -
setNotificationOff(
) → Future< void> - If this function is called, notification will not be shown.
-
setNotificationOn(
) → Future< void> - Default of notification is set to On, if you have set it off, you can revert it using this function.
-
subscribe(
String topic) → Future< void> -
Subscribe to a topic.
topic
is the name of that topic. The naming rules must follow FCM topic naming standards. -
unsubscribe(
String topic) → Future< void> - Unsubscribe from a topic already subscribed.