Mobile OneSignal

The Mobile OneSignal add​on implements push notifications and in-app messages into your mobile application for both Android and iOS, using the popular OneSignal SDK and service.

There are lots of features and tools to use, all the​ features in the OneSignal SDK is completely implemented into Construct 3 using this addon.

The best benefit for this plugin is that it is a sole Construct 3 Editor and c3runtime implementation, dedicated for optimization and performance with the c3runtime with ES6 API features.

It will easily integrate the native push notifications, in-application messaging and post notification features into your mobile application using the popular OneSignal SDK.

Intstructions

1. The first step is to add the Mobile OneSignal addon into the project.

2. The next step is to create your own OneSignal account.

3. From your project, go to the Properties Bar while the Mobile OneSignal object is selected. 

4. Create an application, then you will be required some credentials, click here for Android and here for iOS.

5. Input your OneSignal App ID into the App ID field in the configuration section.
Click here for the instructions.

6. By default, all the rest of the property settings should be ready for production. Unless you know what you're doing, don't change any settings aside from the app id field.

7. Build your application, then start sending notifications!

Useful Links:

Features

The Mobile OneSignal is an addon that integrates the native mobile OneSignal SDK into a Construct 3 mobile application project with support for both android and ios.
It allows you to implement push notifications, in-app messaging and post notifications for your mobile applications.

Features :

  • Full native Android SDK integration.

  • Full native iOS SDK integration.

  • Push Notifications.

  • In-App Messages.

  • Post Notification (Client-side)

  • Easy to use and no programming required.

  • Well-supported and fully tested.

  • Full OneSignal SDK implementation

  • GDPR, Consent and iOS permission prompt.

  • Tags, Triggers & External UserID

  • Free and Premium service features.

  • Appearances, Vibrate and Sound.

  • Email and Location features.

  • Construct 3 editor support.

  • Construct 3 runtime.

  • C3 Build Service, PhoneGap.

  • Cordova CLI, Android Studio & XCode.

Actions, Conditions & Expressions

Actions

Privacy :

  • Provide User Consent - If your application is set to require the user's privacy consent, you can provide this consent using this method. Until enabled, the OneSignal will not fully initialize.

    • Consent - Check to acknowledge that the user has provided consent.

  • Check If User Provided Consent - Checks if the user has already provided privacy consent. Triggers 'On Check If User Provided Consent' and toggles with the 'Is Consent Provided'.

iOS :

  • Prompt For Push Notifications Permission - Prompt the user for notification permissions. Only works if you set 'kOSSettingsKeyAutoPrompt' to 'false'. You can only prompt once, so make sure to specify the benefits.


Status :

  • Get Permission Subscription State - Get the current notification and permission state.


Tags :

  • Get Tags - Retrieve a list of tags that have been set on the user from the OneSignal server.

  • Send Tag - Tag a user based on an app event of your choosing so later you can create segments in Segments to target these users.

    • Key - Key of your choosing to create or update.

    • Value - Value to set on the key. NOTE: Passing in a blank String deletes the key, you can also call 'Delete Tag' or 'Delete Tags'.

  • Delete Tag - Deletes a single tag that was previously set on a user with "Send Tag" or "Send Tags".

    • Key - Key to remove.


Tags : Batched :

  • Send Tags - Tag a user based on an app event of your choosing so later you can create segments in Segments to target these users. List collected from previously set plans.

  • Delete Tags - Deletes one or more tags that were previously set on a user with "Send Tag" or "Send Tags". List collected from previously set plans.

  • Plan Send Tag - Plan a tag to add to the next 'Send Tags' action.

    • Key - Key of your choosing to create or update.

    • Value - Value to set on the key. NOTE: Passing in a blank String deletes the key, you can also call 'Delete Tag' or 'Delete Tags'.

  • Plan Delete Tag - Plan to add a tag for removal on the next 'Delete Tags' action.

    • Key - Key to remove.


Data :

  • Prompt Location - Prompts the user for location permissions. This allows for geotagging so you can send notifications to users based on location.


Sending Notifications :

  • Post Notification - Allows you to send notifications from user to user or schedule ones in the future to be delivered to the current device.

  • Clear Notifications - Clears all notifications in the Notification Center aka Shade sent from OneSignal.

  • Set Subscription - You can call this method with 'False' to opt users out of receiving all notifications through OneSignal. You can pass 'True' later to opt users back into notifications.This unsubscribes the user from OneSignal, but the device will still show as subscribed to push.

    • Toggle - Check to toggle 'True', uncheck to toggle 'False'.


In-App Messaging : Trigger :

  • Add Trigger - Add a trigger, may show an In-App Message if its triggers conditions were met.

    • Key - Key for the trigger.

    • Value - Value for the trigger.

  • Remove Trigger - Removes a single trigger for the given key, may show an In-App Message if its triggers conditions were met.

    • Key - Key for trigger to remove.

  • Get Trigger Value - Gets a trigger value for a provided trigger key.

    • Key - Key for the trigger.


