dpa99c / cordova-diagnostic-plugin

Cordova/Phonegap plugin to manage device settings
540 stars 361 forks source link

Plugin not installed location accuracy, diagnostic. I have no idea where i am going wrong. #342

Closed satyam41295 closed 5 years ago

satyam41295 commented 5 years ago
This app requires constant access to your location in order to spy on you

This is my config.xml for iOS.

app.component.ts

if(this.platform.is('ios')){ this.diagnostic.isLocationEnabled().then((isEnable :boolean)=>{ if(isEnable == false){ console.log(isEnable, 'location is off'); this.locationAccuracy.request(this.locationAccuracy.REQUEST_PRIORITY_HIGH_ACCURACY).then((success)=>{ console.log(success); if(success){ this.geolocation.getCurrentPosition().then((resp) =>{ resp.coords.latitude; resp.coords.longitude; // assam 26.2006° N, 92.9376° E // sikkim 27.5330° N, 88.5122° E // telangana 18.1124° N, 79.0193° E // odisha 20.9517° N, 85.0985° E this.nativeGeocoder.reverseGeocode(resp.coords.latitude,resp.coords.longitude) .then((result) =>{ var state = result[0]['administrativeArea']; console.log(state);

          if(state == 'Assam'){

            this.blockAlert();

          }else if(state == 'Sikkim'){

            this.blockAlert();

          }else if(state == 'Telangana'){

            this.blockAlert();

          }else if(state == 'Odisha'){

            this.blockAlert();

          }
        })
        .catch((error: any) => console.log(error,"merra error"));
       console.log(resp.coords.latitude,resp.coords.longitude);
      }).catch((error) => {
        console.log('Error getting location', error);
      });

      console.log('Request successful')
    }

      })
    }

  })
}

Please Help me:

I am getting this error

[Warning] Native: tried calling AppVersion.getVersionNumber, but the AppVersion plugin is not installed. (vendor.js, line 1) [Warning] Install the AppVersion plugin: 'ionic cordova plugin add cordova-plugin-app-version' (vendor.js, line 1) [Warning] Native: tried calling Diagnostic.isLocationEnabled, but the Diagnostic plugin is not installed. (vendor.js, line 1) [Warning] Install the Diagnostic plugin: 'ionic cordova plugin add cordova.plugins.diagnostic' (vendor.js, line 1) [Error] ERROR – Error: Uncaught (in promise): plugin_not_installed Error: Uncaught (in promise): plugin_not_installed (anonymous function) (vendor.js:1:57487) handleError (vendor.js:1:57499) handleError (vendor.js:1:805869) next (vendor.js:1:75714) (anonymous function) (vendor.js:1:69991) __tryOrUnsub (vendor.js:1:267232) next (vendor.js:1:266518) _next (vendor.js:1:265565) next (vendor.js:1:265237) next (vendor.js:1:295099) emit (vendor.js:1:69765) run (polyfills.js:3:10150) onHandleError (vendor.js:1:71626) runGuarded (polyfills.js:3:10410) (anonymous function) (polyfills.js:3:21024) microtaskDrainDone (polyfills.js:3:21061) o (polyfills.js:3:8009) promiseReactionJob [Error] ERROR – Error: Uncaught (in promise): plugin_not_installed Error: Uncaught (in promise): plugin_not_installed (anonymous function) (vendor.js:1:57487) handleError (vendor.js:1:57499) handleError (vendor.js:1:805869) next (vendor.js:1:75714) (anonymous function) (vendor.js:1:69991) __tryOrUnsub (vendor.js:1:267232) next (vendor.js:1:266518) _next (vendor.js:1:265565) next (vendor.js:1:265237) next (vendor.js:1:295099) emit (vendor.js:1:69765) run (polyfills.js:3:10150) onHandleError (vendor.js:1:71626) runGuarded (polyfills.js:3:10410) (anonymous function) (polyfills.js:3:21024) microtaskDrainDone (polyfills.js:3:21061) o (polyfills.js:3:8009) promiseReactionJob

