[PAID] OneSignalPush: Implement push notifications using OneSignal SDK ($10 or INR 701)

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

3. Documentation

Methods:

AddUserEmail

Adds user email address

ParameterType
emailtext

RemoveUserEmail

Removes user email address

ParameterType
emailtext

AddUserPhone

Adds user phone number

ParameterType
phonetext

RemoveUserPhone

Removes user phone number

ParameterType
phonetext

Initialize

Initialize OneSignal SDK with specified App Id

ParameterType
appIdtext

ClearNotification

Clears notifications with specified id

ParameterType
idnumber

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.

ParameterType
userIdtext

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

ParameterType
tagtext
valuetext

RemoveTag

Remove tag from user

ParameterType
tagtext

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

ParameterType
apiKeytext
appIdtext
titletext
bodytext
largeIcontext
datadictionary

SendToSubsIDs

Send notification to all specified Subscriber Ids

ParameterType
apiKeytext
appIdtext
idslist
titletext
bodytext
largeIcontext
datatext

SendCustomNotif

Send custom notification

ParameterType
apiKeytext
jsonStringtext

Events:

GotAllTags

Event raised after getting user’s tags

ParameterType
tagDictionarydictionary

NotificationSent

Event raised when notification was sent successfully


NotificationSendFailed

Event raised when notification sending failed

ParameterType
errorMsgtext

PermissionStateChanged

Event raised when notification permission state changes

ParameterType
isGrantedboolean

NotificationOpened

Event raised when user opens notification by clicking on it while app is in foreground

ParameterType
idnumber
datatext

NotificationReceived

Event raised when a notification is received

ParameterType
idnumber
datatext

ActionButtonClicked

Event raised when user opens notification by clicking Action Button

ParameterType
idnumber
actionIdtext
datatext

SubscriptionChanged

component_event

Event raised when subscription state changes

ParameterType
isSubscribedboolean
subscriptionIdtext
pushTokentext

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.

7. Updates

ChangeLog Version 2

  • Updated OneSignal SDK to 5.1.17
  • New Blocks
    image
    image
    image
  • 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!

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments