Code Monkey home page Code Monkey logo

cordova-plugin-request-location-accuracy's Introduction

Cordova Request Location Accuracy Plugin Latest Stable Version Total Downloads

Table of Contents

Overview

This Cordova/Phonegap plugin for Android and iOS to request enabling/changing of Location Services by triggering a native dialog from within the app, avoiding the need for the user to leave your app to change location settings manually.

donate

I dedicate a considerable amount of my free time to developing and maintaining this Cordova plugin, along with my other Open Source software. To help ensure this plugin is kept updated, new features are added and bugfixes are implemented quickly, please donate a couple of dollars (or a little more if you can stretch) as this will help me to afford to dedicate time to its maintenance. Please consider donating if you're using this plugin in an app that makes you money, if you're being paid to make the app, if you're asking for new features or priority bug fixes.

Why is this plugin not just part of cordova-diagnostic-plugin?

Because:

  • you may not wish to use the location features of the diagnostic plugin and therefore may not require it
  • you may not wish to use the features of this plugin
    • on Android, the dependency on the Google Play Services library increases the size of the app APK by about 2Mb

However, since this plugin requires runtime authorization to use location to be granted by the user, you may want to use the diagnostic plugin to check for/request location permission.

Android overview

Example Android app screencapture

On Android, this plugin allows an app to request a specific accuracy for Location Services. If the requested accuracy is higher than the current Location Mode setting of the device, the user is asked to confirm the change with a Yes/No dialog.

For example, if a navigation app that requires GPS, the plugin is able to switch on Location Services or change the Location Mode from low accuracy to high accuracy, without the user needing to leave the app to do this manually on the Location Settings page.

It uses the Google Play Services Location API (v7+) to change the device location settings. In case the user doesn't have an up-to-date version of Google Play Services or there's some other problem accessing it, you may want to use another of my plugins, cordova.plugins.diagnostic as a fallback. This is able to switch the user directly to the Location Settings page where they can manually change the Location Mode.

Android Play Services library dependency

This plugin depends on the Google Play Services library so you must install the "Google Repository" package under the "Extras" section in Android SDK Manager. SDK Manager

Play Services version

  • IMPORTANT: This plugin is not directly responsible for, nor cannot it resolve, Android build errors which occur due to version conflicts in Gradle dependencies.

    • If you encounter Android build errors, please read the section below in detail to understand Gradle version dependencies in relation to this plugin.
    • Also see the Android Library Versions guide.
    • Any issues which are opened which relate to build errors caused by Gradle version conflicts will be closed immediately with a reference given to the following section.
  • This plugin depends on the play-services-location component of the Google Play Services library, which is satisfied via Gradle during the Android build process.

  • By default, this plugin references the most recently released major version of the play-services-location component (currently v16 - see the Android Library Release Notes for most recent minor/patch version).

  • Android build errors can occur if different versions of the same library or component are specified as Gradle dependencies in the same Android project.

  • You may encounter build errors if your Cordova project includes:

    • other plugins which specify a different major version of the Play Services library
      • In this case you may need to specify a custom version of the play-services-location component which is referenced by this plugin.
      • You can do this using the PLAY_SERVICES_LOCATION_VERSION plugin variable at plugin installation - see the installation section for an example.
      • You can find what other versions of the Play Services library are being referenced by looking at the build.gradle files in the platforms/android/ directory of your Cordova project.
        • Look for entries that contain com.google.android.gms, for example implementation "com.google.android.gms:play-services-location:15.+"
    • other plugins which reference the Play Services library but do not allow you to specify a custom version (i.e the version is hard-coded) .
    • other plugins which reference the Firebase library (or Google Services plugin), such as:
    • This is because the major versions of the Play Services and Firebase libraries need to align.
    • You can use cordova-android-firebase-gradle-release to override the Firebase library versions specified by other plugins to align with the Play Services library version.
      • See #50 for an example of this.

iOS overview

Example iOS app screencapture

If Location Services is turned OFF on an iOS device, no app on the device can access the location.

It is not programmatically possible to switch Location Services ON or to directly open the Location Services page in the Settings app.

The best that can be done by direct programmatic invocation of the Settings app is to open the app's own permissions page - the switchToSettings() of cordova-diagnostic-plugin enables you to do this. However, the user must still manually navigate from the app permissions page in the Settings app to the Location Services setting on the Privacy page.

If Location Services is turned OFF, this plugin enables an app to display a native iOS system dialog which gives user the option of directly opening the Privacy page in the Settings app which contains the switch to turn Location Services ON.

In order to show the native dialog allowing direct opening of the Privacy page, a location must be requested via the native location manager. So why can't you just use cordova-plugin-geolocation to request the location? Because when Location Services is OFF, the app reports that use of location is unauthorized, and cordova-plugin-geolocation will not request a location if it determines location is unauthorized: see this Cordova issue.

iOS "Cancel" button caveat

As highlighted by issue #16, there is one scenario in which the iOS implementation of this plugin fails: if, upon successfully showing the native dialog, the user presses "Cancel" instead of "Settings", any subsequent requests via this plugin will not show the dialog again. Ever! This is because iOS assumes that if the user pressed "Cancel", they don't want your app to use their location, so iOS prevents you from asking them again to switch on Location Services.

There's no way to tell which button the user pressed in the native dialog or whether "Cancel" was pressed and the dialog is not being shown. Consequently, if the user has pressed "Cancel" in the native dialog, any subsequent calls to the plugin will still result in the success callback being invoked, since (as far as the plugin is concerned), it successfully requested a location from the native location manager.

The best approach to workaround this is to recheck the state of Location Services using canRequest() on each resume event. If the user has pressed "Settings", your app will be put in the background while the Settings app is brought into the foreground, so when the user returns to your app, it will resume from the background.

Example project