satyam41295 commented 5 years ago

@dpa99c Please help me m stuck here since two days. Thanks in advance.

dpa99c commented 5 years ago

[Warning] Native: tried calling AppVersion.getVersionNumber, but the AppVersion plugin is not installed. (vendor.js, line 1) [Warning] Install the AppVersion plugin: 'ionic cordova plugin add cordova-plugin-app-version' (vendor.js, line 1) [Warning] Native: tried calling Diagnostic.isLocationEnabled, but the Diagnostic plugin is not installed. (vendor.js, line 1) [Warning] Install the Diagnostic plugin: 'ionic cordova plugin add cordova.plugins.diagnostic' (vendor.js, line 1) [Error] ERROR – Error: Uncaught (in promise): plugin_not_installed Error: Uncaught (in promise): plugin_not_installed

These are Ionic errors which indicate Ionic could not find the Cordova plugin installed in the project. Did you run the ionic cordova plugin add commands as instructed? Are the plugins present in the project plugins/ directory?

satyam41295 commented 5 years ago

See here are my plugins list. for my project

Herat:Game11-APP devloper$ ionic cordova plugin list

cordova plugin ls com-darryncampbell-cordova-plugin-intent 1.1.5 "Intent Shim" cordova-plugin-add-swift-support 1.7.2 "AddSwiftSupport" cordova-plugin-advanced-http 2.0.6 "Advanced HTTP plugin" cordova-plugin-android-permissions 1.0.0 "Permissions" cordova-plugin-app-version 0.1.9 "AppVersion" cordova-plugin-appavailability 0.4.2 "AppAvailability" cordova-plugin-appsflyer-sdk 4.4.15 "AppsFlyer" cordova-plugin-camera 4.0.3 "Camera" cordova-plugin-crop 0.3.1 "CropPlugin" cordova-plugin-device 2.0.2 "Device" cordova-plugin-facebook4 3.2.0 "Facebook Connect" cordova-plugin-file 6.0.1 "File" cordova-plugin-file-transfer 1.7.1 "File Transfer" cordova-plugin-geolocation 4.0.1 "Geolocation" cordova-plugin-googleplus 5.3.2 "Google SignIn" cordova-plugin-inappbrowser 3.0.0 "InAppBrowser" cordova-plugin-ionic-keyboard 2.1.3 "cordova-plugin-ionic-keyboard" cordova-plugin-ionic-webview 1.2.1 "cordova-plugin-ionic-webview" cordova-plugin-nativegeocoder 3.2.1 "NativeGeocoder" cordova-plugin-nativestorage 2.3.2 "NativeStorage" cordova-plugin-network-information 2.0.1 "Network Information" cordova-plugin-networkinterface 2.0.0 "NetworkInterface" cordova-plugin-request-location-accuracy 2.2.3 "Request Location Accuracy" cordova-plugin-splashscreen 5.0.2 "Splashscreen" cordova-plugin-telerik-imagepicker 2.2.4 "ImagePicker" cordova-plugin-whitelist 1.3.3 "Whitelist" cordova-plugin-x-socialsharing 5.4.4 "SocialSharing" cordova-sqlite-storage 2.6.0 "Cordova sqlite storage plugin" cordova.plugins.diagnostic 3.9.2 "Diagnostic" es6-promise-plugin 4.2.2 "Promise" phonegap-plugin-mobile-accessibility 1.0.5-dev "Mobile Accessibility"

satyam41295 commented 5 years ago

Where you can see diagnostic, location accuracy and geolocation all plugins are integrated.

and in console.

it detects with

cordova.plugins.diagnostic < {permissionStatus: Object, locationAuthorizationMode: {ALWAYS: "always", WHEN_IN_USE: "when_in_use"}, bluetoothState: Object, motionStatus: Object, cpuArchitecture: Object, …}

satyam41295 commented 5 years ago

@dpa99c

dpa99c commented 5 years ago

That shows plugin is present in the Cordova project so the problem is somewhere in the Ionic layer. Therefore you should open the issue with Ionic Native.