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

[Warning] Native: tried calling Diagnostic.requestRuntimePermissions, but the Diagnostic plugin is not installed. #78

Open
xingkoo opened this issue Mar 14, 2018 · 0 comments

Comments

@xingkoo
Copy link

xingkoo commented Mar 14, 2018

I'm submitting a ... (check one with "x")

[ ] bug report
[ ] feature request
[X ] support request

Related code:
/src/pages/ionic-native/runtime-permissions/runtime-permissions.ts

  // You can use this kind of method, which is passing a permission value..
  requestPermission(permission) {
    this.diagnostic.requestRuntimePermission(permission).then((status) => {
      if (status === this.diagnostic.permissionStatus.GRANTED) {
        alert('Permission granted!');
      } else {
        alert('Permission not granted. STATUS: ' + status);
      }
    }, error => {
      console.error('permission error:', error);
    });
  }
  // There is also a method that takes an array of permissions to ask for them at once
  requestAllPermissions() {
    const permissions = Object.keys(this.PERMISSION).map(k => this.PERMISSION[k]);
    this.diagnostic.requestRuntimePermissions(permissions).then((status) => {
      alert(JSON.stringify(status));
    }, error => {
      console.error('permission error:', error);
    });
  }

Important information:

hi,
diagnostic.requestRuntimePermissions and diagnostic.requestRuntimePermissionss only support platform android?

see https://www.npmjs.com/package/cordova.plugins.diagnostic#requestruntimepermissions

we try run this app on ios,

[Warning] Native: tried calling Diagnostic.requestRuntimePermissions, but the Diagnostic plugin is not installed. (vendor.js, line 184286)
[Warning] Install the Diagnostic plugin: 'ionic cordova plugin add cordova.plugins.diagnostic' (vendor.js, line 184286)
[Error] permission error: – "plugin_not_installed"
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

1 participant