Problem with Diagnostic (ionic-native)


#1

I’m trying to use Diagnostic functions, such as

Diagnostic.isLocationAvailable()

And always get the same error “plugin_not_installed”.

I don’t understand why this is happening, I alredy have added cordova.plugins.diagnostic and tried to run in different devices and android api’s.

Does anybody know what may be the problem? :confused:
I’m using Ionic rc.0 version


#2

I have the same problem! Any idea what to do?


#3

Still not found the solution :sweat:


#4

I just solved the problem.

In my case, I was calling Diagnostic.isLocationAvailable() in component constructor…
but it’s possible that not deviceReady().

With:

import { Platform } from 'ionic-angular'
constructor(public platform: Platform) {
   platform.ready().then(() => {
        Diagnostic.isLocationAvailable().then( isAvailable => {
               alert("Location available: " + isAvailable);
        });
  });
}