React Native Advanced Features

Learn more about React Native advanced features.

Advanced Features


Set Debug Level


Custom Push Notifications (Android only)

CleverTap's React Native SDK provides a built-in mechanism for receiving push notifications via FCM. However, if you have your own custom Service for managing push notifications, you can inform CleverTap about the service’s token ID whenever it is available. Following are the APIs for supported Platforms:

Registering FCM Token

CleverTap.setPushToken("<Your FCM Token>", CleverTap.FCM);

Registering Huawei Token

CleverTap.setPushToken("<Your HPS Token>", CleverTap.HPS);

Registering Baidu Token

CleverTap.setPushToken("<Your BPS Token>", CleverTap.BPS);

Create Notification


Native Display

On Display Units Loaded

CleverTap.addListener(CleverTap.CleverTapDisplayUnitsLoaded, (data) => {
        /* consume the event data */

Get All Display Units

CleverTap.getAllDisplayUnits((err, res) => {
        console.log('All Display Units: ', res, err);

Display unit viewed event for ID

CleverTap.pushDisplayUnitViewedEventForID('Display Unit Id');

Display unit clicked event for ID

CleverTap.pushDisplayUnitClickedEventForID('Display Unit Id');

Product Config


Feature Availability

A new and enhanced version of Product Experiences is coming soon. New customers (CleverTap for Enterprise or CleverTap for Startups) who have not enabled the current functionalities can use this feature only when the new version is released. However, the existing users can continue to use it. The methods for the Product Experiences feature have been deprecated and will be removed from the code by September 2024.

Set Product Configuration to default

//Add the Product Config Initialized listener
CleverTap.addListener(CleverTap.CleverTapProductConfigDidInitialize, (data) => {
          /* consume the event data */

//Set the defaults Map
        'text_color': 'red',
        'msg_count': 100,
        'price': 100.50,
        'is_shown': true,
        'json': '{"key":"val"}'

Fetching product configs

//Add the Product Config Fetched listener
CleverTap.addListener(CleverTap.CleverTapProductConfigDidFetch, (data) => {
          /* consume the event data */

//Fetch the Product Config

Activate the most recently fetched product config

//Add the Product Config Activated listener
CleverTap.addListener(CleverTap.CleverTapProductConfigDidActivate, (data) => {
          /* consume the event data */

//Activate the Product Config

Fetch And Activate product config


Fetch Minimum Time Interval


Get Boolean key


Get String Key


Get Number key


Get last fetched timestamp in millis


Feature Flag

Get Feature Flag

//Add the Feature Flag Updated listener
CleverTap.addListener(CleverTap.CleverTapFeatureFlagsDidUpdate, (data) => {
          /* consume the event data */
CleverTap.getFeatureFlag("BoolKey", false);

App Personalization

Enable Personalization


Disable Personalization



Push Install Referrer

CleverTap.pushInstallReferrer("source", "medium", "campaign");


Set Opt Out

CleverTap.setOptOut(false); ///Will opt in the user to send data to CleverTap
CleverTap.setOptOut(true); ///Will opt out the user to send data to CleverTap

Enable Device Networking Info Reporting

// Will opt out the user to send Device Network data to CleverTap
// Will opt in the user to send Device Network data to CleverTap

Set Offline

// Will set the user online
// Will set the user offline

Encryption for PII data

PII data is stored across the SDK and could be sensitive information. From CleverTap React Native SDK v1.2.0 onwards, you can enable encryption for PII data such as Email, Identity, Name, and Phone.

Currently, two levels of encryption are supported, i.e., None(0) and Medium(1). The encryption level is None by default.

  • None: All stored data is in plaintext
  • Medium: PII data is encrypted completely


The only way to set the encryption level in Android is from the manifest file. Add the encryption level in the manifest as following:

    android:value="1" />


The only way to set the encryption level in iOS is from the info.plist file. Add the CleverTapEncryptionLevel String key to info.plist file, where value 1 means Medium and 0 means None. The encryption level is set to None if any other value is provided.