|Singular React Native SDK|
||Singular React Native SDK version 2.0.1 (see Change Log)|
|Compatibility||React Native 0.46.4+|
Singular can collect data about in-app events to help analyze the performance of your campaigns and measure KPIs. For example, your organization may want to collect data about user logins, registrations, tutorial completions, or leveling up in a gaming app.
You can send events to Singular using the event and eventWithArgs methods.
- We highly recommend passing event names and attributes in English to guarantee compatibility with third-party partners and analytics solutions if you plan to use them.
- Event names are limited to 32 characters in ASCII. If you use non-ASCII characters, the limit is 32 bytes after the string is converted to UTF-8.
- The names and values of additional attributes are limited to 500 ASCII characters.
|Description||Report a user event to Singular, passing the name of the event.|
|Description||Report a user event to Singular, passing the name of the event and any additional information you want to add, in the form of a map/object.|
Singular can collect data about revenue gained through the app to help analyze the performance and ROI of your campaigns. Singular will make the data available to you in reports, log export, and postbacks.
When reporting revenue events to Singular, we recommend passing the purchase object as returned from Android's or iOS's In-App Purchase (IAP) process. This way, Singular gets all the details of the transaction, which enriches your Singular reports with data. In addition, Singular gets the transaction receipt from Google which can be used to validate the transaction in the context of fighting in-app fraud.
Passing the Purchase Object in React Native
This method requires using React Native's In-App Purchase package to manage transactions in your app.
|Description||Report an IAP event to Singular.|
Passing the Purchase Object Using Native Code
If you don't use a React Native In-App Purchase package, you can still send revenue events to Singular with the purchase object, but you have to use native iOS and Android code.
|Description||Report an IAP event to Singular with all the details, optionally adding a name for the event.|
To take advantage of Android's IAP functionality, first add the following to your app's build.gradle file:
|Description||Report a revenue event to Singular with the purchase object that is received from the Google Billing Library.|
|Description||Report a revenue event to Singular with a custom name for the event and with the purchase object that is received from the Google Billing Library.|
Reporting Revenue Events without the Purchase Object
While we strongly recommend reporting revenue events the way described above, you can also send revenue events to Singular just by passing the currency and transaction amount. Note that this way, Singular does not get the purchase receipt and cannot validate the transaction.
|Description||Report a revenue event to Singular with the revenue currency and amount.|
|Description||Report a revenue event to Singular with the revenue currency and amount as well as a custom name for the event.|