OneDrive / onedrive-sdk-dotnet-msa-auth-adapter

Other
25 stars 22 forks source link

Added Xamarin.Android implementation #28

Closed torbenpedersen closed 7 years ago

torbenpedersen commented 7 years ago

Authentication support for Xamarin Android

cdmayer commented 7 years ago

@msftclas Do you need to approve this?

torbenpedersen commented 7 years ago

Thanks for the feedback, updated syntax and added unit tests.

daboxu commented 7 years ago

@torbenpedersen hi Torben thanks for the update! I just pulled your code and try to build it locally, and I got error:

1>onedrive-sdk-dotnet-msa-auth-adapter\src\OneDrive.Sdk.Authentication.Xamarin.Android\Activity\AndroidWebAuthenticationActivity.cs(111,34,111,58): error CS0115: 'AndroidWebAuthenticationActivity.Client.ShouldOverrideUrlLoading(WebView, IWebResourceRequest)': no suitable method found to override

It seems like the interface public virtual bool ShouldOverrideUrlLoading(Android.Webkit.WebView view, string url) in Android.Webkit.WebViewClient requires the second param as a string for me.

I am n00bto Xamarin, have I gotten the outdated Xamarin SDK for Android?

torbenpedersen commented 7 years ago

@daboxu thanks Dabo for reviewing. Good question, the overload being used was introduced in Android Nougat (v7.0). You can see what platform the project is targeting in the Application tab under the Project Properties. It should default to 'Use Latest Platform' but it requires 7.0 to be installed to compile. Take a look at this Xamarin page for how to upgrade the Android SDK to 7.0.