Problem description
On devices running Android 10 (specifically tested on Xiaomi Redmi Note 9 with MIUI 12), when trying to open FixedFloat from the app, the internal WebView fails to load the content and shows an error.
Test environment
- Device: Xiaomi Redmi Note 9 (M2003J15SC)
- Android: 10 (API 29)
- MIUI: 12
Observed error message
FixedFloat init: isWeb=false, isAndroid=true, isIOS=false, isDebug=true
FixedFloat: isMobilePlatform=true, willUseWebView=true
FixedFloat: WebViewController initialized successfully
FixedFloat: Page started: https://ff.io/BTCLN/BTC/?ref=setgskja
FixedFloat: Page finished: https://ff.io/BTCLN/BTC/?ref=setgskja
FixedFloat: WebResourceError: -1 - net::ERR_BLOCKED_BY_ORB
Technical analysis
The error ERR_BLOCKED_BY_ORB indicates that the website ff.io is blocking access from an embedded WebView. This is a security measure by the website to prevent fraud or automated access.
Findings
- Works on Android 14 and 15: Development team tested on Android 14 and 15 devices without issues
- Boltz works on Android 10: Another screen using WebView (
boltz.exchange) works correctly on the same device
Conclusion: The issue is specific to the combination Android 10 + ff.io, not a general WebView issue or webview_flutter library problem.
Proposed solution
We propose implementing an automatic fallback that:
- Tries to load content in the internal WebView first
- if it fails with any error, automatically opens the system's default external browser
Proposed code
onWebResourceError: (WebResourceError error) {
if (mounted) {
setState(() {
_isLoading = false;
_hasError = true;
_errorMessage = 'Error: ${error.errorCode} - ${error.description}';
});
_openInBrowser();
}
},
The _openInBrowser() method uses url_launcher:
Future<void> _launchFixedFloat() async {
final Uri url = Uri.parse(_fixedFloatUrl);
if (!await launchUrl(url, mode: LaunchMode.externalApplication)) {
throw Exception('Could not launch $url');
}
}
Advantages of this solution
- No Android version detection: Works on any Android where WebView fails
- Transparent automatic fallback: User doesn't need to do anything extra
- Consistent: Works the same if the website blocks WebView for any reason
Alternatives considered
- Detect Android version: Implement specific logic for Android 10 - Discarded because it complicates code and won't cover other cases
- Force Hybrid Composition: Attempted previously without success - Error persists at website level
- No fallback: Let user see error and decide - Worse user experience
Questions for discussion
- Is it acceptable to automatically open the external browser without asking the user?
- Should we show any visual indicator that it opened in external browser?
- Should this solution also apply to other screens using WebView (e.g., Boltz)?
Problem description
On devices running Android 10 (specifically tested on Xiaomi Redmi Note 9 with MIUI 12), when trying to open FixedFloat from the app, the internal WebView fails to load the content and shows an error.
Test environment
Observed error message
Technical analysis
The error
ERR_BLOCKED_BY_ORBindicates that the websiteff.iois blocking access from an embedded WebView. This is a security measure by the website to prevent fraud or automated access.Findings
boltz.exchange) works correctly on the same deviceConclusion: The issue is specific to the combination Android 10 + ff.io, not a general WebView issue or
webview_flutterlibrary problem.Proposed solution
We propose implementing an automatic fallback that:
Proposed code
The
_openInBrowser()method usesurl_launcher:Advantages of this solution
Alternatives considered
Questions for discussion