An example project illustrating use of this plugin can be found here: https://github.com/dpa99c/cordova-plugin-request-location-accuracy-example

Installation

Using the Cordova/Phonegap CLI

# Install with default Play Services Location library version
$ cordova plugin add cordova-plugin-request-location-accuracy

# Install with custom Play Services Location library version
$ cordova plugin add cordova-plugin-request-location-accuracy --variable PLAY_SERVICES_LOCATION_VERSION=15.0.0

PhoneGap Build

Add the following xml to your config.xml to use the latest version of this plugin from npm:

<plugin name="cordova-plugin-request-location-accuracy" source="npm" />

Usage

The plugin is exposed via the cordova.plugins.locationAccuracy object.

Android & iOS

request()

This is the main plugin method.

Android

Requests a specific accuracy for Location Services.

cordova.plugins.locationAccuracy.request(successCallback, errorCallback, accuracy)

Parameters:

  • {Function} successCallback - callback to be invoked on successful resolution of the requested accuracy. A single object argument will be passed which has two keys: "code" in an integer corresponding to a SUCCESS constant and indicates the reason for success; "message" is a string containing a description of the success.
  • {Function} errorCallback - callback to be invoked on failure to resolve the requested accuracy. A single object argument will be passed which has two keys: "code" in an integer corresponding to an ERROR constant and indicates the reason for failure; "message" is a string containing a description of the error.
  • {Integer} accuracy - The location accuracy to request defined by an integer corresponding to a REQUEST constant.

Example usage:

cordova.plugins.locationAccuracy.canRequest(function(canRequest){
    if(canRequest){
        cordova.plugins.locationAccuracy.request(function (success){
            console.log("Successfully requested accuracy: "+success.message);
        }, function (error){
           console.error("Accuracy request failed: error code="+error.code+"; error message="+error.message);
           if(error.code !== cordova.plugins.locationAccuracy.ERROR_USER_DISAGREED){
               if(window.confirm("Failed to automatically set Location Mode to 'High Accuracy'. Would you like to switch to the Location Settings page and do this manually?")){
                   cordova.plugins.diagnostic.switchToLocationSettings();
               }
           }
        }, cordova.plugins.locationAccuracy.REQUEST_PRIORITY_HIGH_ACCURACY);
    }else{
        // request location permission and try again
    }
});

iOS

If Location Services is OFF, invokes the native dialog to directly open the Location Services page in the Settings app.

cordova.plugins.locationAccuracy.request(successCallback, errorCallback)

Parameters:

  • {Function} successCallback - callback to be invoked on successful request to invoke the dialog.
  • {Function} errorCallback - callback to be invoked on failure to request a location and invoked the dialog.

Example usage:

cordova.plugins.locationAccuracy.canRequest(function(canRequest){
    if(canRequest){
        cordova.plugins.locationAccuracy.request(function(){
            console.log("Successfully made request to invoke native Location Services dialog");
        }, function(){
            console.error("Failed to invoke native Location Services dialog");
        });
    }else{
        // request location permission and try again
    }
});

isRequesting()

Indicates if a request is currently in progress.

cordova.plugins.locationAccuracy.isRequesting(successCallback);

Parameters:

  • {Function} successCallback - callback to pass result to. This is passed a boolean argument indicating if a request is currently in progress.

Example usage:

 cordova.plugins.locationAccuracy.isRequesting(function(requesting){
    console.log("A request " + (requesting ? "is" : "is not") + " currently in progress");
 });

canRequest()

Indicates if a request is possible to invoke a request. On iOS, this will return true if Location Services is currently OFF and request is not currently in progress. On Android, this will return true if the app has authorization to use location.

cordova.plugins.locationAccuracy.canRequest(successCallback);

Parameters:

  • {Function} successCallback - callback to pass result to. This is passed a boolean argument indicating if a request can be made.

Example usage:

cordova.plugins.locationAccuracy.canRequest(function(canRequest){
    console.log("A request " + (canRequest ? "can" : "cannot") + " currently be made");
});

Android-only

Request constants

The location accuracy which is to be requested is defined as a set of REQUEST constants on the cordova.plugins.locationAccuracy object:

  • cordova.plugins.locationAccuracy.REQUEST_PRIORITY_NO_POWER: Request location mode priority "no power": the best accuracy possible with zero additional power consumption.
  • cordova.plugins.locationAccuracy.REQUEST_PRIORITY_LOW_POWER: Request location mode priority "low power": "city" level accuracy (about 10km accuracy).
  • cordova.plugins.locationAccuracy.REQUEST_PRIORITY_BALANCED_POWER_ACCURACY: Request location mode priority "balanced power": "block" level accuracy (about 100 meter accuracy).
  • cordova.plugins.locationAccuracy.REQUEST_PRIORITY_HIGH_ACCURACY: Request location mode priority "high accuracy": the most accurate locations available. This will use GPS hardware to retrieve positions.

See https://developers.google.com/android/reference/com/google/android/gms/location/LocationRequest#constants

Callback constants

Both the successCallback() and errorCallback() functions will be passed an object which contains both a descriptive message and a code indicating the result of the operation. These constants are defined on the cordova.plugins.locationAccuracy object.

Success constants

The successCallback() function will be pass an object where the "code" key may correspond to the following values:

  • cordova.plugins.locationAccuracy.SUCCESS_SETTINGS_SATISFIED: Success due to current location settings already satisfying requested accuracy.
  • cordova.plugins.locationAccuracy.SUCCESS_USER_AGREED: Success due to user agreeing to requested accuracy change

Error constants

The errorCallback() function will be pass an object where the "code" key may correspond to the following values:

  • cordova.plugins.locationAccuracy.ERROR_ALREADY_REQUESTING: Error due an unresolved request already being in progress.
  • cordova.plugins.locationAccuracy.ERROR_INVALID_ACTION: Error due invalid action requested.
  • cordova.plugins.locationAccuracy.ERROR_INVALID_ACCURACY: Error due invalid accuracy requested.
  • cordova.plugins.locationAccuracy.ERROR_EXCEPTION: Error due to exception in the native code.
  • cordova.plugins.locationAccuracy.ERROR_CANNOT_CHANGE_ACCURACY: Error due to not being able to change location accuracy to requested state.
  • cordova.plugins.locationAccuracy.ERROR_USER_DISAGREED: Error due to user rejecting requested accuracy change.
  • cordova.plugins.locationAccuracy.ERROR_GOOGLE_API_CONNECTION_FAILED: Error due to failure to connect to Google Play Services API. The "message" key will contain a detailed description of the Google Play Services error.

Full Android & iOS example

The following example illustrates how to use the plugin cross-platform on both Android & iOS, and also how to use cordova-diagnostic-plugin to request runtime permission to use location if necessary.

var platform;
function onDeviceReady(){
    platform = cordova.platformId;
}


function onError(error) {
    console.error("The following error occurred: " + error);
}

function handleLocationAuthorizationStatus(status) {
    switch (status) {
        case cordova.plugins.diagnostic.permissionStatus.GRANTED:
            if(platform === "ios"){
                onError("Location services is already switched ON");
            }else{
                _makeRequest();
            }
            break;
        case cordova.plugins.diagnostic.permissionStatus.NOT_REQUESTED:
            requestLocationAuthorization();
            break;
        case cordova.plugins.diagnostic.permissionStatus.DENIED:
            if(platform === "android"){
                onError("User denied permission to use location");
            }else{
                _makeRequest();
            }
            break;
        case cordova.plugins.diagnostic.permissionStatus.DENIED_ALWAYS:
            // Android only
            onError("User denied permission to use location");
            break;
        case cordova.plugins.diagnostic.permissionStatus.GRANTED_WHEN_IN_USE:
            // iOS only
            onError("Location services is already switched ON");
            break;
    }
}

function requestLocationAuthorization() {
    cordova.plugins.diagnostic.requestLocationAuthorization(handleLocationAuthorizationStatus, onError);
}

function requestLocationAccuracy() {
    cordova.plugins.diagnostic.getLocationAuthorizationStatus(handleLocationAuthorizationStatus, onError);
}

function _makeRequest(){
    cordova.plugins.locationAccuracy.canRequest(function(canRequest){
        if (canRequest) {
            cordova.plugins.locationAccuracy.request(function () {
                    handleSuccess("Location accuracy request successful");
                }, function (error) {
                    onError("Error requesting location accuracy: " + JSON.stringify(error));
                    if (error) {
                        // Android only
                        onError("error code=" + error.code + "; error message=" + error.message);
                        if (platform === "android" && error.code !== cordova.plugins.locationAccuracy.ERROR_USER_DISAGREED) {
                            if (window.confirm("Failed to automatically set Location Mode to 'High Accuracy'. Would you like to switch to the Location Settings page and do this manually?")) {
                                cordova.plugins.diagnostic.switchToLocationSettings();
                            }
                        }
                    }
                }, cordova.plugins.locationAccuracy.REQUEST_PRIORITY_HIGH_ACCURACY // iOS will ignore this
            );
        } else {
            // On iOS, this will occur if Location Services is currently on OR a request is currently in progress.
            // On Android, this will occur if the app doesn't have authorization to use location.
            onError("Cannot request location accuracy");
        }
    });
}

// Make the request
requestLocationAccuracy();

License

The MIT License

Copyright (c) 2016 Dave Alden (Working Edge Ltd.)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

cordova-plugin-request-location-accuracy's People

Contributors

dpa99c avatar piotr-cz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cordova-plugin-request-location-accuracy's Issues

Build failed...

If I install cordova-plugin-fcm additionally, build err occur. Following is my err
Execution failed for task ':app:processDebugGoogleServices'.

Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 9.0.0.

it doesn't work on iOS 10.1.1

Hi,
I'm using ios 10.1.1 and even if I call request() direct and go to successCallback, no location services will be opened on my iphone.

Thanks for any help :)

Build fails after adding this plugin

I added this plugin using following command:
cordova plugin add cordova-plugin-request-location-accuracy

This is the error that I got when I tried building the app for android platform, after adding the plugin

Running command: "C:\Program Files\nodejs\node.exe" c:\Apache24\htdocs\loc\hooks\after_prepare\010_add_platform_class.js c:\Apache24\htdocs\loc
add to body class: platform-android
ANDROID_HOME=C:\Users\shiri$h\AppData\Local\Android\android-sdk
JAVA_HOME=C:\Program Files\java\jdk1.8.0_45
No target specified, deploying to device '4810d66c'.

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring root project 'android'.
    Could not resolve all dependencies for configuration ':_debugCompile'.
    Could not find any version that matches com.google.android.gms:play-services-location:+.
    Searched in the following locations:
    https://repo1.maven.org/maven2/com/google/android/gms/play-services-location/maven-metadata.xml
    https://repo1.maven.org/maven2/com/google/android/gms/play-services-location/
    file:/C:/Users/shiri$h/AppData/Local/Android/android-sdk/extras/android/m2repository/com/google/android/gms/play-services-location/maven-metadata.xml
    file:/C:/Users/shiri$h/AppData/Local/Android/android-sdk/extras/android/m2repository/com/google/android/gms/play-services-location/
    Required by:
    :android:unspecified
  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 32.634 secs
ERROR running one or more of the platforms: Error code 1 for command: cmd with args: /s,/c,"c:\Apache24\htdocs\loc\platforms\android\gradlew cdvBuildDebug -b c:\Apache24\htdocs\loc\platforms
\android\build.gradle -PcdvBuildArch=arm -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"
You may not have the required environment or OS to run this project

