|Singular React Native SDK|
||Singular React Native SDK version 2.0.1|
|Compatibility||React Native 0.46.4+|
To let Singular track uninstalls for your app:
- First, configure the app in the Singular platform, as detailed in Setting Up Uninstall Tracking.
- Use your preferred method to retrieve the APNS/FCM tokens in React Native.
- Call the setUninstallToken method, passing the APNS/FCM token to as in the example below. Be sure to pass the right token based on the device platform.
|Description||Send Singular the APNS/FCM token in order to let it track app uninstalls.|
Modifying the Session Timeout
The Singular SDK manages user sessions automatically, so you don't need to add any code to handle sessions. However, you can modify the session timeout value if you want.
By default, if the app runs in the background for 60 seconds or more before returning to the foreground, the SDK registers a new session.
To change the timeout value, use .withSessionTimeoutInSec when you create the SingularConfig object. For example:
const config = new SingularConfig('<API_KEY>', '<SECRET>') .withSessionTimeoutInSec(120); // Set timeout to 120 seconds Singular.init(config);
Complying with Data Privacy Laws
Singular provides privacy-safeguarding functionality to help you cooperate with any partners who may be complying with consumer privacy laws such as GDPR and CCPA (California Consumer Privacy Act). These partners want to be notified if the end-user has consented to share their private information.
If you have implemented a way to ask users for consent to share their information, use the limitDataSharing method to notify Singular of the user's choice:
- Use Singular.limitDataSharing(false) to indicate that the user consented (opted in) to share their information.
- Use Singular.limitDataSharing(true) if the user did not consent.
Singular will pass this information on to partners who require it in order to comply with relevant regulations.
Note: The use of the method is optional, but there may be attribution information that the partner will share with Singular only if specifically notified that the user has opted in.
|Description||Notify Singular of user consent (opt-in) for sharing private data.|
The Singular SDK provides several methods to help you comply with GDPR policies and let Singular know about user consent or non-consent for tracking.
|Description||Let Singular know of user consent (opt-in) for tracking.|
Stop all tracking activities for this user on this app.
Important: This effectively disables the Singular SDK, even after you restart the app. The only way to re-enable the SDK is by calling resumeAllTracking.
|Description||Resume tracking activities for this user on this app.|
|Description||Check the tracking status for this user on this app. Returns true if tracking has been stopped.|