[PAID] OneSignalPush: Implement push notifications using OneSignal SDK

1. Introduction

Description: This extension allows you to implement Onesignal in your app with the latest SDK v5.1.23. Onesignal is the most reliable and popular push notification platform for android and other devices. This extension allows you send push notification to the android devices with all onesignal latest features.
Latest Version: 3.1
Released on: April 30, 2024
Updated on: January 7, 2025
Aix Size: 2.9MB

2. Blocks

3. Documentation

GotAllTagsEvent raised after getting user’s tags
tagDictionary | dictionary
NotificationSentEvent raised when notification was sent successfully
NotificationSendFailedEvent raised when notification sending failed
errorMsg | text
PermissionStateChangedEvent raised when notification permission state changes
isGranted | boolean
NotificationOpenedEvent raised when user opens notification by clicking on it while app is in foreground
id | number
data | text
NotificationReceivedEvent raised when a notification is received
id | number
data | text
ActionButtonClickedEvent raised when user opens notification by clicking Action Button
id | number
actionId | text
data | text
SubscriptionChangedEvent raised when subscription state changes
isSubscribed | boolean
subscriptionId | text
pushToken | text
AddUserEmailAdds user email address
email | text
RemoveUserEmailRemoves user email address
email | text
AddUserPhoneAdds user phone number
phone | text
RemoveUserPhoneRemoves user phone number
phone | text
InitializeInitialize OneSignal SDK with specified App Id
appId | text
ClearNotificationClears notifications with specified id
id | number
ClearAllNotificationsClears all notifications posted by OneSignal
AskPermissionAsks for Notification permission in Android 13 and above
IsPermissionGrantedReturns whether notification permission has been granted or not
IsInitializedReturns whether OneSignal has been initialized or not
LoginLogin with given user id. It has no effect on Push Notifications.
userId | text
GetUserIdReturns user (external) id set using ‘Login’ block
GetSubscriptionIdReturns subscription id which is generated by OneSignal
GetPushTokenReturns push token
AddTagAdd tag to user
tag | text
value | text
RemoveTagRemove tag from user
tag | text
GetAllTagsFetches user’s all tags from OneSignal
EnablePushEnable Push notifications
DisablePushDisable Push notifications
IsSubscribedReturns user’s subscription status
LogOutLogs out current user. It has no effect on Push Notifications.
RetrieveBackgroundNotifsRetrieve all cached notifications which were received when app was closed
ClearBackgroundNotifsClears all cached notifications
SendToAllSubscribersSend notification to all subscribed users
apiKey | text
appId | text
title | text
body | text
largeIcon | text
data | dictionary
SendToSubsIDsSend notification to all specified Subscriber Ids
apiKey | text
appId | text
ids | list
title | text
body | text
largeIcon | text
data | text
SendCustomNotifSend custom notification
apiKey | text
jsonString | text
SdkVersionReturns OneSignal SDK version
Property Type : read-only
Accepts : text
LanguageSets user language
Property Type : write-only
Accepts : text
SmallIconSets small icon (from Assets) to be used in notification
Property Type : write-only
Accepts : text
UseBigPictureUses largeIcon as Big Picture in notification sent using blocks
Property Type : write-only
Accepts : boolean

4. Example blocks

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

6. Purchase the extension

Please include your email address in payment note or just contact me after payment to get aix and related files.

7. Updates

Thank you.
Hope it helps!

Scroll to Top