In-App Messaging : Trigger : Batched :

  • Add Triggers - Add a key-value Object of triggers, may show an In-App Message if its triggers conditions were met. List collected from previously set plans.

  • Remove Triggers - Removes a list of triggers based on a collection of keys, may show an In-App Message if its triggers conditions were met. List collected from previously set plans.

  • Plan Add Trigger - Plan a trigger to add to the next 'Add Triggers' action.

    • Key - Key for the trigger.

    • Value - Value for the trigger.

  • Plan Remove Trigger - Plan to add a trigger for removal on the next 'Remove Triggers' action.

    • Key - Key for trigger to remove.


In-App - MISC :

  • Pause In-App Messages - Allows you to temporarily pause all In-App Messages. You may want to do this while the user is watching a video playing a match in your game to make sure they don't get interrupted at a bad time.

    • Toggle - To pause set to 'true'. And to resume, set to 'false'.


Email :

  • Set Email - This allows you to set the user's email address with the OneSignal SDK.

    • Email Address - The email address of the user. Make sure it's verified and without duplication.

    • Email Auth Token - Auth Token from your backend server.

  • Logout Email - If your app implements logout functionality, you can call this to dissociate the email from the device.


External-IDs :

  • Set External User ID - If your system assigns unique identifiers to users, it can be annoying to have to also remember their OneSignal user ID's as well. To make things easier, OneSignal now allows you to set an 'external_id' for your users. Simply call this method, pass in your custom user ID (as a string), and from now on when you send a push notification, you can use 'include_external_user_ids' instead of 'include_player_ids'.

    • UserID - UserID provided by your backend server. Example, the user's PlayFabID.

  • Remove External User ID - UserID provided by your backend server. Example, the user's PlayFabID.


Android :

  • Enable Vibrate - By default OneSignal always vibrates the device when a notification is displayed unless the device is in a total silent mode. Passing 'false' means that the device will only vibrate lightly when the device is in it's vibrate only mode.

    • Toggle - Set 'False' to disable vibrate, 'True' to re-enable it.

  • Enable Sound - By default OneSignal plays the system's default notification sound when the device's notification system volume is turned on. You may also set 'custom sounds' on notifications. Passing 'False' means that the device will only vibrate unless the device is set to a total silent mode.

    • Toggle - Set 'False' to disable sound, 'True' to re-enable it.

Conditions

Privacy :

  • Is Consent Provided - Checks if the user has given privacy consent.

  • On Check If User Provided Consent - Callback conditional trigger for the action 'Check If User Provided Consent'.

iOS :

  • On Prompt Push Notification Permission - Trigger fires as soon as the user accepts or declines notifications from the iOS notification permission prompt.

    • Response - The user's response from the permission prompt. Either "Accepted" or "Rejected".


Status :

  • On Get Permission Subscription State - Callback conditional trigger for the 'Get Permission Subscription State' action.


Tags :

  • On Get Tags - Triggers if the 'Get Tags' action has completed.


Sending Notifications :

  • On Post Notification Success - Trigger fires when the notification was created on OneSignal's server.

  • On Post Notification Failure - Trigger fires if the post notification fails.


In-App Messaging : Trigger :

  • On Get Trigger Value - Trigger fires when the 'Get Trigger Value' action is completed.

    • Key - The trigger key.


In-App - MISC :

  • On In-App Message Clicked - Trigger fires when an In-App Message is tapped on.


Email :

  • On Set Email Success - Trigger fires when the 'Set Email' action succeeds.

  • On Set Email Failure - Trigger fires when the 'Set Email' action failed.

  • On Logout Email Success - Trigger fires when the 'Logout Email' action succeeds.

  • On Logout Email Failure - Trigger fires when the 'Logout Email' action failed.


Notification :

  • On Notification Received - Triggers if the app is running in the foreground at the time the notification was received.

  • On Notification Opened - Triggers when a notification is tapped on from the notification shade (ANDROID) or notification center (iOS), or when closing an Alert notification shown in the app (if InAppAlert is enabled in InFocusDisplaying).


Status : Observer :

  • On Subscription Status Changed - Triggers if the subscription status changes.

  • On Permission Status Changed - Triggers if the permission status changes.


Email : Status :

  • On Email Status Changed - Trigger fires when the email subscription observer to track changes to email subscriptions (ie. the user sets their email or logs out), detects a change.

Expressions

Status :

  • SubscriptionStatus - Returns the current notification state, in JSON string.

  • PermissionStatus - Returns the current permission state, in JSON string.

Tags :

  • Tags - Retrieves the JSON string list of tags, if the 'On Get Tags' condition, triggers. 


Sending Notifications :

  • PostNotificationData - Returns the post notification data, in JSON string.


In-App Messaging : Trigger :

  • TriggerValue - Returns a single trigger value for the given key, if it exists, otherwise returns an empty string.


In-App - MISC :

  • FirstClick - Returns 'True' if this is the first time the user has pressed any action on the In App Message, otherwise 'False'.

  • ClosesMessage - Did the action close the In App Message. Returns 'True' if the In App Message will animate off the screen, otherwise 'False' if the In App Message will stay on screen until the user dismisses.

  • ClickURL - Returns an optional URL that opens when the action takes place. Only present if set through the dashboard.

  • ClickName - An optional click name defined for the action element. Only present if set through the dashboard.


Status : Observer :

  • ObserverSubscriptionStatus - Returns the subscription status observer data, in JSON string.

  • ObserverPermissionStatus - Returns the permission status observer data, in JSON string.


Email : Status :

  • NewEmail - Returns the new email address detected by the 'Email Subscription Status Observer'.

  • NewUserID - Returns the new user id detected by the 'Email Subscription Status Observer'.

  • OldEmail - Returns the old email used before a change was detected by the 'Email Subscription Status Observer'.

  • OldUserID - Returns the old userid used before a change was detected by the 'Email Subscription Status Observer'.


Status : Subscription Status :

  • Subscribed - "True" if subscribed to push notifications, otherwise "False".

  • UserSubscriptionSetting - Reflects value of "Set Subscription". Defaults to "True".

  • UserID - The OneSignal Player ID.

  • PushToken - Device Identifier from FCM/APNs.


Status : Permission Status :

  • Status - 0 = Not Determined, 1 = Denied and 2 = Authorized.

  • State - 1 = Authorized and 2 = Denied.

  • HasPrompted - "False" = Not prompted and "True" = Prompted.

  • Provisional - Either "True" or "False". iOS only : Provisional notifications are non-interruptive notifications and can be turned on in the iOS Settings.


Receiving Notifications :

  • NotificationReceivedData - Returns the received notification's data, in JSON string.

  • NotificationOpenedData - Returns the opened notification's data, in JSON string.

Properties

Properties.png

Configuration - The general settings to apply to the Mobile OneSignal.

  • Debug Mode - Enable to log info and error messages into the Developer Tools : Console.

  • App ID - Your OneSignal application id (app id).

Initialization - The settings required to setup before starting the OneSignal service.

  • In-Focus-Displaying - Default: InAppAlert - native alert dialog display, which can be helpful during development (note this is not an In-App Message).; Notification - native notification display while user has app in focus (can be distracting).; None - notification is silent.

    • Notification

    • In-App-Alert

    • None

iOS Initialization - Initialization for iOS.

  • kOSSettingsKeyAutoPrompt - Auto prompt user for notification permissions.

  • kOSSettingsKeyInAppLaunchURL - Used with the Launch URL you set on push notifications. 'True' will open the Launch URL in an in-app browser and 'False' will open the Launch URL in the device's default browser.

  • Debug - The debugging configuration section for OneSignal.

    • Log Level - Sets the logging level to print to the iOS Xcode log or the Android LogCat log.

      • 0 = NONE

      • 1 = FATAL

      • 2 = ERROR

      • 3 = WARN

      • 4 = INFO

      • 5 = DEBUG

      • 6 = VERBOSE

    • Visual Level - Sets the logging level to show as alert dialogs.

      • 0 = NONE

      • 1 = FATAL

      • 2 = ERROR

      • 3 = WARN

      • 4 = INFO

      • 5 = DEBUG

      • 6 = VERBOSE

Privacy - The privacy settings for the users.

  • Requires User Privacy Consent - Allows you to delay the initialization of the SDK until the user provides privacy consent through the 'Provide User Consent = True' action.

Status - The state of the notification subscriptions and permissions.

  • Permission Status : Observer - If on "Auto-Update", the notification permission status is automatically updated when the observer detects a change.

    • Manual

    • Auto-Update

  • Subscription Status : Observer - If on "Auto-Update", the notification subscription status is automatically updated when the observer detects a change.

    • Manual

    • Auto-Update

Data - Configuration for the user's data.

  • Set Location Shared - Disable or enable location collection (defaults to enabled if your app has location permission).

Email - User email configuration section.

  • Email Status Observer - Email subscription observer to track changes to email subscriptions (ie. the user sets their email or logs out).

    • Manual

    • Auto-Update

 
 
 
 

Feature Showcase

The Mobile OneSignal is an addon that integrates the complete native mobile OneSignal SDK into Construct 3 mobile applications, with support for both android and ios.
It allows you to implement push notifications, in-application messaging and post notification features for your mobile applications.

 
 

Easy Project

Sample Setup Project

Specifications

  • Instructions - The sample project has comments and instructions on how to use the addon and its features.

  • A.C.E. Coverage - It covers the implementation of each action, condition and expression.

  • Tips and Tricks - It provides some tips and tricks to a better use of the addon and of the event-sheet system alongside it.

Supporters

Only

Test Project

Sample Setup Project

Specifications

  • Instructions - The sample project has comments and instructions on how to use the addon and its features.

  • A.C.E. Coverage - It covers the implementation of each action, condition and expression.

  • Tips and Tricks - It provides some tips and tricks to a better use of the addon and of the event-sheet system alongside it.

Supporters

Only

Get the tools

for your pro games!

Constuct Master Collection - Itch.io
Constuct Master Collection - Discord
Constuct Master Collection - Construct 3

© Construct Master Collection 2020 • All rights reserved

Contact Information: