This is an automated email from the ASF dual-hosted git repository.

normanbreau pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-plugin-geolocation.git


The following commit(s) were added to refs/heads/master by this push:
     new 89cf51d  Variable for Require GPS Hardware (#189)
89cf51d is described below

commit 89cf51d222e8f225bdfb661965b3007d669c40ff
Author: Martin Bech <sithwarr...@users.noreply.github.com>
AuthorDate: Wed Mar 18 14:37:18 2020 +0100

    Variable for Require GPS Hardware (#189)
    
    * Variable for Require GPS Hardware
    
    * docs: wording changes for installation
    
    Co-authored-by: Martin Bech <m...@mobaro.com>
    Co-authored-by: Tim Brust <ratchet.pla...@gmx.de>
---
 README.md  | 5 +++++
 plugin.xml | 3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 5fa8dee..eff61ce 100644
--- a/README.md
+++ b/README.md
@@ -172,6 +172,11 @@ error, the `geolocationError` callback is passed a
  
 ### Android Quirks
 
+For historic reasons, this plugin requires GPS Hardware on Android devices, so 
your app will not be able to run on devices without.
+If you want to use this plugin in your app, but you do not require actual GPS 
Hardware on the device, install the plugin using the variable *GPS_REQUIRED* 
set to false:
+
+    cordova plugin add cordova-plugin-geolocation --variable 
GPS_REQUIRED="false"
+
 If Geolocation service is turned off the `onError` callback is invoked after 
`timeout` interval (if specified).
 If `timeout` parameter is not specified then no callback is called.
 
diff --git a/plugin.xml b/plugin.xml
index 363310e..0177bf5 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -34,6 +34,7 @@ xmlns:android="http://schemas.android.com/apk/res/android";
     <engines>
         <engine name="cordova-android" version=">=6.3.0" />
     </engines>
+    <preference name="GPS_REQUIRED" default="true"/>
 
     <!-- android -->
     <platform name="android">
@@ -41,7 +42,7 @@ xmlns:android="http://schemas.android.com/apk/res/android";
         <config-file target="AndroidManifest.xml" parent="/*">
             <uses-permission 
android:name="android.permission.ACCESS_COARSE_LOCATION" />
             <uses-permission 
android:name="android.permission.ACCESS_FINE_LOCATION" />
-            <uses-feature android:name="android.hardware.location.gps" />
+            <uses-feature android:name="android.hardware.location.gps" 
android:required="$GPS_REQUIRED" />
         </config-file>
 
         <config-file target="res/xml/config.xml" parent="/*">


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cordova.apache.org
For additional commands, e-mail: commits-h...@cordova.apache.org

Reply via email to