# Native App Embedding

If you want to integrate existing Monterosa apps into your native iOS (Swift) or Android (Kotlin) application, there are two routes:

1. [Embed using the SDK](#embed-using-the-sdk): create and manage dynamic loading on your behalf
2. [Manage your own WebViews](#manage-your-own-webviews): setup your own WebView handling&#x20;

To discover the availability of an Experience or Event within the platform, please see [Discovering Events Programmatically](https://products.monterosa.co/mic/integration-guide/discovering-events-programmatically).&#x20;

## **Embed using the SDK**

{% hint style="success" %}
To get access to the SDK please contact your account manager or raise a support ticket at <support@monterosa.co>&#x20;
{% endhint %}

[Monterosa / Interaction SDK](https://products.monterosa.co/mic/developer-guide/interaction-sdk) manages dynamic WebViews on your behalf, making integration easier and more predictable. It handles sizing, loading and communications between parent app and the app.&#x20;

Please refer to the Embedding Apps guide below for instructions:&#x20;

{% content-ref url="../developer-guide/embedding-experiences" %}
[embedding-experiences](https://products.monterosa.co/mic/developer-guide/embedding-experiences)
{% endcontent-ref %}

## **Manage your own WebViews**

If you'd prefer to create and manage the WebView' yourself, you can do so as follows:

1. Grab your [Embed URL](https://products.monterosa.co/mic/creator-guide/experiences/retrieving-event-urls#obtain-embed-url) from the Studio
2. Make sure [the Experience is on-brand](https://products.monterosa.co/mic/creator-guide/experiences/customising-your-ui), [hide the Experience's own header](https://products.monterosa.co/mic/web-page-embedding#hide-experience-header)
3. [Enable Javascript and data storage in your WebView](#enabling-javascript-and-data-storage-in-your-webview)
4. Integrate with your [SSO](https://products.monterosa.co/mic/integration-guide/integrating-identity-with-your-site-or-app), or other services
5. **Optional**: Ensure that the Experience can play inline in iOS by setting [allowsInlineMediaPlayback](https://developer.apple.com/documentation/webkit/wkwebviewconfiguration/1614793-allowsinlinemediaplayback) in the [WKWebViewConfiguration](https://developer.apple.com/documentation/webkit/wkwebviewconfiguration) instance in your [WKWebView](https://developer.apple.com/documentation/webkit/wkwebview).
6. **Optional:** Enable full screen HTML5 videos in Android by providing a custom [WebChromeClient](https://developer.android.com/reference/android/webkit/WebChromeClient) that supports it by implementing [onShowCustomView](https://developer.android.com/reference/android/webkit/WebChromeClient#onShowCustomView\(android.view.View,%20android.webkit.WebChromeClient.CustomViewCallback\)) and [onHideCustomView](https://developer.android.com/reference/android/webkit/WebChromeClient#onHideCustomView\(\)) methods.

### Enable Javascript and data storage in your WebView

Monterosa Experiences require browser DOM storage and JavaScript enabled to function correctly, so you need to ensure both are enabled in your WebView configuration.&#x20;

{% tabs %}
{% tab title="iOS" %}

1. Enable JavaScript:
   * [iOS 8 - iOS 14](https://developer.apple.com/documentation/webkit/wkpreferences/1536203-javascriptenabled)
   * [iOS 15+](https://developer.apple.com/documentation/webkit/wkwebpagepreferences/3552422-allowscontentjavascript)
2. [Enable data storage](https://developer.apple.com/documentation/webkit/wkwebviewconfiguration/1395661-websitedatastore)
   {% endtab %}

{% tab title="Android" %}

1. [Enable JavaScript](https://developer.android.com/reference/android/webkit/WebSettings#setJavaScriptEnabled\(boolean\))
2. [Enable data storage](https://developer.android.com/reference/android/webkit/WebSettings#setDomStorageEnabled\(boolean\))
   {% endtab %}
   {% endtabs %}
