PXPolicy

class PXPolicy(    var urlRequestInterceptionType: PXPolicyUrlRequestInterceptionType = PXPolicyUrlRequestInterceptionType.INTERCEPT,     domains: HashMap<String, ArrayList<String>> = HashMap(),     var doctorCheckEnabled: Boolean = false)

The policy that define the behaviour of the SDK.

Constructors

Link copied to clipboard
fun PXPolicy(    urlRequestInterceptionType: PXPolicyUrlRequestInterceptionType = PXPolicyUrlRequestInterceptionType.INTERCEPT,     domains: HashMap<String, ArrayList<String>> = HashMap(),     doctorCheckEnabled: Boolean = false)

Functions

Link copied to clipboard
fun setDomains(domains: ArrayList<String>, appId: String)

Use this function to register domains which your app interact with. The SDK (when the `PXPolicy/urlRequestInterceptionType` is set to any value rather than `PXPolicyUrlRequestInterceptionType/none`) is intercepting URL requests to those domains only. If you do not set domain, the SDK will intercept all URL requests. In addition, the SDK (when `PXPolicy/hybridAppSupportEnabled` is set to true) is setting cookies in your web views in order to sync between the native and the web sessions. However, the SDK will set cookies only for domains that are set in this property. Therefore, you must set your domains to enable hybrid app support. Example: for the website www.google.com you should set the domain: google.com.

Properties

Link copied to clipboard
var doctorCheckEnabled: Boolean = false

Set this property to true to enable the Doctor App - a tool to verify the integration of the SDK in your app. Make sure to set this property to false before deploying you app to production. Default is false.

Link copied to clipboard

Decide how the SDK should handle URL requests. Default is `PXPolicyUrlRequestInterceptionType/interceptOnly`.