I am using ionic-framework. When I do ionic serve, the project runs on the browser without any problems. I did some searching on google and found that many other people also had same issues but could not find any solution.

Request only two options for permissions instead of 3 (see description)

So this may be in the switchToSettings() ballpark, but on iOS, some apps give you the option of either completely denying location or having it on all the time - that's it.

Using this plugin with the switchToSettings, there's a third option, sorry if I am not getting the terminology right (I don't have the iphone in front of me), but it appears in the middle an is essentially "only when the app is running".

An example of an app that gives only two options is I believe facebook. Is there a way to get this to only give those 2 options instead of the current 3? Thanks!

Plugin is not working with Phonegap Build for android

I tried to build my simple app using this plugin from https://build.phonegap.com
But build was failed for android with following error:
http://prntscr.com/a28aty

Following is Log

`Build Date: 2016-02-12 09:57:20 +0000

PLUGIN OUTPUT

Installing "[email protected]" for android
Installing "[email protected]" for android
Installing "[email protected]" for android
Installing "[email protected]" for android
Installing "[email protected]" for android
Installing "[email protected]" for android
Installing "[email protected]" for android
Installing "[email protected]" for android
Installing "[email protected]" for android
Installing "[email protected]" for android
Installing "[email protected]" for android
Installing "[email protected]" for android
Installing "[email protected]" for android
Installing "[email protected]" for android
Installing "[email protected]" for android
Installing "[email protected]" for android
Installing "[email protected]" for android
Installing "[email protected]" for android
Fetching plugin "cordova-plugin-request-location-accuracy" via npm
Installing "[email protected]" for android
Fetching plugin "cordova-plugin-flashlight" via npm

Installing "[email protected]" for android

COMPILE OUTPUT

/project/cordova/node_modules/q/q.js:126
throw e;
^

Error: Project contains at least one plugin that requires a system library. This is not supported with ANT. Please build using gradle.
at /project/cordova/lib/build.js:183:27
at _fulfilled (/project/cordova/node_modules/q/q.js:798:54)
at self.promiseDispatch.done (/project/cordova/node_modules/q/q.js:827:30)
at Promise.promise.promiseDispatch (/project/cordova/node_modules/q/q.js:760:13)
at /project/cordova/node_modules/q/q.js:574:44
at flush (/project/cordova/node_modules/q/q.js:108:17)
at doNTCallback0 (node.js:417:9)
at process._tickCallback (node.js:346:13)`

Location Accuracy Plugin , Nothing happens when I fire the function

I built the following app and installed it on my phone, no errors anywhere..
but when I click on the button in Contacts Page, nothing happens, neither of the alerts are showing
Please Advice.
Contacts.html
`


Contact


Follow us on Twitter @Ionicframework
<button ion-button (click)="enableLocation()" >Check Location Accuracy</button>
`

Contacts.ts
`
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { LocationAccuracy } from '@ionic-native/location-accuracy';
import { AlertController } from 'ionic-angular/components/alert/alert-controller';

@component({
selector: 'page-contact',
templateUrl: 'contact.html'
})
export class ContactPage {

constructor(public navCtrl: NavController,
private locationAccuracy: LocationAccuracy,
private alertCtrl: AlertController) {

}

enableLocation() {
this.locationAccuracy.canRequest().then((canRequest: boolean) => {

  if (canRequest) {
    let alert = this.alertCtrl.create({
      title: String(canRequest)
    })
    alert.present();
    // the accuracy option will be ignored by iOS
    this.locationAccuracy.request(this.locationAccuracy.REQUEST_PRIORITY_HIGH_ACCURACY).then(
      () => {
        let alert = this.alertCtrl.create({
          title: 'Request successful'
        })
        alert.present();
      },
      error => {
        let alert = this.alertCtrl.create({
          title: 'Error requesting location permissions' + JSON.stringify(error)
      })
    alert.present();
  }
    );

}

});
}
}
`

Error when calling location Accuracy request

I get this error recently when calling locationAccuracy.request

2, Value null at 0 of type org.json.JSONObject$1 cannot be converted to int

2 is the error code, I couldn't find any solution on the web

Any idea?

Conflict building with Firebase

When building this with the firebase plugin, which requires google-services 9.0.0, I get the following error.

Found com.google.android.gms:play-services-location:+, but version 9.0.0 is needed for the google-services plugin.
:processDebugGoogleServices FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processDebugGoogleServices'.
> Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 9.0.0.

This is related to: https://github.com/intercom/intercom-cordova/issues/58

I am forking with a change to specify the exact play services version, but would be thrilled to have a better solution, as would many other developers.

Question - Proper flow to get location

If I am not wrong, 'Permission Allow / Deny dialog box' will appear only when native geolocation gets called. So what will be the proper flow to get location. Requirement is that It should first show the dialog box for Allow / Deny of Location permission. Then, It should wait for user's action. On Deny - Some alert will appear. On Accept, it will check if location is on / off. If off - It will show the dialog box of location accuracy. If on - it should calculate the lat, lng.

What structure should I use to get the result as above?

cordova.plugins.locationAccuracy.request always error on android 4.4

Hi,

When I test my app on Android 4.4 (nexus 5), cordova.plugins.locationAccuracy.request always trigger catch error.
My device have the last play store's version available on Android 4.4.
In config.xml I added .
Is there something specific to add to make it works on Android 4.4 ?

My config :
Cordova CLI: 7.0.1
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
OS: macOS Sierra
Node Version: v6.10.0
Xcode version: Xcode 8.3.3 Build version 8E3004b

Get promise of the result of activating geolocation

