Enable3
WebsiteCommunity
  • 🚀getting started
    • What is Enable3?
    • Register and Log In
    • Admin Panel (Enable3 Account)
    • Basic Setup
  • 🪄HOW IT WORKS
    • Missions
    • Quests
    • Rewards & Redeem
    • Hold to Earn
      • Hold to Earn: No Code
    • Tap to Earn
    • Referral program
    • Web3 loyalty
    • System Events
  • ⚙️TECH
    • Integration
      • SDK
      • WebView
    • Endpoints
    • Callback
  • 🔵WEB3
    • Mechanics
    • Tokenomics
Powered by GitBook
On this page
  • React Native
  • Android
  • iOS
  1. TECH
  2. Integration

WebView

Once you will receive widget URL, you can show it in your app in webview

React Native

Once you will have widget URL from this endpoint - you can use React Native WebView library for opening it in the WebView.

If a 401 error is returned in the mobile application when opening the URL in the WebView (that is, the token has expired), repeat this request to get a new URL.

import React, { Component } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { WebView } from 'react-native-webview';

// ...
const MyWebComponent = () => {
  return <WebView source={{ uri: 'https://app.enable3.io/?token=xxx' }} style={{ flex: 1 }} />;
}

Android

Once you will have widget URL from this endpoint - you can use Android WebView for opening it

import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        WebView webView = findViewById(R.id.webView);
        webView.getSettings().setJavaScriptEnabled(true);
        webView.setWebViewClient(new WebViewClient());
        webView.loadUrl("https://www.example.com");
    }
}

iOS

Documentation coming soon

Last updated 1 month ago

⚙️