OneSignalPush Extension
This extension ships with one of the most stable One Signal SDK which is (4.8.7) . You can easily receive push notifications sent from OneSignal dashboard in your app. You can send notifications to all subs and individuals. You can send a customized notification also.1. Overview
LatestVersion: 1
Released: 2024-04-29T18:30:00Z
Last Updated: 2024-04-29T18:30:00Z
Permissions: android.permission.ACCESS_NETWORK_STATE
, android.permission.POST_NOTIFICATIONS
Aix Size: 1.1mb
2. Blocks
3. Documentation
Events
GotAllTags | Event raised after getting user's tagstagDictionary | dictionary |
NotificationOpened | Event raised when user opens notification by clicking on it while app is in foregroundid | number data | text |
NotificationReceived | Event raised when a notification is receivedid | number data | text |
ActionButtonClicked | Event raised when user opens notification by clicking Action Buttonid | number actionId | text data | text |
SubscriptionChanged | Event raised when subscription state changesisSubscribed | boolean userId | text pushToken | text |
PermissionStateChanged | Event raised when notification permission state changesisGranted | boolean |
NotificationSent | Event raised when notification was sent successfully |
NotificationSendFailed | Event raised when notification sending failederrorMsg | text |
Methods
Initialize | Initialize OneSignal sdk with specified App IdappId | text |
ClearNotification | Clears notifications with specified idid | number |
ClearAllNotifications | Clears all notifications posted by OneSignal |
RemoveExternalId | Removes user's external id |
AskPermission | Asks for Notification permission in Android 13 and above |
IsSubscribed | Returns user's subscription status |
EnablePush | Enable Push notifications |
DisablePush | Disable Push notifications |
GetUserId | Returns user id |
GetPushToken | Returns push token |
AddTag | Add tag to usertag | text value | text |
RemoveTag | Remove tag from usertag | text |
SetExternalId | Sets current user's external id id | text |
GetAllTags | Fetches user's all tags from OneSignal |
IsPermissionGranted | Returns whether notification permission has been granted or not |
RetrieveBackgroundNotifs | Retrieve all cached notifications which were received when app was closed |
ClearBackgroundNotifs | Clears all cached notifications |
SendToAllSubscribers | Send notification to all subscribed usersapiKey | text appId | text title | text body | text largeIcon | text data | dictionary |
SendToSubsIDs | Send notification to all specified User IdsapiKey | text appId | text ids | list title | text body | text largeIcon | text data | text |
SendCustomNotif | Send custom notificationapiKey | text jsonString | text |
Properties
Sets user email Property Type : write-only Accepts : text |
|
SmsNumber | Sets user phone number Property Type : write-only Accepts : text |
SmallIcon |
Property Type : write-only Accepts : text |
4. Usages
Initialize OneSignal sdk
Ask for Notification Permission (will be asked only on Android 13 and above versions
Then Enable Push Notifications i.e. Subscribe User
Subscription State will be changed after EnablePush method
Now you can send Push Notifications
Set custom Small Icon
Custom icon can be set only from assets
You can generate small here from here
Requires Android Marshamallow (Api 23)
5. Demo Video and Images
Android 14
6. Purchase Extension
Thank you.
Hope it helps!