OneSignalPush Extension
This extension ships with latest OneSignal SDK (5.1.17) . You can easily receive push notifications sent from OneSignal dashboard or from blocks in your app. You can send notifications to all subs and individuals. You can send a customized notification also.1. Overview
LatestVersion: 2
Released: April 30, 2024
Last Updated: July 19, 2024
Permissions: android.permission.ACCESS_NETWORK_STATE
, android.permission.POST_NOTIFICATIONS
Aix Size: 2.9 mb
2. Blocks
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-28.png)
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-29.png)
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-30.png)
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-31.png)
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-32.png)
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-33.png)
3. Documentation
Methods:
AddUserEmail
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-42.png)
Adds user email address
Parameter | Type |
---|---|
text |
RemoveUserEmail
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-43.png)
Removes user email address
Parameter | Type |
---|---|
text |
AddUserPhone
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-44.png)
Adds user phone number
Parameter | Type |
---|---|
phone | text |
RemoveUserPhone
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-45.png)
Removes user phone number
Parameter | Type |
---|---|
phone | text |
Initialize
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-46.png)
Initialize OneSignal SDK with specified App Id
Parameter | Type |
---|---|
appId | text |
ClearNotification
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-47.png)
Clears notifications with specified id
Parameter | Type |
---|---|
id | number |
ClearAllNotifications
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-48.png)
Clears all notifications posted by OneSignal
AskPermission
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-49.png)
Asks for Notification permission in Android 13 and above
IsPermissionGranted
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-50.png)
Returns whether notification permission has been granted or not
Return Type: boolean
IsInitialized
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-51.png)
Returns whether OneSignal has been initialized or not
Return Type: boolean
Login
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-52.png)
Login with given user id. It has no effect on Push Notifications.
Parameter | Type |
---|---|
userId | text |
GetUserId
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-53.png)
Returns user (external) id set using ‘Login’ block
Return Type: text
GetSubscriptionId
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-54.png)
Returns subscription id which is generated by OneSignal
Return Type: text
GetPushToken
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-55.png)
Returns push token
Return Type: text
AddTag
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-56.png)
Add tag to user
Parameter | Type |
---|---|
tag | text |
value | text |
RemoveTag
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-57.png)
Remove tag from user
Parameter | Type |
---|---|
tag | text |
GetAllTags
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-58.png)
Fetches user’s all tags from OneSignal
EnablePush
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-59.png)
Enable Push notifications
DisablePush
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-60.png)
Disable Push notifications
IsSubscribed
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-61.png)
Returns user’s subscription status
Return Type: boolean
LogOut
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-62.png)
Logs out current user. It has no effect on Push Notifications.
RetrieveBackgroundNotifs
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-63.png)
Retrieve all cached notifications which were received when app was closed
Return Type: dictionary
ClearBackgroundNotifs
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-64.png)
Clears all cached notifications
SendToAllSubscribers
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-65.png)
Send notification to all subscribed users
Parameter | Type |
---|---|
apiKey | text |
appId | text |
title | text |
body | text |
largeIcon | text |
data | dictionary |
SendToSubsIDs
Send notification to all specified Subscriber Ids
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-66.png)
Parameter | Type |
---|---|
apiKey | text |
appId | text |
ids | list |
title | text |
body | text |
largeIcon | text |
data | text |
SendCustomNotif
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-67.png)
Send custom notification
Parameter | Type |
---|---|
apiKey | text |
jsonString | text |
Events:
GotAllTags
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-68.png)
Event raised after getting user’s tags
Parameter | Type |
---|---|
tagDictionary | dictionary |
NotificationSent
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-69.png)
Event raised when notification was sent successfully
NotificationSendFailed
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-70.png)
Event raised when notification sending failed
Parameter | Type |
---|---|
errorMsg | text |
PermissionStateChanged
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-41-1024x246.png)
Event raised when notification permission state changes
Parameter | Type |
---|---|
isGranted | boolean |
NotificationOpened
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-40-1024x277.png)
Event raised when user opens notification by clicking on it while app is in foreground
Parameter | Type |
---|---|
id | number |
data | text |
NotificationReceived
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-39-1024x270.png)
Event raised when a notification is received
Parameter | Type |
---|---|
id | number |
data | text |
ActionButtonClicked
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-38-1024x271.png)
Event raised when user opens notification by clicking Action Button
Parameter | Type |
---|---|
id | number |
actionId | text |
data | text |
SubscriptionChanged
![component_event](https://kodular-community.s3.dualstack.eu-west-1.amazonaws.com/original/4X/8/9/6/89678019c56145bae999d4208a14407ee628b644.png)
Event raised when subscription state changes
Parameter | Type |
---|---|
isSubscribed | boolean |
subscriptionId | text |
pushToken | text |
Properties:
SdkVersion
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-37-1024x110.png)
Returns OneSignal SDK version
Language
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-36-1024x106.png)
Sets user language
SmallIcon
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-35-1024x106.png)
Sets small icon (from Assets) to be used in notification
UseBigPicture
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-34-1024x97.png)
Uses largeIcon as Big Picture in notification sent using blocks
4. Usages
Initialize OneSignal sdk
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-72.png)
Ask for Notification Permission (will be asked only on Android 13 and above versions
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-71.png)
Then Enable Push Notifications i.e. Subscribe User
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-73.png)
Subscription State will be changed after EnablePush method
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-74.png)
Now you can send Push Notifications
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-75.png)
Set custom Small Icon
![](https://sunnythedeveloper.in/wp-content/uploads/2024/04/image-76.png)
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 the extension
Please include your email address in payment note or just contact me after payment to get aix and related files.
Terms and Conditions
By purchasing extension you agree to Extension Buying Policy
7. Updates
ChangeLog Version 2
- Updated OneSignal SDK to
5.1.17
- New Blocks
- Blocks Renamed
SetExternalId
→Login
RemoveExternalId
→LogOut
GetUserId
→GetSubscriptionId
- Works with Firebase Components
- Aix size increased to
2.9 mb
Users will have to put license key in Designer Property instead of uploading in Assets.
Thank you.
Hope it helps!