Free Advanced OneSignal REST API Extension

🧩 OneSignalExtension

An extension for MIT App Inventor 2.
Complete OneSignal REST API Extension

:memo: Specifications


:package: Package: com.jamar.onesignalextension
:floppy_disk: Size: 62.63 KB
:mobile_phone: Minimum API Level: 14
:date: Updated On: 2025-12-31T18:30:00Z
:laptop: Built & documented using: FAST v5.4.0

Events:

OneSignalExtension has total 25 events.

1. OnNotificationSent

Triggered when notification is sent successfully

Parameter Type
response text

2. OnNotificationViewed

Triggered when notification details are viewed

Parameter Type
response text

3. OnNotificationCanceled

Triggered when notification is canceled

Parameter Type
response text

4. OnNotificationHistoryReceived

Triggered when notification history is received

Parameter Type
response text

5. OnNotificationsListReceived

Triggered when notifications list is received

Parameter Type
response text

6. OnDeviceAdded

Triggered when device is added successfully

Parameter Type
response text

7. OnDeviceEdited

Triggered when device is edited successfully

Parameter Type
response text

8. OnDeviceViewed

Triggered when device details are viewed

Parameter Type
response text

9. OnDevicesListReceived

Triggered when devices list is received

Parameter Type
response text

10. OnDevicesBySegmentReceived

Triggered when devices by segment are received

Parameter Type
response text

11. OnDevicesCountReceived

Triggered when devices count is received

Parameter Type
response text

12. OnDevicesCountBySegmentReceived

Triggered when devices count by segment is received

Parameter Type
response text

13. OnDevicesCSVExport

Triggered when devices CSV export is completed

Parameter Type
response text

14. OnSegmentsReceived

Triggered when segments list is received

Parameter Type
response text

15. OnSegmentCreated

Triggered when segment is created

Parameter Type
response text

16. OnSegmentDeleted

Triggered when segment is deleted

Parameter Type
response text

17. OnAppViewed

Triggered when app details are viewed

Parameter Type
response text

18. OnAppCreated

Triggered when app is created

Parameter Type
response text

19. OnAppUpdated

Triggered when app is updated

Parameter Type
response text

20. OnOutcomesReceived

Triggered when outcomes data is received

Parameter Type
response text

21. OnDeliveryStatsReceived

Triggered when delivery statistics are received

Parameter Type
response text

22. OnOpenTracked

Triggered when notification open is tracked

Parameter Type
response text

23. OnInAppMessageSent

Triggered when in-app message is sent

Parameter Type
response text

24. OnError

Triggered when an error occurs

Parameter Type
operation text
errorMessage text

25. OnApiComplete

Triggered when API call completes

Parameter Type
operation text
response text

Methods:

OneSignalExtension has total 32 methods.

1. Initialize

Initialize OneSignal with App ID and API Key

Parameter Type
appId text
restApiKey text

2. SendNotificationToDevices

Send push notification to specific devices

Parameter Type
playerIds text
title text
message text
data text

3. SendNotificationToSegments

Send push notification to segments

Parameter Type
segments text
title text
message text
data text

4. SendNotificationToAll

Send push notification to all users

Parameter Type
title text
message text
data text

5. SendAdvancedNotification

Send notification with advanced options

Parameter Type
payloadJson text

6. ViewNotification

View notification details

Parameter Type
notificationId text

7. Cancelnotification

Cancel scheduled notificaton

Parameter Type
notificationId text

8. GetNotificationHistory

Get notification history

Parameter Type
notificationId text
events text
email text

9. GetNotifications

Get notifications list with pagination

Parameter Type
limit number
offset number

10. AddDevice

Add a new device/player

Parameter Type
deviceType text
identifier text
data text

11. EditDevice

Edit an existing device/player

Parameter Type
playerId text
data text

12. ViewDevice

View device/player details

Parameter Type
playerId text

13. GetDevices

Get devices list with pagination

Parameter Type
limit number
offset number

14. GetDevicesBySegment

Get devices by segment

Parameter Type
segment text

15. GetDevicesCount

Get devices count

16. GetDevicesCountBySegment

Get devices count by segment

Parameter Type
segment text

17. ExportDevicesCSV

CSV export of all devices

