Hybrid App support
  • 13 May 2024
  • Dark
    Light

Hybrid App support

  • Dark
    Light

Article summary

What is Hybrid App

An Hybrid App uses both native URL requests and web views to communicate with your server. In the context of HUMAN, it's important to make sure both native requests and web views are synced together to make sure end users will get the expected behavior from your app.

How to enable Hybrid App support

To enable hybrid app support, you should enable it and set your domains in the policy for the relevant AppID. Here is an example:

policy.setDomains(arrayListOf("my-domain.com"), "<APP_ID>")
ArrayList<String> domains = new ArrayList<>();
domains.add("my-domain.com");
policy.setDomains(domains, "<APP_ID>");

In addition, you need to setup your web view with the PerimeterX/setupWebView(webView:webViewClilent:) function. The first parameter is the web view instance. The second parameter (optional) is your web view client instance. You should not set your web view client directly to the web view, but using this function instead. Here is an example:

PerimeterX.setupWebView(webView, webViewClient)
PerimeterX.INSTANCE.setupWebView(webView, webViewClient);

Was this article helpful?