Skip to content

4. Constants to use on the website

Johann Buscail edited this page Sep 17, 2021 · 4 revisions

Your website has to detect the webview for analytics reasons or other ?
You need to disable analytics if user doesn't agree with App Tracking Transparency ?

A simple way to do that, is to use our constants:

  • is_webview
  • wantsPrivacy

Those constants are injected when the webview is loading. On your website, you can directly access them like any other variable:

console.log(is_webview, wantsPrivacy);

is_webview

It's always set to true if the website charges inside a webview.

Thanks to that, you can add a tag (or whatever) to your analytic system to know the user is on the app

wantsPrivacy

If the user agrees with ATT, this constant will be equal to false otherwise, it's equal to true.

With that, you can disable analytics and tracking, to respect users privacy. If you don't, Apple might not accept your app on the store

Clone this wiki locally