I updated xamarin android and now compile app using version 7.0(Nougat). But when I deploy app on 6.0.1(marshmallow), all permissions are already set. When I turn off location permission from settings, alert displays "this app was designed for an older version of android. denying permission may cause it to no longer function as intended". Then if we deny permission and method Context.CheckSelfPermission in the app return Permission.Granted anyway.
Is this xamarin issue or something change in SelfPermission behaviour?
Application.Context.CheckSelfPermission(Manifest.Permission.AccessCoarseLocation) == Permission.Granted//returns true, even if permission is off
Application.Context.CheckSelfPermission(Manifest.Permission.AccessFineLocation) == Permission.Granted//returns true, even if permission is off
My solution was to set the target SDK to 23 in the manifest. This way, it tells the device that you have tested for this API level, therefore the AppCompat method CheckSelfPermission will work.