18. GetSegments

Get all segments

19. CreateSegment

Create a new segment

Parameter Type
name text
filters text

20. DeleteSegment

Delete a segment

Parameter Type
segmentId text

21. ViewApp

View app details

22. CreateApp

Create a new app

Parameter Type
name text
apnsEnv text
gcmKey text

23. UpdateApp

Update app settings

Parameter Type
settings text

24. GetOutcomes

Get outcomes data

Parameter Type
outcomeNames text
outcomeNames2 text
outcomeTimeRange text
outcomePlatforms text
outcomeAttribution text

25. GetDeliveryStats

Get delivery statistics

26. TrackNotificationOpen

Track notification open

Parameter Type
notificationId text
playerId text

27. SendInAppMessage

Send in-app message

Parameter Type
playerIds text
message text

28. CreateNotificationPayload

Create notification payload JSON

  • Return type: text
Parameter Type
includedSegments text
includedPlayerIds text
title text
message text
data text
url text
iosBadgeCount text
iosSound text
androidSound text
smallIcon text
largeIcon text
bigPicture text
sendAfter text

29. CreateDeviceData

Create device data JSON

  • Return type: text
Parameter Type
identifier text
language text
timezone number
gameVersion text
deviceModel text
deviceOS text
adId text
sdk text
sessionCount number
tags text
amountSpent number
createdAt number
playtime number
badgeCount number
lastActive number
notificationTypes number

30. ExtractPlayerId

Extract player ID from response

  • Return type: text
Parameter Type
response text

31. ExtractNotificationId

Extract notification ID from response

  • Return type: text
Parameter Type
response text

32. IsSuccess

Check if operation was successful

  • Return type: boolean
Parameter Type
response text

Setters:

OneSignalExtension has total 3 setter properties.

1. AppId

Set OneSignal App ID

  • Input type: text

2. RestApiKey

Set OneSignal REST API Key

  • Input type: text

3. UserAuthKey

Set OneSignal User Auth Key

  • Input type: text

Blocks

:hammer_and_wrench: Use Case

The OneSignalExtension is ideal for developers building apps on MIT App Inventor 2 or Kodular who want to implement push notifications, in-app messages, and user/device management without writing complex server-side code. Typical use cases include,

  • Sending targeted notifications to specific devices or user segments.
  • Tracking notification opens and delivery statistics.
  • Managing devices, segments, and app data programmatically.
  • Creating automated campaigns using the REST API.
  • Exporting device data for analytics or integration with other services.

:white_check_mark: Why Choose This AIX

  • Complete REST API Integration – Covers 70% OneSignal REST API functionalities including notifications, devices, segments, and apps.
  • Easy to Use – Provides 32 methods and 25 events, simplifying complex API calls into simple blocks.
  • Flexible – Supports sending notifications to single devices, segments, or all users.
  • Data Extraction – Includes helper methods like ExtractPlayerId and ExtractNotificationId.
  • Cross-Platform Support – Works seamlessly with MIT App Inventor 2 and Kodular.
  • No Server Needed – Everything is handled directly from the app using the REST API.
  • Reliable CLI-built AIX – Built with FAST CLI, ensuring consistent structure and compatibility.

:folded_hands: Acknowledgment

Special thanks to @Jewel for the amazing FAST CLI AIX builder, which made this extension development smooth and reliable. Thanks also to @RaYzZz and @Still-learning for providing guidance and assisting with troubleshooting folder structure issues

:light_bulb: Note

No examples are included for now, so if you encounter any issues, feel free to ask in this thread​:slightly_smiling_face:.

For data and values, you can see here.

Download v2

com.jamar.onesignalextension.aix (40.8 KB)

:package: OneSignal AIX — Version 3 (v3) Changelog

:rocket: Release Overview

Version 3 is a major milestone release that completes OneSignal REST API integration, introducing full support for Templates, Users, Custom Events, and Live Activities.


🔔 Notification Templates (NEW – Full Support)

Added Functions

  • CreateTemplate – Create reusable notification templates
  • UpdateTemplate – Update existing templates
  • GetTemplates – Fetch all templates
  • GetTemplate – Retrieve a template by ID
  • DeleteTemplate – Delete a template permanently
  • SendNotificationWithTemplate – Send notifications using templates
  • CreateTemplateJson – Utility for generating valid template JSON

