cordova-plugin-android-permissions icon indicating copy to clipboard operation
cordova-plugin-android-permissions copied to clipboard

Ionic3 Android hasPermission, checkPermission always returns false

Open MyoungboKim opened this issue 7 years ago • 7 comments

Hi. I am using ionic 3.17.0 and trying to use the android-permissions plugin.

this.androidPermissions.requestPermission(this.androidPermissions.PERMISSION.READ_PHONE_STATE).then(() => {
   this.androidPermissions.hasPermission(this.androidPermissions.PERMISSION.READ_PHONE_STATE).then(data => {
   console.log("has Permission : "+JSON.stringify(data));
   });
});

I always get 'hasPermission : false' in IOS. How should I handle it? Thank you in advance.

MyoungboKim avatar Jan 18 '18 05:01 MyoungboKim

Which version of @ionic-native/android-permissions are you using now? If your @angular/core version is >= 5.0.0, please use fixed version 4.4.0 for all @ionic-native/** in your package.json. If your @angular/core version is < 5.0.0, you can use version >= 4.0.0 except 4.4.0 for all @ionic-native/** in your package.json.

Don't use version > 5.0.0 for all @ionic-native/**.

NeoLSN avatar Jan 25 '18 09:01 NeoLSN

请问,checkPermission(this.androidPermissions.PERMISSION.RECORD_VOICE)的时候返回的值是设置目录的值还是会实时反映用户的设置? 比如设置语音里面设置了禁止,提醒和允许分别返回什么值。 如果是false,我requestPermission请求权限,弹dialog以后用户选择了禁止,允许,勾选记住我的操作导致的永远禁止和允许,是否也能通过这个接口反映出来呢???

xumingyi avatar Feb 11 '18 06:02 xumingyi

  1. 如果系統沒有特別被改動,應該是user目前的設定值
  2. 不能,因為系統不允許這樣的操作

NeoLSN avatar Feb 12 '18 13:02 NeoLSN

I use angular/core version = 5.0.1, ionic-native/android-permissions version = 4.5.2

MyoungboKim avatar Feb 12 '18 23:02 MyoungboKim

请问一下,我的360 q5 plus手机 android版本6.0.1 ,check权限永远返回true, 这个是手机定制问题?卡了好久还以为自己写错了或者插件不好用呢。 测试其他手机oppo,华为,乐视, 6.0以上的手机正常

xumingyi avatar Feb 24 '18 09:02 xumingyi

I am also facing same issue, so what is the settings I need to change on device or code change to reflect true

khurana87 avatar Aug 11 '18 10:08 khurana87

you need to use "@jiguang-ionic/jpush": "1.0.2" this.jpush.getUserNotificationSettings()

xumingyi avatar Aug 13 '18 01:08 xumingyi