Sensitive data hiding

Blacklisted & Whitelisted views

Pre API 2.0

// Register sensitive view(s)
Smartlook.registerBlacklistedView(ref: ComponentOrHandle);
  
// Register whitelisted view(s)
Smartlook.registerWhitelistedView(ref: ComponentOrHandle);

// Unregister sensitive view(s)
Smartlook.unregisterBlacklistedView(ref: ComponentOrHandle);

API 2.0

There are no longer lists of "blacklisted" and "whitelisted" Views. Sensitivity is explicitly the SmartlookSensitivityView wrapper and controlled through its isSensitive prop.

import { SmartlookSensitiveView } from 'react-native-smartlook-analytics';

<SmartlookSensitiveView isSensitive={true}>
	<Text>I am a sensitive text!</Text>
</SmartlookSensitiveView>

The "mapping" of the older APIs to the 2.0 is as follows:

  • registering SmartlookSensitiveView as "blacklisted" is equivalent to setting the isSensitive prop to true.
  • registering SmartlookSensitiveView as "whitelisted" is equivalent to setting the isSensitive sensitivity to false.
  • unregistering SmartlookSensitiveView from "blacklisted" is equivalent to setting the isSensitive sensitivity to false.

SmartlookSensitiveview documentation.

Blacklisted classes

Pre API 2.0

Smartlook React Native SDK v1.x did not support manipulation of the default class sensitivity.

API 2.0

By default, the EditText and WebView classes on Android and UITextView, UITextField and WKWebView classes on iOS are set as sensitive.

The Smartlook React Native SDK provides methods to granularly control the default class sensitivity:

// Disables the default class sensitivity for both platforms.
Smartlook.instance.sensitivity.disableDefaultClassSensitivity();

// Enables the default class sensitivity for both platforms.
Smartlook.instance.sensitivity.enableDefaultClassSensitivity();

/**
* Provides a control to granularly change a specific default class sensitivity on both platforms
*
* Accepts classNameValueTuples - an array of @SmartlookAndroidClassSensitivity or @SmartlookIOSClassSensitivity class and it sensitivity boolean value tuples.
*
* Both iOS and Android specific class names can be passed at the same time.
*/
Smartlook.instance.sensitivity.changePlatformClassSensitivity([
  [SmartlookIOSClassSensitivity.UITextView, true],
  [SmartlookIOSClassSensitivity.UITextField, false],
  [SmartlookIOSClassSensitivity.WKWebView, false],
  [SmartlookAndroidClassSensitivity.EditText, false],
]);

The "mapping" of the older APIs to the 2.0 is as follows:

  • registering Class as "blacklisted" is equivalent to setting the Class sensitivity to true.
  • unregistering Class from "blacklisted" is equivalent to setting the Class sensitivity to false.

Class sensitivity documentation.

No rendering

Pre API 2.0

Smartlook.setRenderingMode(RenderingMode.NO_RENDERING);

API 2.0

Smartlook.instance.state.setRenderingMode(SmartlookRenderingMode.NoRendering);

No rendering documentation.