Using Android webviews with custom schemes fires Navigated event before Navigating
#4223 aperta il 26 ott 2018
Metriche repository
- Star
- (5644 stelle)
- Metriche merge PR
- (Nessuna PR mergiata in 30 g)
Descrizione
From @diego-varela on October 24, 2018 19:49
Xamarin Forms - Android
Steps to Reproduce
- Create a new Xamarin Forms project using a webview
- Set as source any url with a custom scheme, for instance, using plaid api, uses plaidlink: scheme
- Run and navigate to WebView
Or
- Unzip sample project App1.zip, and runs
- Check debug output for TestDebug text.
- Note date time showing first Navigated event fired, then Navigating event is displayed
Expected Behavior
Navigating event must be fired first to be able to cancel Navigation and avoid ERR_UNKNOWN_URL_SCHEME, although, navigation could be also handled by the app in order to communicate to the app the web page events. For instance, plaid allow to the app know if user has completed authorization through plaidlink scheme url info.
Actual Behavior
Navigated event is fired first, running into ERR_UNKNOWN_URL_SCHEME error.
Version Information
Xamarin Forms 3.3.0.912540
Some version information omitted to summarize.
Microsoft Visual Studio Community 2017 Version 15.8.6 VisualStudio.15.Release/15.8.6+28010.2041 Microsoft .NET Framework Version 4.7.03056
Installed Version: Community
C# Tools 2.9.0-beta8-63208-01 C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Mono Debugging for Visual Studio 4.11.11-pre (8fb558f) Support for debugging Mono processes with Visual Studio.
Visual Studio Tools for Universal Windows Apps 15.0.28010.2041 The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.
Xamarin 4.11.0.776 (d15-8@1ae9b59d7) Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.
Xamarin Designer 4.15.9 (d000f568b) Visual Studio extension to enable Xamarin Designer tools in Visual Studio.
Xamarin.Android SDK 9.0.0.19 (HEAD/a8a3b0ec7) Xamarin.Android Reference Assemblies and MSBuild support.
Log File
[2018-10-24T13:51:42.0957970-05:00] - TestDebug - Event: Navigated - Url plaidlink://event?event_name=TRANSITION_VIEW&view_name=SELECT_INSTITUTION [2018-10-24T13:51:42.2601890-05:00] - TestDebug - Event: Navigating - Url plaidlink://event?event_name=TRANSITION_VIEW&view_name=SELECT_INSTITUTION TestDebug - Event: Navigating Canceled - Url plaidlink://event?event_name=TRANSITION_VIEW&view_name=SELECT_INSTITUTION
Copied from original issue: xamarin/xamarin-android#2338