Closed LasseWolter closed 4 months ago
Having the same issue. Pretty sure it was there in .net 7 SR3 and SR6 too.
same issue on 8.0.7 version
Verified this on VS 17.10.0 Preview 1.0(8.0.7). Repro on Android 14.0-API34, not repro on Windows, iOS 17.2 and MacCatalyst with below Project: OpenBrowserAsync.zip
Got your sample to work.
The browser class checks if something is installed that can handle http / https links. Android, since android 11, requires you declare what schemes you check, before trying to access them. Adding the following between the \<manifest> tags of AndroidManifest.xml should do the trick (It seems to be documented too)
<queries>
<intent>
<action android:name="android.intent.action.VIEW"/>
<data android:scheme="http"/>
</intent>
<intent>
<action android:name="android.intent.action.VIEW"/>
<data android:scheme="https"/>
</intent>
</queries>
@Xideta, well spotted, thanks! I'll give that a shot once I get a chance and post feedback here if it fixes it my case.
I encountered the same issue:-
Microsoft.Maui.ApplicationModel.FeatureNotSupportedException: 'Specified method is not supported.'
and confirmed that the below
<queries>
<intent>
<action android:name="android.intent.action.VIEW"/>
<data android:scheme="http"/>
</intent>
<intent>
<action android:name="android.intent.action.VIEW"/>
<data android:scheme="https"/>
</intent>
</queries>
I'm using 8.0.14.
Verified that amending the Android.Manifest as suggested above fixes the issue. As mentioned, this is also documented by Microsoft. Thanks a lot for the help.
Closing the issue.
Description
Android only (works on iOS)
IBrowser.OpenAsync(<url>, BrowserLaunchMode.External)
fails independent of the url.BrowserLaunchMode.SystemPreferred
instead ofBrowserLaunchMode.External
works without issue.Steps to Reproduce
MainPageViewModel
with the following codenamespace OpenBrowserAsync;
public class MainPageViewModel { public ICommand OpenBrowserCommand { get; }
}
On the button, remove the
Clicked
property and add aCommand
instead. Map the command to the command in your view model. Your button element should look like this:Run on Android and click the button.
App crashes.
Run on iOS, click the button and the external browser opens successfully.
Link to public reproduction project repository
https://github.com/LasseWolter/NET_MAUI_IBrowser_Open_Async_Bug_Android/tree/main
Version with bug
8.0.3
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 13 (API Level 33)
Did you find any workaround?
BrowserLaunchMode.SystemPreferred
can be used in the meantime.Relevant log output