Flutter (Deprecated)
Flutter is not supported for OZZOBiT Mobile WebView integrations
Flutter is no longer officially supported for OZZOBiT Mobile WebView integrations. The flutter_webview_plugin package has been deprecated and the recommended webview_flutter package has known compatibility issues with OZZOBiT's widget.
Why Flutter Support Was Deprecated
OZZOBiT's widget relies on advanced WebView features including:
- Cross-origin postMessage communication for event handling
- Complex JavaScript injection for event bridging
- Camera/microphone access for KYC document capture
- Specific cookie and session management requirements
The current Flutter WebView ecosystem does not reliably support all of these features across both iOS and Android platforms.
Recommended Alternatives
Platform Channels (Recommended)
Create native platform-specific views using Platform Views/Platform Channels. Build the OZZOBiT integration natively in Swift (iOS) and Kotlin (Android), then expose it to your Flutter app via MethodChannel.
// lib/OZZOBiT_service.dart
import 'package:flutter/services.dart';
class OZZOBiTService {
static const _channel = MethodChannel('com.yourapp/OZZOBiT');
Future<void> openOZZOBiT({
required String apiKey,
required String walletAddress,
String network = 'ethereum',
String cryptoCurrency = 'ETH',
}) async {
try {
await _channel.invokeMethod('openWidget', {
'apiKey': apiKey,
'walletAddress': walletAddress,
'network': network,
'cryptoCurrency': cryptoCurrency,
});
} on PlatformException catch (e) {
print("Error opening OZZOBiT: ${e.message}");
}
}
}
// In your main.dart or wherever you need to call it:
final OZZOBiT = OZZOBiTService();
await OZZOBiT.openOZZOBiT(
apiKey: 'YOUR_API_KEY',
walletAddress: '0x742d35Cc6634C0532925a3b844Bc9e7595f8bD21',
);// android/app/src/main/kotlin/com/yourapp/OZZOBiTPlugin.kt
package com.yourapp
import android.app.Activity
import android.content.Intent
import android.os.Bundle
import io.flutter.plugin.common.MethodChannel
import io.flutter.plugin.common.MethodChannel.MethodCallHandler
import io.flutter.plugin.common.MethodChannel.Result
class OZZOBiTPlugin(private val activity: Activity) : MethodCallHandler {
companion object {
const val CHANNEL = "com.yourapp/OZZOBiT"
}
override fun onMethodCall(call: MethodCall, result: Result) {
when (call.method) {
"openWidget" -> {
val apiKey = call.argument<String>("apiKey")!!
val walletAddress = call.argument<String>("walletAddress")!!
val network = call.argument<String>("network") ?: "ethereum"
val cryptoCurrency = call.argument<String>("cryptoCurrency") ?: "ETH"
val intent = Intent(activity, OZZOBiTActivity::class.java).apply {
putExtra("apiKey", apiKey)
putExtra("walletAddress", walletAddress)
putExtra("network", network)
putExtra("cryptoCurrency", cryptoCurrency)
}
activity.startActivity(intent)
result.success(null)
}
else -> result.notImplemented()
}
}
}URL Launcher Fallback
If a full embedded experience isn't critical, use url_launcher to open the OZZOBiT widget URL in the system browser with redirect URL handling via deep links.
// Using url_launcher as a simple fallback:
import 'package:url_launcher/url_launcher.dart';
final uri = Uri.parse(
'https://OZZOBiT.com/global?apiKey=$apiKey&walletAddress=$walletAddress'
);
if (await canLaunchUrl(uri)) {
await launchUrl(uri, mode: LaunchMode.externalApplication);
}Migration Guide
If you have an existing Flutter integration that needs to be migrated:
- Extract your OZZOBiT configuration logic into a shared service class
- Replace the WebView implementation with Platform Channel calls
- Implement native WKWebView (iOS) and WebView (Android) components
- Handle callbacks via EventChannel or MethodChannel results
- Test thoroughly on both platforms
Contact our support team through the Partner Support Hub if you need assistance with your Flutter migration strategy.