Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ionic3 Android hasPermission, checkPermission always returns false #47

Open
MyoungboKim opened this issue Jan 18, 2018 · 7 comments
Open

Comments

@MyoungboKim
Copy link

MyoungboKim commented Jan 18, 2018

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
Copy link
Owner

NeoLSN commented Jan 25, 2018

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
Copy link

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

@NeoLSN
Copy link
Owner

NeoLSN commented Feb 12, 2018

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

@MyoungboKim
Copy link
Author

MyoungboKim commented Feb 12, 2018

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

@xumingyi
Copy link

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

@khurana87
Copy link

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

@xumingyi
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants