Skip to main content

Third Party Integrations

OneSignal Integration#

OneSignal is a SaaS tool that allows app owners to create targeted cloud messaging (web/mobile) campaigns and send custom notifications to their users.

By creating a ready to use integration between Appmate and OneSignal, we allow Appmate users enrich their cloud messaging targeting options with in-app purchase statuses of their users.

e.g. if a user has started a new subscription using Appmate SDK, app owner may send a delayed push message (24 hours later) to the user to inform them about some new feature they can now access.

This can be achieved by passing some attributes to OneSignal via API implementation.

For every subscription event in Appmate, the following event tags get added or updated on the user in OneSignal.

EventDescription
appmateUserIdUser ID of the app registered in Appmate
inTrialPeriodWhether user is in trial period
purchaseStatusCurrent status of the purchase (i.e. purchaseType)
purchaseTimeEpoch time in seconds of the latest subscription purchase or renewal
expireTimeEpoch time in seconds of the latest subscription expiration date
graceExpireTimeEpoch time in seconds of the latest subscription grace expiration date
platformHuawei-Google-Apple (Check DB)
productIdThe latest subscription product identifier that the user has purchased or renewed
activeSubscriptionThe value will be set to true on any purchase/renewal event, and false on EXPIRATION
countryCountry which the user made the purchase
currencyCurrency of the purchase
autoRenewWhether auto-renew is enabled for subscriptions
renewTimeNumber of times a subscription was renewed
consumedWhether a product was consumed

💡  The OneSignal integration is available on the Grow and Super plans.

Passing OneSignal Id Using The SDK#

If Appmate users use One Signal services to receive push notifications,can set One Signal IDs via setOneSignalId method. In this way users can receive push notifications about appmate.

Request#

Parameter NameType
oneSignalIdString
import com.onesignal.OneSignal
val oneSignalUserID = OneSignal.getDeviceState()!!.userIdif (oneSignalUserID != null) {    PurchaseClient.instance.setOneSignalId(oneSignalUserID)}

How OneSignal Integration Is Created ?#

You can create OneSignal integration by defining an app id, api key and event tags.

  1. Navigate to the Integrations section on Appmate console, select OneSignal.
  2. Get your OneSignal App ID and API Key following this documentation. Fill the relative fields.
  3. Enter the event tag names that Appmate should use. Default event names are used when event names are not entered.
  4. Click save button.
onesignal create form

Integration status values:#

StatusDescription
Waiting for first eventAfter a successful integration, if event tags are not sent yet
ActiveAfter a successful integration, if there is no error
ErrorIf Onesignal API returns any other value than HTTP 200 (e.g. HTTP 400 - Bad Request)
Status firstStatus activeStatus error