if (ionic.Platform.isIOS()) {
cordova.plugins.diagnostic.switchToSettings();
} else {
cordova.plugins.diagnostic.switchToLocationSettings();
}
I can open the native device configuration to mark the geolocation. but I do not know how to do it when the user turns on the geolocation, it simply executes that code but does not get an answer from that. I would like (if possible) to know if the user turned on the geolocation or not.

how can I do it?

Cant Add Plugin

cordova plugin add cordova-plugin-diagnostic

Fetching plugin "cordova-plugin-diagnostic" via plugin registry
Error: 404 Not Found: cordova-plugin-diagnostic
    at RegClient.<anonymous> (C:\Users\Trijit\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\npm\node_modules\npm-registry-client\lib\request.js:268:14)
    at Request.self.callback (C:\Users\Trijit\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\npm\node_modules\request\index.js:148:22)
    at emitTwo (events.js:87:13)
    at Request.emit (events.js:172:7)
    at Request.<anonymous> (C:\Users\Trijit\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\npm\node_modules\request\index.js:876:14)
    at emitOne (events.js:82:20)
    at Request.emit (events.js:169:7)
    at IncomingMessage.<anonymous> (C:\Users\Trijit\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\npm\node_modules\request\index.js:827:12)
    at emitNone (events.js:72:20)
    at IncomingMessage.emit (events.js:166:7)

I am getting this error: ReferenceError: onError is not defined

I am copy and paste this original code:

function onError(error) {
console.error("The following error occurred: " + error);
}

function handleLocationAuthorizationStatus(cb, status) {
switch (status) {
case cordova.plugins.diagnostic.permissionStatus.GRANTED:
cb(true);
break;
case cordova.plugins.diagnostic.permissionStatus.NOT_REQUESTED:
requestLocationAuthorization(cb);
break;
case cordova.plugins.diagnostic.permissionStatus.DENIED:
cb(false);
break;
case cordova.plugins.diagnostic.permissionStatus.DENIED_ALWAYS:
// Android only
cb(false);
break;
case cordova.plugins.diagnostic.permissionStatus.GRANTED_WHEN_IN_USE:
// iOS only
cb(true);
break;
}
}

function requestLocationAuthorization(cb) {
cordova.plugins.diagnostic.requestLocationAuthorization(handleLocationAuthorizationStatus.bind(this, cb), onError);
}

function ensureLocationAuthorization(cb) {
cordova.plugins.diagnostic.getLocationAuthorizationStatus(handleLocationAuthorizationStatus.bind(this, cb), onError);
}

function requestLocationAccuracy(){
ensureLocationAuthorization(function(isAuthorized){
if(isAuthorized){
cordova.plugins.locationAccuracy.canRequest(function(canRequest){
if (canRequest) {
cordova.plugins.locationAccuracy.request(function () {
console.log("Request successful");
}, function (error) {
onError("Error requesting location accuracy: " + JSON.stringify(error));
if (error) {
// Android only
onError("error code=" + error.code + "; error message=" + error.message);
if (error.code !== cordova.plugins.locationAccuracy.ERROR_USER_DISAGREED) {
if (window.confirm("Failed to automatically set Location Mode to 'High Accuracy'. Would you like to switch to the Location Settings page and do this manually?")) {
cordova.plugins.diagnostic.switchToLocationSettings();
}
}
}
}, cordova.plugins.locationAccuracy.REQUEST_PRIORITY_HIGH_ACCURACY // iOS will ignore this
);
} else {
// On iOS, this will occur if Location Services is currently on OR a request is currently in progress.
// On Android, this will occur if the app doesn't have authorization to use location.
onError("Cannot request location accuracy");
}
});
}else{
onError("User denied permission to use location");
}
});
}

// Make the request
requestLocationAccuracy();

build err

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

  • [x ] bug report
  • feature request
  • documentation issue

Bug report

Current behavior:

  • What went wrong:
    Execution failed for task ':app:processDebugGoogleServices'.

Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 9.0.0.

Expected behavior:

Just build succesfully
Steps to reproduce:

Environment information

  • Cordova CLI version
    • 8.0.0
  • Cordova platform version
    • `Installed platforms:
      android 7.0.0
      Available platforms:
      browser ~5.0.1
      ios ~4.5.4
      osx ~4.0.1
      windows ~5.0.0
      www ^3.12.0
  • Plugins & versions installed in project (including this plugin)
    • com.napolitano.cordova.plugin.intent 0.1.3 "IntentPlugin"
      cordova-android-firebase-gradle-release 1.0.0 "cordova-android-firebase-gradle-release"
      cordova-android-play-services-gradle-release 1.4.1 "cordova-android-play-services-gradle-release"
      cordova-plugin-camera 4.0.3 "Camera"
      cordova-plugin-device 2.0.2 "Device"
      cordova-plugin-fcm 2.1.2 "FCMPlugin"
      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-request-location-accuracy 2.2.3 "Request Location Accuracy"
      cordova-plugin-statusbar 2.4.2 "StatusBar"
      cordova-plugin-whitelist 1.3.3 "Whitelist"
      cordova.plugins.diagnostic 4.0.6 "Diagnostic"
  • Dev machine OS and version, e.g.
    • Windows 10

Runtime issue

  • Device details
    galaxy A7
  • OS details
    • e.g. iOS 11.2, Android 8.1

Android build issue:

  • Node JS version

    • v6.11.4`
  • Gradle version

    • ls platforms/android/.gradle - I can not know. I just get only err.
  • Target Android SDK version

    • android:targetSdkVersion in AndroidManifest.xml
      android:targetSdkVersion="26"
  • Android SDK details

    • sdkmanager --list | sed -e '/Available Packages/q'

iOS build issue:

  • Node JS version
    • node -v
  • XCode version

If using an Ionic Native Typescript wrapper for this plugin:

  • Ionic environment info
    • ionic info
  • Installed Ionic Native modules and versions
    • npm list | grep "@ionic-native"

Related code:

insert any relevant code here such as plugin API calls / input parameters

Console output

console output

// Paste any relevant JS/native console output here



Other information:

Feature request

Documentation issue

RequestLocationAccuracy.java line 287

Hello guys,
Im having a problem with cordova-plugin-request-location-accuracy 2.2.0

Looking on our Fabric, we got the following error:

RequestLocationAccuracy.java line 287
cordova.plugin.RequestLocationAccuracy.handleSuccess

on:

  • MotoG3 (Android 6.0, 5.1.1)
  • LG-H442 (Android 5.0.1)
  • LG-K430 (Android 6.0)
  • XT1078 (Android 6.0)

Full stack trace: issue_2_crash_58E55B66025300014AB8903D4E93726E_a464d99a41864b0d89875eff7c5e9acf_0_v1.txt

Google Play Services:
image

Do you know how to resolve that?
Thank you

New iOS canRequest feature

Can Android and iOS requests be made from a single call function? It seems they are separate features...like

if (iOS) {
   cordova.plugins.locationAccuracy.canRequest() ;
} else if (Android) {
   cordova.plugins.locationAccuracy.request(function (success){ ... }
}

Either that or possibly your documentation is inaccurate, because in the Android & iOS section, under iOS you first list:
cordova.plugins.locationAccuracy.request(successCallback, errorCallback)

but then the very next iOS example usage shows:
cordova.plugins.locationAccuracy.canRequest(function(canRequest){ if(canRequest){ ...

If Android/iOS can be done from same call, can you show an integrated example?

Accuracy constant

When the request accuracy is set to:

cordova.plugins.locationAccuracy.REQUEST_PRIORITY_NO_POWER

it fails to show the confirm dialog.

Error installing plugin

I have Google Repository 31 and Google Play Services 31 installed.

C:\Users\RPO\dev\myApp\platforms\android\src\cordova\plugin\RequestLocationAccuracy.java:310: error: cannot find symbol
LocationServices.SettingsApi.checkLocationSettings(
^
symbol: variable SettingsApi
location: class LocationServices
C:\Users\RPO\dev\myApp\platforms\android\src\cordova\plugin\RequestLocationAccuracy.java:450: error: cannot find symbol
case ConnectionResult.SERVICE_MISSING_PERMISSION:
^
symbol: variable SERVICE_MISSING_PERMISSION
location: class ConnectionResult
C:\Users\RPO\dev\myApp\platforms\android\src\cordova\plugin\RequestLocationAccuracy.java:453: error: cannot find symbol
case ConnectionResult.SERVICE_UPDATING:
^
symbol: variable SERVICE_UPDATING
location: class ConnectionResult
C:\Users\RPO\dev\myApp\platforms\android\src\cordova\plugin\RequestLocationAccuracy.java:459: error: cannot find symbol
case ConnectionResult.SIGN_IN_FAILED:
^
symbol: variable SIGN_IN_FAILED
location: class ConnectionResult
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\Users\RPO\dev\myApp\platforms\android\src\org\apache\cordova\file\AssetFilesystem.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
4 errors
FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':compileDebugJavaWithJavac'.

    Compilation failed; see the compiler error output for details.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 51.527 secs
ERROR building one of the platforms: Error code 1 for command: cmd with args: /s,/c,"C:\Users\RPO\dev\myApp\platforms\android\gradlew cdv
BuildDebug -b C:\Users\RPO\dev\myApp\platforms\android\build.gradle -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"
You may not have the required environment or OS to build this project
Error: Error code 1 for command: cmd with args: /s,/c,"C:\Users\RPO\dev\myApp\platforms\android\gradlew cdvBuildDebug -b C:\Users\RPO\dev
\myApp\platforms\android\build.gradle -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"

C:\Users\RPO\dev\myApp>cordova plugin add https://github.com/wf9a5m75/google-play-services#v23
Fetching plugin "https://github.com/wf9a5m75/google-play-services" via git clone
Repository "https://github.com/wf9a5m75/google-play-services" checked out to git ref "v23".
Notice: com.google.playservices has been automatically converted to cordova-plugin-googleplayservices and fetched from npm. This is due to o
ur old plugins registry shutting down.
Plugin "cordova-plugin-googleplayservices" already installed on android.

C:\Users\RPO\dev\myApp>cordova plugin
br.com.dtmtec.plugins.carrier 1.0.0 "Carrier"
cl.rmd.cordova.dialoggps 0.0.2 "DialogGPS"
com.google.playservices 23.0.0 "Google Play Services for Android"
com.ionic.keyboard 1.0.4 "Keyboard"
com.lampa.startapp 0.1.4 "startApp"
com.ludei.webview.plus 2.4.3 "Webview+"
com.phonegap.plugins.nativesettingsopener 1.0 "Native settings"
com.vliesaputra.deviceinformation 1.0.1 "DeviceInformation"
cordova-plugin-appavailability 0.4.2 "AppAvailability"
cordova-plugin-apprate 1.1.7 "AppRate"
cordova-plugin-console 1.0.2 "Console"
cordova-plugin-device 1.1.2 "Device"
cordova-plugin-device-motion 1.2.0 "Device Motion"
cordova-plugin-device-orientation 1.0.2 "Device Orientation"
cordova-plugin-dialogs 1.2.0 "Notification"
cordova-plugin-email 1.1.1 "EmailComposer"
cordova-plugin-fastrde-checkgps 1.0.0 "checkGPS"
cordova-plugin-file 4.1.1 "File"
cordova-plugin-geolocation 2.1.0 "Geolocation"
cordova-plugin-globalization 1.0.2 "Globalization"
cordova-plugin-googleplayservices 19.0.3 "Google Play Services for Android"
cordova-plugin-inappbrowser 1.2.1 "InAppBrowser"
cordova-plugin-request-location-accuracy 1.0.3 "Request Location Accuracy"
cordova-plugin-splashscreen 3.1.0 "Splashscreen"
cordova-plugin-statusbar 2.1.1 "StatusBar"
cordova-plugin-vibration 2.1.0 "Vibration"
cordova-plugin-whitelist 1.2.1 "Whitelist"
cordova-sqlite-storage 0.8.2 "Cordova sqlite storage plugin (core version)"
cordova-universal-links-plugin 1.1.2 "Universal Links Plugin"
cordova.plugins.diagnostic.api-22 2.3.10-api-22 "Diagnostic"
phonegap-facebook-plugin 0.12.0 "Facebook Connect"

Fails to handle error correctly if Google Play outdated

If Google Play Services is outdated, it crashes as follows:

java.lang.NullPointerException: Attempt to invoke virtual method 'void org.apache.cordova.CallbackContext.error(org.json.JSONObject)' on a null object reference
tat cordova.plugin.RequestLocationAccuracy.handleError(RequestLocationAccuracy.java:216)
at cordova.plugin.RequestLocationAccuracy.onConnectionFailed(RequestLocationAccuracy.java:442)

Since context isn't set.

I notice that it will fail in the same way if it gets an exception making the request:

        }catch(Exception e ) {
            handleError(e.getMessage(), ERROR_EXCEPTION);
            result = false;
        }

Because it has not done a: context = callbackContext;

I'm getting tons of these crashes from our users, unfortunately. I suspect there is a lot of outdated Google Play Services out there.

Plugin Conflict?

When I have both cordova-plugin-fcm and cordova-plugin-request-location-accuracy plugins installed my build fails. Here is the output:

Found com.google.android.gms:play-services-location:+, but version 9.2.0 is needed for the google-services plugin.
:processDebugGoogleServices FAILED

FAILURE: Build failed with an exception.

What went wrong: Execution failed for task ':processDebugGoogleServices'. > Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 9.2.0.

When I have one or the other installed the build is successful.

Success method is called before user grant the permission.

I am developing the ionic2 app in these I want to use GPS location. I used following code

this.locationAccuracy.canRequest().then((canRequest: boolean) =>
{
if (canRequest) {
this.locationAccuracy.request(this.locationAccuracy.SUCCESS_USER_AGREED).then(
(res) => {
this.geolocation.getCurrentPosition().then((resp) => {
console.log("getCurrentPosition", resp);
this.coordinates = resp.coords;
}).catch((error) => {
console.log('Error getting location', error);
});
},
error => console.log('Error requesting location permissions', error)
);
}
});

In this code, before the user grants the permission of location, the getCurrentPosition() method is called and then this method is unable to access GPS location. How to make this wait until the user grants or denies the permission?

When there is no Google Play Services, `request` method is hanging

It works as expected when there is play services installed and up-to-date. If it is not installed, I call canRequest method and it returns true - which I think should return false. Then I call request method but the success or error callback is not fired. I need to make a fallback way using diagnostics plugin but I cannot check if it works or not.

canRequest() is no longer working for me

I haven't changed anything in my code but the canRequest function is always false for me now. No matter if i turn on or off the location on my phone (running it on android with ionic cordova run android) it is going to the console.log("failure") part all the time if i use the canRequest(). It was working without any problem some days ago (both location turned off or on).

async locationReq() {
    
    
    const canRequest = await this.locationAccuracy.canRequest();
    console.log(canRequest);
    if (canRequest) {
      
      const success = await this.locationAccuracy.request(this.locationAccuracy.REQUEST_PRIORITY_HIGH_ACCURACY).then((success) => {
        
        if (success.code==1 || success.code==0){
          this.answer=true;
        }
        else{          
         alert("Hiba történt! Próbáld újra!")
        }
      });
    }
    else{
      console.log("failure");
    }

    if (this.answer == true) {
      console.log('answer is true');
      await this.plt.ready();

      const loader = this.loadingCtrl.create({
        content: 'Helyadatok lekérdezése...'
      });
      loader.present();

      const options = {
        timeout: 15000
      };

      try {
        const resp = await this.geolocation.getCurrentPosition(options);
        this.lat = resp.coords.latitude;
        this.lang = resp.coords.longitude;
      } catch (err) {
        this.lat = 47.49801;
        this.lang = 19.03991;
        this.presentToast(); // Not sure if this must be awaited..
      } finally {
        loader.dismiss();
        this.mapLoadingPresent();
      }
    } else {
      console.log('answer is no or undefinied');
    }

  }

Module has no exported member 'Location Accuracy'

Hello everyone,
I am getting error while importing LocationAccuracy from ionic native
Module has no exported member 'Location Accuracy'
I have already installed the plugin.
Is there any solution?

Please fix the version conflict either by updating the version of the google-services plugin

Hello

This happened after installation of plugin and running :

Any clues what to do ?
I have Cordova version 6.3.1
Thanks

Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

why value of cordova.plugins.locationAccuracy.SUCCESS_SETTINGS_SATISFIED is 0?

cordova.plugins.locationAccuracy.request(function (success) { //alert("Successfully requested accuracy: " + success.message); alert(cordova.plugins.locationAccuracy.SUCCESS_SETTINGS_SATISFIED); alert(cordova.plugins.locationAccuracy.SUCCESS_USER_AGREED); if (cordova.plugins.locationAccuracy.SUCCESS_SETTINGS_SATISFIED && cordova.plugins.locationAccuracy.SUCCESS_USER_AGREED) { navigator.geolocation.getCurrentPosition(onSuccessGeo, onError, { timeout: 10000, enableHighAccuracy: true }); } }

why i am getting the value of cordova.plugins.locationAccuracy.SUCCESS_SETTINGS_SATISFIED is 0?
Is there anything wrong in my code? Please suggest

Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'

When bioth "js-service" and "cordova-plugin-request-location-accuracy" is used then
error occur in build:
:app:compileDebugSources
:app:transformClassesWithStackFramesFixerForDebug
:app:transformClassesWithDesugarForDebug
:app:transformClassesWithDexBuilderForDebug
:app:transformDexArchiveWithExternalLibsDexMergerForDebug FAILED

What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex

Request on iOS

Hi,

if I request location on iOS and it has been granted earlier, the promise will be rejected with "Location services is already enabled". Why don't you resolve the promise since GPS is enabled?

@dpa99c

Issue causing map to not load.

Hi again,

Previously I was just running this GPS check. It begin loading the map, see the gps not enable, shows a blank map (because there are no gps coords yet), ask the user if they wanted gps enabled and then take them to their settings page where they manually enabled the GPS. Upon doing so they would route back to the app and the map would continue its load based on new gps data.

function gpsEnable() {
  CheckGPS.check(function() {
    errMgmt("app/run",200,"GPS is enabled") ;
  },
  function() {
    errMgmt("app/run",201,"GPS is not enabled") ;
    var gpsMessage = "GPS is currently DISABLED.\n\nThis App requires the use of your devices GPS, you will next be directed to your devices settings page to turn on its GPS." ;
    cordova.dialogGPS(gpsMessage) ;
  }) ;
}

But now I have implemented the following, it starts to load the map page, see's gps is disabled, shows a blank map (because no gps data yet), asks user to enable GPS - when clicking yes the GPS simply auto-enables but then the map page never loads....just stays blank. when the user manually enters in an address then the map loads.


function gpsEnable() {
  CheckGPS.check(function() {
    errMgmt("app/run",200,"GPS is enabled") ;
  },
  function() {
    errMgmt("app/run",201,"GPS is not enabled") ;
    var gpsMessage = "GPS is currently DISABLED.\n\nThis App requires the use of your devices GPS, you will next be directed to your devices settings page to turn on its GPS." ;
    cordova.dialogGPS(gpsMessage) ;
  }) ;
}

function gpsSuccess(success){
  errMgmt("app/gpsEnable",1053,"successfully enabled") ;
}

function gpsFailure(error){
  errMgmt("app/gpsEnable",1054,"code: "+error.code + "; msg = "+error.message) ;
    if(error.code !== cordova.plugins.locationAccuracy.ERROR_USER_DISAGREED){
        gpsEnable() ;
    }
}
function globalGPS(){
    if(device.platform == "iOS"){
        gpsEnable() ;
    }else if(device.platform == "Android"){
        cordova.plugins.locationAccuracy.request(gpsSuccess, gpsFailure, cordova.plugins.locationAccuracy.REQUEST_PRIORITY_HIGH_ACCURACY);
    }
}

If I stop and restart the app (gps is already enabled now) then the map page loads just fine.


.run(function($ionicPlatform) {
  $ionicPlatform.ready(function() {
    // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
    // for form inputs)
    if (window.cordova && window.cordova.plugins && window.cordova.plugins.Keyboard) {
      cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
    }
    if (window.StatusBar) {
      // org.apache.cordova.statusbar required
      StatusBar.styleLightContent();
    }   
    globalGPS() ;

  });

My map page auto-loads from the .state definitions, when app.js is loaded if a state isn't defined then default to: $urlRouterProvider.otherwise('/tab/map'); which points to:

  .state('tab.map', {
    url: '/map',
    views: {
      'tab-map': {
        templateUrl: 'templates/tab-map.html',
        controller: 'MapCtrl'
      }
    }
  })

And in the MapCtrl:

.controller('MapCtrl', function($scope,$rootScope,constants) {
  ionic.Platform.ready(function() {
    setPickup("",0);
    $scope.map = setMap;    
  });
})

// setPickup is an external global function, its grabbing the local gpsCoords

canRequest() always false

Hi,

I have location services enabled on my iPhone 6s with iOS10.

locationAccuracy.canRequest() is always false. On appstart, there's no prompt to allow location for my app.

If I run navigator.geolocation.getCurrentPosition(), the prompt appears, but canRequest() is still false.

Any tips?

Handle Play Services Update

Hi,

I've got the following scenario on my device:

cordova.plugins.locationAccuracy.ERROR_GOOGLE_API_CONNECTION_FAILED
code:5
message: "Failed to connect to Google Play Services: The installed version of Google Play services is out of date."

Is there a way to open a question prompt and let the user decide wether to update play services?

Conflict with google-service plugin version

Hi,

the plugin not follow of recomendation from here https://blog.phonegap.com/the-play-services-problem-with-cordova-applications-489c9aeb2e89 and it causes problems like this:

Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 11.6.2.

Thank you

iOS settings redirection not working on 'resume' event

Great Plugin buddy, but in iOS settings redirection happens only on 'device ready' event.I need a functionality where user can't proceed in app if location is not ON so I want to call this code in 'resume' event as well as from some other files of my project.Is there a way.
Also Can we hide Cancel Button that appears in native dialog in iOS.
Any leads appreciated.

Cordova.plugins is undefined

I tried to add this plugin to my cordova project (Visual Studio 2015 Tools for Apache Cordova).

It was installed successfully.

However when I try to run it on an android Device (Samsung Galaxy Note4) running Android 5.1.1 it shows cordova.plugins as undefined and therefore is not able to run the plugin.

Any help ?

Thanks
Ashutosh

Customization of the alert shown when there is no google play services

I get an alert like <appname> won't run without Google Play Services, which are not supported by your device. This is an annoying message for people who don't like installing google apps in their phone. Also the app runs, just some features won't work. Can I customize it (localize it for example) or completely disable it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.