NeoLSN / cordova-plugin-android-permissions

This plugin is designed for supporting Android new permissions checking mechanism.
Apache License 2.0
273 stars 178 forks source link

Ionic3 Android hasPermission, checkPermission always returns false #47

Open MyoungboKim opened 6 years ago

MyoungboKim commented 6 years ago

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.

NeoLSN commented 6 years ago

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/**.

xumingyi commented 6 years ago

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

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

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

xumingyi commented 6 years ago

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

khurana87 commented 6 years ago

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

xumingyi commented 6 years ago

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