Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

Xamarin Forms - Marshmallow (6.0) handle Permissions.

$
0
0

Hello everyone,

Im having an issue with Marshmallow Permissions on Android.

When trying to ask for permission in runtime I am not able to handle the result.

First I followed these instructions to try to use the Runtime Permissions.

But I could not use this approach because for some reason I did not find the references for some functions, such as:
CheckSelfPermission() and ShouldShowRequestPermissionRationale()

Then I did some research... and found @JamesMontemagno permissions plugin

This solved my issue of not finding the functions, and I could request the permission in Marshmallow. However I could not handle the permission result.

For some reason I could not override the method public override void OnRequestPermissionsResult(int requestCode, string[] permissions, Permission[] grantResults) in my main activity or at any place.

Then through this topic I discovered that i could not override the method OnRequestPermissionsResult because my active extends FormsApplicationActivity not FormsAppCompatActivity.

I tried to change to FormsAppCompatActivity but this generated a lot of issues, especially because I do not use an AppCompat Theme.

Here is my Theme:

<resources>

    <style name="Theme.Myactionbar" parent="@android:style/Theme.Holo.Light">

My project also supports min API 10.

Is there any way to implement or override the OnRequestPermissionsResult with FormsApplicationActivity?

Please I really need help on this.

Thanks


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>