cjlotz / Xamarin.Plugins

Cross platform Xamarin Plugins
MIT License
113 stars 56 forks source link

xamarin Error by permission.CALL_PHONE (but it have CALL_PHONE) (android 10) #117

Open rioga1 opened 3 years ago

rioga1 commented 3 years ago

Error in xamarin (android version 10):

Java.Lang.SecurityException Message=Permission Denial: starting Intent { act=android.intent.action.CALL dat=tel:xxxxxxxxx flg=0x10000000 cmp=com.android.server.telecom/.components.UserCallActivity } from ProcessRecord{3f5dd3c 11571:com.companyname.pruebamoviltelefonos/u0a85} (pid=11571, uid=10085) with revoked permission android.permission.CALL_PHONE

The permission.CALL_PHONE already is true into manifest, i dont know why throw error

behroozbc commented 2 years ago

hi use this

if(await Permissions.CheckStatusAsync<Permissions.Phone>() != PermissionStatus.Granted)
            {
                var status = await Permissions.RequestAsync<Permissions.Phone>();
            }

and documentation about is https://docs.microsoft.com/en-us/xamarin/essentials/permissions?tabs=android

rioga1 commented 2 years ago

thanks!!!!