Skip to main content

Overview

The Watermelon chat widget can be embedded in any mobile app using a WebView. The steps are similar across platforms:
  1. Create a basic HTML shell.
  2. Inject the Watermelon chat widget script.
  3. Provide your widgetID and settingsID.
  4. Embed the view or present it in your app.
  5. Customize appearance in the watermelon dashboard

iOS Implementation

You can embed the Watermelon chat widget using a WKWebView. Below are minimal SwiftUI and UIKit implementations.

SwiftUI Example

Usage

UIKit example

Usage

iOS — App Transport Security

In Info.plist, allow HTTPS content (optional):

Android Implementation

Below is the minimal implementation using a standard WebView.

1. Enable WebView JavaScript

2. Add the WebView to your layout

res/layout/activity_chat_widget.xml:

3. Load the widget

Flutter Integration

Flutter apps can load the Watermelon chat widget using the built-in WebView widget.

1. Add dependency

In pubspec.yaml: dependencies: webview_flutter: ^4.7.0

2. Implement the widget