Third Party Integrations
#
OneSignal IntegrationOneSignal 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.
Event | Description |
---|---|
appmateUserId | User ID of the app registered in Appmate |
inTrialPeriod | Whether user is in trial period |
purchaseStatus | Current status of the purchase (i.e. purchaseType) |
purchaseTime | Epoch time in seconds of the latest subscription purchase or renewal |
expireTime | Epoch time in seconds of the latest subscription expiration date |
graceExpireTime | Epoch time in seconds of the latest subscription grace expiration date |
platform | Huawei-Google-Apple (Check DB) |
productId | The latest subscription product identifier that the user has purchased or renewed |
activeSubscription | The value will be set to true on any purchase/renewal event, and false on EXPIRATION |
country | Country which the user made the purchase |
currency | Currency of the purchase |
autoRenew | Whether auto-renew is enabled for subscriptions |
renewTime | Number of times a subscription was renewed |
consumed | Whether a product was consumed |
💡 The OneSignal integration is available on the Grow and Super plans.
#
Passing OneSignal Id Using The SDKIf 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.
#
RequestParameter Name | Type |
---|---|
oneSignalId | String |
- Kotlin
- Java
import com.onesignal.OneSignal;
String oneSignalUserID = OneSignal.getDeviceState().getUserId();if (oneSignalUserID != null) { PurchaseClient.getInstance().setOneSignalId(oneSignalUserID);}
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.
- Navigate to the Integrations section on Appmate console, select OneSignal.
- Get your OneSignal App ID and API Key following this documentation. Fill the relative fields.
- Enter the event tag names that Appmate should use. Default event names are used when event names are not entered.
- Click save button.

#
Integration status values:Status | Description |
---|---|
Waiting for first event | After a successful integration, if event tags are not sent yet |
Active | After a successful integration, if there is no error |
Error | If Onesignal API returns any other value than HTTP 200 (e.g. HTTP 400 - Bad Request) |


