For the complete documentation index, see llms.txt. This page is also available as Markdown.

WebView

Embed the Enable3 widget directly inside your mobile app

Integration flow

  1. The user opens the Loyalty screen in your mobile app.

  2. The mobile app requests a widget URL from your backend.

  3. Your backend calls the Enable3 integration API.

  4. Enable3 returns a widget URL with an embedded authentication token.

  5. The mobile app opens this URL inside a WebView.

  6. If the WebView receives a 401 Unauthorized response, request a new widget URL and reload the WebView.

Get widget URL

Your backend should call:

GET https://integration.enable3.io/api/v1/integration/user/{operatorUserId}/widget

Headers

X-API-KEY: <operator-api-key>

Optional query parameters

Parameter

Type

Description

referralCode

string

Optional referral code provided by the operator on behalf of the user.

Example request

Example response

Important notes

  • Never expose your X-API-KEY inside a mobile application.

  • The mobile app should receive only the generated widget URL.

  • The widget URL already contains the required authentication token.

  • The widget URL is temporary and should be refreshed when expired.

  • If the WebView returns 401 Unauthorized, request a new widget URL from your backend and reload the WebView.

  • JavaScript must be enabled in the WebView.

  • Load only trusted HTTPS URLs returned by Enable3.


React Native

Use react-native-webview to open the Enable3 widget URL.

Install dependency

or

Example


Android

Use the native Android WebView to open the Enable3 widget URL.

AndroidManifest.xml

Make sure the app has internet access:

Layout example

Java example


Flutter

Use the official webview_flutter package.

Install dependency

Add the package to pubspec.yaml:

Example


iOS: Swift

Use WKWebView to open the Enable3 widget URL.

Example


iOS: Objective-C

Use WKWebView to open the Enable3 widget URL.

Implementation


Expired widget URL handling

The widget URL contains a temporary authentication token. If the token expires, the WebView may return 401 Unauthorized.

Recommended handling:

  1. Detect 401 Unauthorized in the WebView.

  2. Call your backend to request a fresh Enable3 widget URL.

  3. Reload the WebView with the new URL.

  4. Avoid infinite reload loops. If refreshing fails, show an error state with a retry button.

Security recommendations

Last updated