OneSignalPush Extension
This extension ships with latest OneSignal SDK (5.1.23) . 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: 3
Released: April 30, 2024
Last Updated: October 12, 2024
Permissions: android.permission.ACCESS_NETWORK_STATE
, android.permission.POST_NOTIFICATIONS
Aix Size: 2.9 mb
2. Blocks






3. Documentation
Methods:
AddUserEmail

Adds user email address
Parameter | Type |
---|---|
text |
RemoveUserEmail

Removes user email address
Parameter | Type |
---|---|
text |
AddUserPhone

Adds user phone number
Parameter | Type |
---|---|
phone | text |
RemoveUserPhone

Removes user phone number
Parameter | Type |
---|---|
phone | text |
Initialize

Initialize OneSignal SDK with specified App Id
Parameter | Type |
---|---|
appId | text |
ClearNotification

Clears notifications with specified id
Parameter | Type |
---|---|
id | number |
ClearAllNotifications

Clears all notifications posted by OneSignal
AskPermission

Asks for Notification permission in Android 13 and above
IsPermissionGranted

Returns whether notification permission has been granted or not
Return Type: boolean
IsInitialized

Returns whether OneSignal has been initialized or not
Return Type: boolean
Login

Login with given user id. It has no effect on Push Notifications.
Parameter | Type |
---|---|
userId | text |
GetUserId

Returns user (external) id set using ‘Login’ block
Return Type: text
GetSubscriptionId

Returns subscription id which is generated by OneSignal
Return Type: text
GetPushToken

Returns push token
Return Type: text
AddTag

Add tag to user
Parameter | Type |
---|---|
tag | text |
value | text |
RemoveTag

Remove tag from user
Parameter | Type |
---|---|
tag | text |
GetAllTags

Fetches user’s all tags from OneSignal
EnablePush

Enable Push notifications
DisablePush

Disable Push notifications
IsSubscribed

Returns user’s subscription status
Return Type: boolean
LogOut

Logs out current user. It has no effect on Push Notifications.
RetrieveBackgroundNotifs

Retrieve all cached notifications which were received when app was closed
Return Type: dictionary
ClearBackgroundNotifs

Clears all cached notifications
SendToAllSubscribers

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

Parameter | Type |
---|---|
apiKey | text |
appId | text |
ids | list |
title | text |
body | text |
largeIcon | text |
data | text |
SendCustomNotif

Send custom notification
Parameter | Type |
---|---|
apiKey | text |
jsonString | text |
Events:
GotAllTags

Event raised after getting user’s tags
Parameter | Type |
---|---|
tagDictionary | dictionary |
NotificationSent

Event raised when notification was sent successfully
NotificationSendFailed

Event raised when notification sending failed
Parameter | Type |
---|---|
errorMsg | text |
PermissionStateChanged

Event raised when notification permission state changes
Parameter | Type |
---|---|
isGranted | boolean |
NotificationOpened

Event raised when user opens notification by clicking on it while app is in foreground
Parameter | Type |
---|---|
id | number |
data | text |
NotificationReceived

Event raised when a notification is received
Parameter | Type |
---|---|
id | number |
data | text |
ActionButtonClicked

Event raised when user opens notification by clicking Action Button
Parameter | Type |
---|---|
id | number |
actionId | text |
data | text |
SubscriptionChanged

Event raised when subscription state changes
Parameter | Type |
---|---|
isSubscribed | boolean |
subscriptionId | text |
pushToken | text |
Properties:
SdkVersion

Returns OneSignal SDK version
Language

Sets user language
SmallIcon

Sets small icon (from Assets) to be used in notification
UseBigPicture

Uses largeIcon as Big Picture in notification sent using blocks
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 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.
ChangeLog Version 3
- SDK updated to 5.1.23
Thank you.
Hope it helps!