[PAID] OneSignalPush: Implement push notifications using Latest SDK - v5.1.23 ($10 or INR 701)

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: 2
Released: 2024-04-29T18:30:00Z
Last Updated: 2024-10-11T18:30:00Z
Permissions: android.permission.ACCESS_NETWORK_STATE , android.permission.POST_NOTIFICATIONS

Aix Size: 2.9mb

2. Blocks

image

3. Documentation

Events

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

Methods

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

Properties

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. Usages

Initialize OneSignal sdk

Ask for Notification Permission (will be asked only on Android 13 and above versions
image

Then Enable Push Notifications i.e. Subscribe User
image

Subscription State will be changed after EnablePush method

Now you can send Push Notifications

Set custom Small Icon
image
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

https://sunnythedeveloper.in/paid-onesignalpush-implement-push-notifications-using-onesignal-sdk-10-or-inr-701/

Thank you.
Hope it helps!

2 Likes

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 all 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 :tada::tada:
1 Like