Added Events

  • OnTemplateCreated
  • OnTemplateUpdated
  • OnTemplatesReceived
  • OnTemplateReceived
  • OnTemplateDeleted
  • OnNotificationWithTemplateSent

Notes

  • Supports dynamic variables
  • Reduces payload duplication
  • Fully aligned with OneSignal Template API

👤 Users & Identity Management (COMPLETED)

Added Functions

  • CreateUser
  • GetUserByExternalId
  • UpdateUser
  • DeleteUser
  • GetUserSubscriptionStatus
  • GetUserIdentity
  • AddUserAlias
  • RemoveUserAlias
  • GetUserDevices

Added Events

  • OnUserCreated
  • OnUserReceived
  • OnUserUpdated
  • OnUserDeleted
  • OnUserSubscriptionStatusReceived
  • OnUserIdentityReceived
  • OnUserAliasAdded
  • OnUserAliasRemoved
  • OnUserDevicesReceived

Notes

  • Implements modern OneSignal Users API
  • Supports multi-device users
  • External User ID is now first-class

📊 Custom Events (COMPLETED)

Capabilities

  • Send custom user events
  • Attach event properties
  • Trigger OneSignal journeys and automation
  • Track advanced user behavior

Notes

  • Enables event-driven notifications
  • Improves analytics and segmentation

🟢 Live Activities (COMPLETED)

Capabilities

  • Start Live Activities
  • Update Live Activity state
  • End Live Activities
  • Real-time notification updates

Notes

  • Ideal for delivery tracking, live scores, progress updates
  • Compatible with OneSignal Live Activity workflows

⚙️ Internal Improvements
  • Improved background thread handling
  • Centralized OnError reporting
  • Safer JSON parsing
  • Better REST request stability
  • Optimized for Kodular runtime

⚠️ Important Notes / Breaking Changes
  • Fully migrated to OneSignal Users API
  • Legacy player-only workflows are deprecated
  • External User ID is required for most operations
  • REST API Key must be configured correctly

:white_check_mark: Final Summary

v3 completes the OneSignal API implementation, making this extension suitable for production-grade notification systems with templates, users, events, and live updates.

New added blocks and aix file

Download v3

com.jamar.onesignalextension.onesignalextension.aix (62.6 KB)


9 Likes

Good extension :100:
Thank you for your contribution. Could you provide an example of Aia for simple push notifications?

Here you go

Testing apk

OneSignalExtension.apk (6.9 MB)

AIA
OneSignal.aia (43.9 KB)

3 Likes

AIX Updated to v3 — Full OneSignal API Implementation Completed

2 Likes

As I suspected, unfortunately your plugin is not working.
It works, but only on simple projects.
Firebase Autontication doesn’t work in applications that have it enabled; Firebase gives an error; the application doesn’t respond during Google login; maybe it’s a Kodular.io problem.

Does this simple project also have Firebase Authentication? On the same point, recently there’s alot of threads reporting about Firebase Authentication, am not sure if the issue is related to that, because my aix doesn’t have anything to do with authentication file’s eg Googleservices.json,

Seem it’s OneSignal components with Firebase Authentication

To clarify how my aix is intended to be used,

My aix is designed for an admin app, where it uses the OneSignal REST API to send notifications or perform administrative actions.

The user app should use the standard OneSignal component.

These two should be separate apps,
Admin app → uses my aix
User app → uses OneSignal component

Woooah​:+1::+1::+1::raising_hands::raising_hands::raising_hands::raising_hands::raising_hands::raising_hands::raising_hands::raising_hands::clap::clap::clap::tada::tada::tada::tada::tada::selfie::blush:Amazing keep it up Mr Man, BTW happy new year to you Ibrahim and all koders.

I have tried to reach via PM but you’re not replying my friend, i have a work for you here, can you reply in PM?

1 Like

Thanks

Done

1 Like

I’ve tested many OneSignal plugins, the problem is with the local OneSignal plugin; when we add it, Firebase Auto becomes unusable, the application crashes, or we can’t log in.
We also need to add the local OneSignal plugin in order to obtain notification permission. The Kodular team needs to find a solution as soon as possible.

Maybe you should try authentication aix’s there’s a lot

how?I don’t understand what you want to say

Use external authentication extension than the built in component

Check this search

https://community.kodular.io/search?q=Auth%20%23extensions

1 Like

I only use Google Login. :sweat_smile: These are email, password, login

Here also you can give it a try:sweat_smile:

1 Like

FSA extension does not work with onesignal component as well

Have you tried my last reply? If you are using Google sign in, then try that

yes, if you added fsa and onesignal component together the export fail to happen at all

It will the more easily for developer’s to come in if you provide the build fail message, show us the error statement

Kodular is unable to compile this project.
The compiler error output was
[ReadBuildInfo] Starting Task
[ReadBuildInfo] Task succeeded in 0.004 seconds
[LoadComponentInfo] Starting Task
[LoadComponentInfo] INFO: Generating assets…
[LoadComponentInfo] Component assets needed, n = 7
[LoadComponentInfo] INFO: Generating activities…
[LoadComponentInfo] Component activities needed, n = 10
[LoadComponentInfo] INFO: Component “com.sunny.fs.FSA” does not specify activityMetadata
[LoadComponentInfo] Component activity metadata needed, n = 0
[LoadComponentInfo] INFO: Generating broadcast receivers…
[LoadComponentInfo] INFO: Component “com.sunny.fs.FSA” does not specify broadcastReceivers
[LoadComponentInfo] INFO: Component “com.sunny.fs.FSA” does not specify contentProviders
[LoadComponentInfo] INFO: Generating libraries…
[LoadComponentInfo] INFO: Component “com.sunny.fs.FSA” does not specify libraries
[LoadComponentInfo] Libraries needed, n = 76
[LoadComponentInfo] INFO: Component “com.sunny.fs.FSA” does not specify metadata
[LoadComponentInfo] Component metadata needed, n = 0
[LoadComponentInfo] INFO: Generating Android minimum SDK…
[LoadComponentInfo] INFO: Generating native libraries…
[LoadComponentInfo] INFO: Component “com.sunny.fs.FSA” does not specify native
[LoadComponentInfo] Native Libraries needed, n = 0
[LoadComponentInfo] INFO: Generating permissions…
[LoadComponentInfo] usesLocation = False
[LoadComponentInfo] Permissions needed, n = 29
[LoadComponentInfo] INFO: Component “com.sunny.fs.FSA” does not specify queries
[LoadComponentInfo] INFO: Component “com.sunny.fs.FSA” does not specify services
[LoadComponentInfo] INFO: Component “com.sunny.fs.FSA” does not specify xmls
[LoadComponentInfo] Component xmls needed, n = 0
[LoadComponentInfo] INFO: Generating component broadcast receivers…
[LoadComponentInfo] INFO: Component “com.sunny.fs.FSA” does not specify broadcastReceiver
[LoadComponentInfo] Task succeeded in 0.004 seconds
[CheckDeprecatedComponents] Starting Task
[CheckDeprecatedComponents] Task succeeded in 0.017 seconds
[CheckComponentRequirements] Starting Task
[CheckComponentRequirements] Task succeeded in 0.0 seconds
[VerifyExtensions] Starting Task
[VerifyExtensions] Task succeeded in 0.194 seconds
[GenerateBuildId] Starting Task
[GenerateBuildId] INFO: Skipping Build ID generation for App with no required components.
[GenerateBuildId] Task succeeded in 0.0 seconds
[RetrieveGamAdUnit] Starting Task
[RetrieveGamAdUnit] INFO: Skipping Ad Unit ID retrieval for app with no required components.
[RetrieveGamAdUnit] Task succeeded in 0.0 seconds
[PrepareAppIcon] Starting Task
[PrepareAppIcon] INFO: Creating mipmap dirs…
[PrepareAppIcon] INFO: Generating icons…
[PrepareAppIcon] Generating icons for mipmap-mdpi
[PrepareAppIcon] Generating icons for mipmap-hdpi
[PrepareAppIcon] Generating icons for mipmap-xhdpi
[PrepareAppIcon] Generating icons for mipmap-xxhdpi
[PrepareAppIcon] Generating icons for mipmap-xxxhdpi
[PrepareAppIcon] Task succeeded in 0.249 seconds
[XmlConfig] Starting Task
[XmlConfig] INFO: Creating animation xml
[XmlConfig] Creating zoom_enter.xml
[XmlConfig] Creating fadeout.xml
[XmlConfig] Creating slide_v_exit.xml
[XmlConfig] Creating fadein.xml
[XmlConfig] Creating zoom_exit.xml
[XmlConfig] Creating slide_v_enter.xml
[XmlConfig] Creating zoom_exit_reverse.xml
[XmlConfig] Creating slide_v_enter_reverse.xml
[XmlConfig] Creating zoom_enter_reverse.xml
[XmlConfig] Creating slide_enter_reverse.xml
[XmlConfig] Creating slide_exit.xml
[XmlConfig] Creating hold.xml
[XmlConfig] Creating slide_enter.xml
[XmlConfig] Creating slide_v_exit_reverse.xml
[XmlConfig] Creating slide_exit_reverse.xml
[XmlConfig] INFO: Creating colors xml
[XmlConfig] INFO: Creating styles xml
[XmlConfig] INFO: Creating provider_path xml
[XmlConfig] INFO: Creating network_security_config xml
[XmlConfig] INFO: Generating adaptive icon file
[XmlConfig] INFO: Generating round adaptive icon file
[XmlConfig] INFO: Generating adaptive icon background file
[XmlConfig] INFO: Creating fragment xml
[XmlConfig] INFO: Creating listview xml
[XmlConfig] INFO: Creating listview-21 xml
[XmlConfig] INFO: Creating drawable xml
[XmlConfig] INFO: Creating drawable-21 xml
[XmlConfig] INFO: Creating strings xml
[XmlConfig] Task succeeded in 0.001 seconds
[CreateManifest] Starting Task
[CreateManifest] INFO: Reading project specs…
[CreateManifest] VCode: 1
[CreateManifest] VName: 1.0
[CreateManifest] Custom Package Name: com.letsgoo.myappp
[CreateManifest] Min SDK 21
[CreateManifest] INFO: Writing screen ‘io.kodular.bem4335.d.Screen2’
[CreateManifest] INFO: Writing screen ‘io.kodular.bem4335.d.Screen1’
[CreateManifest] Task succeeded in 0.0 seconds
[AttachNativeLibs] Starting Task
[AttachNativeLibs] Task succeeded in 0.0 seconds
[AttachAarLibs] Starting Task
[AttachAarLibs] Task succeeded in 0.155 seconds
[AttachCompAssets] Starting Task
[AttachCompAssets] Task succeeded in 0.002 seconds
[MergeResources] Starting Task
[MergeResources] Task succeeded in 0.191 seconds
[SetupLibs] Starting Task
[SetupLibs] Task succeeded in 0.0 seconds
[RunAapt] Starting Task
[RunAapt] Task succeeded in 0.63 seconds
[GenerateClasses] Starting Task
[GenerateClasses] INFO: Source File: io/kodular/bem4335/d/Screen2.yail
[GenerateClasses] INFO: Source File: io/kodular/bem4335/d/Screen1.yail
(compiling io/kodular/bem4335/d/Screen2.yail to io.kodular.bem4335.d.Screen2)
(compiling io/kodular/bem4335/d/Screen1.yail to io.kodular.bem4335.d.Screen1)
(compiling /tmp/runtime8297274108134452862.scm to com.google.youngandroid.runtime)
[GenerateClasses] Task succeeded in 4.853 seconds
[RunD8] Starting Task
[RunD8] ERROR: Your project contains extensions that conflict with internal libraries.
[RunD8] INFO: Help: You can either remove the conflicting extensions OR add “-d8fix” at the end of your app’s version name to fix this automatically.
[RunD8] INFO: Note: “-d8fix” might result in unexpected behaviour in some cases.
[RunD8] ERROR: Classes and conflicting external packages:

"com.google.android.gms.auth.api.signin.GoogleSignInAccount": ["com.sunny.fs"]
[RunD8] ERROR: d8 failed.
[RunD8] Task errored in 0.917 seconds
.

Have you tried the suggestion from the error fix?

Add -d8fix in your apps version