GithubHelp home page GithubHelp logo

mauron85 / cordova-plugin-background-geolocation Goto Github PK

View Code? Open in Web Editor NEW

This project forked from christocracy/cordova-plugin-background-geolocation

538.0 538.0 407.0 3.65 MB

Background and foreground geolocation plugin for Cordova.

License: Apache License 2.0

JavaScript 16.24% Java 58.05% Objective-C 23.07% Shell 2.65%

cordova-plugin-background-geolocation's People

Contributors

arakaki-yuji avatar bastian-meier avatar christocracy avatar coderroggie avatar djereg avatar eakkew avatar eliesauveterre avatar ernestohegi avatar geezmo avatar globules-io avatar harelm avatar jancellor avatar keesschollaart81 avatar kingjan1999 avatar m165437 avatar mauron85 avatar mehuge avatar oz-at-work avatar samsonasu avatar spr-joshlamkin avatar unixmonkey avatar yannbertrand avatar zgiles 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  avatar  avatar  avatar  avatar

Watchers

 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

cordova-plugin-background-geolocation's Issues

Plugin causes issue with websql and sqlite

Hi, i implemented the plugin on my project. On doing this, i observed some sql inconsitency, quries now return zero results sometimes but once remove the call to the plugin in my project, everthing works just fine.

using another cordova plugin(cordova local notification) on success callback is it possible?

@mauron85 Thanks for the great plugin ! appreciate your hardwork !

i am using this plugin without any major issues ! Currently i am scheduling local notifications on success callback which works very well !

However , what i noticed is even if this plugin can run in background i cant schedule notification if the app was closed during success callback !

so is there a way to schedule that local notification ?

Also i am aware about the issue about background service terminating and restarting later !

when the service terminates i checked currently running processes in settings (settings-->apps-->myapp) ,

here it seems that service is not totally terminated , the status shows of the process is always "restarting.." ! it gets stuck while restarting !

This post is more of a question , and am sorry for that ! help is appreciated !

callbackFn called several times on iOS

I've integrated background tracking into my Phonegap app (based on the Sample App).

On my Android device it seems to work perfectly. It's posting location updates to my sever nicely: infrequently when stationary and more often when moving.

I don't have an iOS device to test, but in the simulator with Location set to Freeway Drive, I'm getting the exact same position logged several times (anything up to 10 times) in my database - all with exactly the same timestamp.

Is this a problem with the plugin; the behaviour of the iOS simulator; or my code (which works in every other respect).

Any advice is much appreciated. Thanks

iOS 9.1 Location Error

Background service of the plugin does not work correctly on iOS 9.1 (ipad 3).

Pressing the "btn-home" in footer, shows the current location on map. Location privileges to app are granted "always":

When the app is closed and running in background, there are no notifications and the map "jumps" to the current location, when its reopened.

I have also tried iOS emulator with iOS 9.0 and its working fine.

Config option to turn off Android drawer notification

On Android devices it is required to have a notification in the drawer because it's a "foreground service". This gives it high priority, decreasing probability of OS killing it.

This isn't really an option for my app. Is there an option to not have a notification in the drawer? What are the ramifications of not being a "foreground service"? How likely is it to be killed by the OS?

how to get new position every 3 secs

can you help me to get position every 6 sec

this code i am using
`
backgroundGeoLocation.configure(callbackFn, failureFn, {
desiredAccuracy: 100,
notificationIconColor: '#4CAF50',
notificationTitle: 'Background tracking',
notificationText: 'ENABLED',
notificationIcon: 'notification_icon',
debug: false, // <-- enable this hear sounds for background-geolocation life-cycle.
stopOnTerminate: false, // <-- enable this to clear background location settings when the app terminates
interval: 1000, // <!-- poll for position every minute
activitiesInterval: 1000, // <!-- poll for position every minute
fastestInterval: 1000
});

`

iOS: stopOnTerminate not working

I'm testing on a real device with iOS 9.2.1. I have set stopOnTerminate to true, but when I close my app (double tap on home and swipe it away), I keep seeing the GPS icon on the statusbar. It persists through phone reboot. I am sure that the icon belongs to my app, because uninstalling the app or disabling Location Services for this specific app immediately removes the icon.

Keep service running when app is closed

I noticed that some app have services that keep running even when the app is killed.
I found this plugin sample https://github.com/Red-Folder/bgs-sample , it's a simple timer which put some information in logcat. I tried it and the timer is still running after the app is killed.

It seems possible to not have the service been killed, is that possible to do the same for the background-geolocation plugin ?

2.16 - Multitasking Apps may only use background services for their intended purposes: VoIP, audio playback, location, task completion, local notifications, etc.

Our app has been rejected by Apple due to 2.16 - Multitasking Apps may only use background services for their intended purposes: VoIP, audio playback, location, task completion, local notifications, etc.

We have enabled Location Updates, Background Fetch and Remote notifications in Xcode's Background Modes.

We don't know why Apple has been rejected out app.
Our app needs to send locations to server when is in background.

Could you help us to solve this problem?

Regards

Question: callbackFn called in Android but not in iOS (Simulator)

Hello,

Please I have a question, how can I make my app call the callbackFn on iOS even while developing in the simulator, I changed the location to Freeway drive but still callbackFn isn't called and failureFn isn't either so I know my config is fine. The callbackFn is called just fine on Android by the way.

I see CDVBackgroundGeoLocation start (background? 0) and CDVBackgroundGeoLocation didChangeAuthorizationStatus 4 logged in the console on XCode, please what do these mean?

Thanks

having a second instance of plugin to getcurrent position while app is running.

is it possible to run a second instance of plugin only to get the current position of the user while app is active ?(independent of ongoing background service)

I know getcurrentposition is possible with $cordovageolocation or html5 geolocation api .

But those are not working on android < 4.4. ! Kitkat above those work without any issue.
Below kitkat always getting timeout no matter highaccuracy is set to true or false or no matter how long the timeout is set to.

Interestingly, this background geolocation plugin works like a charm even on jellybean devices.

It would be great if theres a way to do that with this plugin ! then no cordova geolocation plugin will be required !

is there a way i can do it ?

Thanks ! help is appreciated !

Plugin crashes on android 23

It seems that there is something wrong with the runtime permissions request code. I'm getting this error:

03-02 21:49:15.448  2958  2958 E AndroidRuntime: FATAL EXCEPTION: main
03-02 21:49:15.448  2958  2958 E AndroidRuntime: Process: com.appspot.myapp:remote, PID: 2958
03-02 21:49:15.448  2958  2958 E AndroidRuntime: java.lang.RuntimeException: Unable to start service com.tenforwardconsulting.cordova.bgloc.DistanceFilterLocationService@68f8d93 with Intent { flg=0x4 cmp=com.appspot.myapp/com.tenforwardconsulting.cordova.bgloc.DistanceFilterLocationService (has extras) }: java.lang.SecurityException: "passive" location provider requires ACCESS_FINE_LOCATION permission.
03-02 21:49:15.448  2958  2958 E AndroidRuntime:        at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3027)
03-02 21:49:15.448  2958  2958 E AndroidRuntime:        at android.app.ActivityThread.-wrap17(ActivityThread.java)
03-02 21:49:15.448  2958  2958 E AndroidRuntime:        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1442)
03-02 21:49:15.448  2958  2958 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:102)
03-02 21:49:15.448  2958  2958 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:148)
03-02 21:49:15.448  2958  2958 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:5417)
03-02 21:49:15.448  2958  2958 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
03-02 21:49:15.448  2958  2958 E AndroidRuntime:        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
03-02 21:49:15.448  2958  2958 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
03-02 21:49:15.448  2958  2958 E AndroidRuntime: Caused by: java.lang.SecurityException: "passive" location provider requires ACCESS_FINE_LOCATION permission.
03-02 21:49:15.448  2958  2958 E AndroidRuntime:        at android.os.Parcel.readException(Parcel.java:1620)
03-02 21:49:15.448  2958  2958 E AndroidRuntime:        at android.os.Parcel.readException(Parcel.java:1573)
03-02 21:49:15.448  2958  2958 E AndroidRuntime:        at android.location.ILocationManager$Stub$Proxy.requestLocationUpdates(ILocationManager.java:606)
03-02 21:49:15.448  2958  2958 E AndroidRuntime:        at android.location.LocationManager.requestLocationUpdates(LocationManager.java:880)
03-02 21:49:15.448  2958  2958 E AndroidRuntime:        at android.location.LocationManager.requestLocationUpdates(LocationManager.java:464)
03-02 21:49:15.448  2958  2958 E AndroidRuntime:        at com.tenforwardconsulting.cordova.bgloc.DistanceFilterLocationService.setPace(DistanceFilterLocationService.java:162)
03-02 21:49:15.448  2958  2958 E AndroidRuntime:        at com.tenforwardconsulting.cordova.bgloc.DistanceFilterLocationService.onStartCommand(DistanceFilterLocationService.java:113)
03-02 21:49:15.448  2958  2958 E AndroidRuntime:        at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3010)
03-02 21:49:15.448  2958  2958 E AndroidRuntime:        ... 8 more

From looking at the code and comparing to https://cordova.apache.org/docs/en/dev/guide/platforms/android/plugin.html#runtime-permissions-cordova-android-5-0-0 perhaps we need to use cordova.hasPermission

Error: Plugin Geolocation failed to install, Intel XDK

I've removed the plugin and added again with Intel XDK and the build fails with the message Error: Plugin Geolocation failed to install.

I try to know why, but I couldn't find the solution. Then, I sow that recently you release a new tag (0.9.3) and the Geolocation Plugin Dependency was with the suffix ios-fix. So I suppose the error was in that new dependency.
When I specify the 0.9.1 tag, that builds OK.

Thank you

Background App did not killed

Hi,

I am testing this plugin using the SampleApp. I am trying to kill/stop the app(by swipe away the app from the running list ,in android samsung S5). I noticed that the older version of the plugin version="0.7.3" is able to kill the app through this action but the newer version version="0.8.1" is not able to kill. Can help to verify if this is the bug in the newer or there's something i am missing? Thank you.

UnimplementedBackgroundGeoLocation.start error

Hi,

I have added below piece of code in ondeviceReady event. When I try to execute, I get 'Unimplemented API Emulation: BackgroundGeoLocation.start' in emulator. Can you please help me out.

/**
* This would be your own callback for Ajax-requests after POSTing background geolocation to your server.
*/
var yourAjaxCallback = function(response) {
backgroundGeoLocation.finish();
};

    /**
    * This callback will be executed every time a geolocation is recorded in the background.
    */
    var callbackFn = function(location) {

        console.log('[js] BackgroundGeoLocation callback:  ' + location.latitude + ',' + location.longitude);




            yourAjaxCallback.call(this);

    };

    var failureFn = function() {
         console.log('BackgroundGeoLocation err');
    };

    // Only ios emits this stationary event
    backgroundGeoLocation.onStationary(function(location) {
      console.log('onStationary');
    });

    // BackgroundGeoLocation is highly configurable.
    backgroundGeoLocation.configure(callbackFn, failureFn, {
        desiredAccuracy: 10,
        stationaryRadius: 50,
        distanceFilter: 50,
        locationTimeout: 30,
        activityType: 'AutomotiveNavigation',
        debug: true, // <-- enable this hear sounds for background-geolocation life-cycle.
        stopOnTerminate: false, // <-- enable this to clear background location settings when the app terminates
        locationService: backgroundGeoLocation.service['ANDROID_DISTANCE_FILTER'],
        fastestInterval: 5000
    });

  backgroundGeoLocation.start();

Thanks
Sri

ios build failed when added this plugin

** BUILD FAILED **

The following build commands failed:
CompileC build/QianDao.build/Debug-iphonesimulator/QianDao.build/Objects-normal/i386/CDVLocation-220F4D50F87A2F61.o QianDao/Plugins/cordova-plugin-geolocation-ios9-fix/CDVLocation.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/zengyanli/Documents/dev/prj/app/svn/szyd/tongfu/qiaodao/client/platforms/ios/cordova/build-debug.xcconfig,-project,QianDao.xcodeproj,ARCHS=i386,-target,QianDao,-configuration,Debug,-sdk,iphonesimulator,build,VALID_ARCHS=i386,CONFIGURATION_BUILD_DIR=/Users/zengyanli/Documents//client/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/dev/prj/app/svn/szyd/tongfu/qiaodao/client/platforms/ios/build/sharedpch

CDVBackgroundGeoLocation locatinManager failed

More often than not I keep getting this error thrown the Xcode logs:

CDVBackgroundGeoLocation locationManager failed: Error Domain=kCLEerrorDomain Code=0 "(null)"

This happens when the app is in the background and when it happens it failed to send the geolocation. I'm very new iOS dev and any help would be much appreciated. I am testing on an iPad mini running 9.2.1

Setting notificationIcon removes notificationTitle & notificationText

When I set my icon like so:

    self.opts = {}
    self.opts.notificationIcon = 'icon'
    self.opts.notificationTitle = 'My app Background GPS'
    self.opts.notificationText = 'ENABLED'
    self.opts.debug = false
    self.opts.stopOnTerminate = false

The icon shows up great, but then I'm left with:
Title: 'app-name is running'
Text: 'Touch for more information or to stop the...'

When I remove the icon setting from my config, the text works.

Android#5.1.1
Cordova#latest
cordova-plugin-background-geolocation#latest

iOS infrequent location updates

Hi

I have some trouble with iOS. I've been testing with two iPhones (5 and 6, both 9.2) and also runnig SportsTracker on one of them to compare the results.

If I test my app with a simulator and select "city run" or similar, I get constant location updates and everything seems fine.

However with a real phone in my city (Helsinki, Finland) it works really strange. I ride the bus and monitor the app's log. The log might say "engaging agressive mode" and then nothing happends for several minutes (up to 7 minutes in my testing). Plugin gets no location for 7 minutes.

I also had issues with stationaryRadius. The plugin might output "continue stationary" even though the bus's been going for a minute. On the ohter hand it might suddenly exist the stationaryRegion while the bus is still at a bus stop. I tried using changePace to keep it always moving, but the problem describes above still prevents me from getting accurate results.

In the end if I follow a straight road total distance is fine with infrequent location updates. But if the bus turns a lot in a small block area the result can be half of the real distance.

Do you know what could be causing this issue? I get no explanation from the plugin's console output. As if it just stopped doing anything for several minutes.

Factory Reset Geolocation is not working

Hi,

I using the SampleApp to test on the android. I faced an issue, where i have factory reset the android s5, open the sampleApp app, click locate and start the tracking, the tracking is not working(android setting is all in default mode, without google account).

Then i added google account to the android, the app is working. May i know why? Do users requires to setup google account on the phone then this background geolocation will only works?

Not working in background

The plugin is working fine when the application is opened.But when the application is closed it is not working.I used your sample code as same it is.Any idea?

Dude: Read GPS position only once

(Translated by Google)

I need to read the GPS position in background , just once . No repeatedly. Only when the app , receive a push notification .

Is it possible with this plugin do that?

The idea is to show (or not), the notification to the user, depending on whether the person is close to the position reached in the notification itself.

Thanks

iOS in airplane mode - GPS?

Thanks for keeping this thing rolling.

I'm wondering if there is any hope of adding support for the standard location service in iOS in addition to the significant-changes api. We're developing an app that needs to track user location while in airplane mode and in the background. It's my impression that the significant-changes API won't see any change due to never seeing a cell tower shift in this situation. Is that correct? Would cranking up the accuracy settings force the use of GPS in the plugin as it is built now? Or if the user is in motion while in foreground and then leaves the app, does there still need to be a significant change?

Really appreciate the plugin and help!

Request: Turn on Location Services using Google Play Services

Hello,

This is more or less a request, since the plugin already leverages the Google Play Services - Would it be possible to expose an API/method that turns on the device's location services without first going to the device settings view as showLocationSettings currently does?

I'm working on a project where the client wants the behaviour they have seen on Google Maps app - which just uses a dialog to ask for user's permission to turn on location without opening the settings or navigation away from the app.

Thank you.

Regular updates

Let's say I want to record the users location once every second...how can I do this with your plugin?

And, can we only record location while moving? Say the user is stationary for 5 seconds, then stop recording, but restart once they move...but have the move threshold be really low, like 1 meter?

--Sam

Donation

Hello, first thank you for your work. I have no way to contact you or I don't know how, so I put it here, then you erase if you like. I am using your plugin and would like to make a donation, small at this moment, but I would do it on a regular basis as I am developing the application will generate revenue. You can tell me how I could do this?

Thanks again for your effort.

Conflict with phonegap-facebook-plugin building Android

Hi,
I'm developing an application in Ionic. The project includes Background Geolocation and Facebook plugins, and work great on iOS, but on Android can not be compiled together (successfully compiled if only one of the plugins is installed).
Apparently there is a problem with duplication of dependencies. The specific error is "Multiple files defined dex". After searching for solutions I read that Facebook plugin use android-support-v4, and quite possibly generates conflicts with some dependence on this project.

Here's my build error.

UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;
    at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:579)
    at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:535)
    at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:517)
    at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:164)
    at com.android.dx.merge.DexMerger.merge(DexMerger.java:188)
    at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:504)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)
    at com.android.dx.command.dexer.Main.run(Main.java:277)
    at com.android.dx.command.dexer.Main.main(Main.java:245)
    at com.android.dx.command.Main.main(Main.java:106)

Can you think of any solution to this problem?

Thanks

Can't build for iOS - Cordova 6.0.0 & [email protected]

Using Cordova iOS 4.0.1 I'm getting this error when running sudo cordova build ios:

Plugins/cordova-plugin-mauron85-background-geolocation/CDVBackgroundGeoLocation.m:8:9: fatal error: 'Cordova/CDVJSON.h' file not found
#import <Cordova/CDVJSON.h>

Crash on Android 6 Api 23

When using the ionic application in Android 6 API 23, cordova-plugin-background-geolocation crash and applicaiton stop, have you a solution for this issue, thanks

navigator.geolocation vs Fused Location ?

Hi,
I'm currently switching from navigator.geolocation.watchPosition() to this plugin. But I'm noticing a very big difference in accuracy.
With the plugin, I've an accuracy of approximately 2km and with watchPosition I've something really close of my actual position. I notice this difference inside of my house so I presume the navigator.geolocation.watchPosition() uses my Wifi and the plugin tries to use the Cell tower.

My question is: What's the actual difference between the two implementations ? I thought the navigator uses the Fused provider ?
Is there a list of parameters I can use to refine the location given by the Fused Provider ?

Thanks !

PS: Google Maps also seems to locate me really fine.

Issues with using custom ICon

Hi, when i define the custom icon notificationIcon : res://icon.png or even in the drawable folder, the pulgin works in a very unexpected way by over writing the notificationTitle and notificationText to the default name of the App, once you click on the notification, the takes to to RUNNING APPS program.

What is the standard way of defining and setting the custom Icon

Make http requests from the service

Hi!
If I understand correctly how the plugin works, when the app is in background (or killed by the user), the service stores user locations in a database and when the app is opened again it's possible to send these locations to a remote server.

This is fine for some use cases, but do you think it would be possible to make http requests sending user location from the service?

Thank you

Getting location when app is in background, just once and fast

My use case is slightly different than most, I need to get the location when the app is in background, but just once, and as fast as possible.

Doing this with these parameters takes the better part of a minute: {desiredAccuracy: 500, stationaryRadius: 0, distanceFilter: 0, interval: 0, stopOnTerminate: true}

when the callback is called, I stop the background service.

I can't use the regular navigator.geolocation or the other plugins because the request expires, apparently you can't get the location even once when the app is not in foreground.

This plugin works but is a bit slow.

Any ideas?

Works on Intel XDK?

I have installed this plugin on my project, but is impossible make build.
Do you have any example with Intel XDK?

BackgroundTask works on simulator but not on actual iPhones

Hi there!
The background geolocation works great on Android, and workED great on iOS but since iOS 9.2 it's seems like it's working only on 10-20% of updated iPhones. I was using the original version of the plugin then it stopped working, so I updated with yours but it's not working either.

Basically it works great on the simulator, with any fake phone running iOS 9.2. I press the home button and the backgroundTask starts with a huge amount of "remaining time" and keep posting to the server.
BUT when I install the app on an actual iPhone (not a simulator), then I press Home to put the app in background it says :
CDVBackgroundGeoLocation stopBackgroundTask (remaining t: 179ms) and then it doesn't log or do anything anymore.

I've reinstalled everything, platform, plugin etc, I use Cordova 3.9 for iOS, my phone is an iPhone 5S with iOS 9.2 and again, it is working perfectly on simulators. The location updates are allowed in the background (plist file) and are allowed on my phone (always checked)...
I didn't modify the plugin and it was working great before the update to iOS 9.2...

Am I the only one facing this here? Thanks for the amazing and hard work though!
I've seen a couple of issues kind the same but I wanted to start a fresh thread because I've done several tests and didn't want them to be lost. Let me know if I should post it back to other thread.

PhoneGap for Android build fails

Hello, I really liked your plugin, it's awesome.

I use it for my PhoneGap application, to switch on/off tracking while app is in foreground/backgound mode. It worked just awesome. But today I needed to build new version of app, and got an error like "Error - One of your plugins required the gradle android build tool to build". I saw you added some notes regarding Android SDK version, and I used the latest one (24.4.1), but unfortunately it didn't help.

Here is by PhoneGap config file:

`

< name >Tracking
< description >
Tracking
< /description >
< author email="" href="" >
Team
< /author >
< feature name="http://api.phonegap.com/1.0/device" />
< preference name="permissions" value="" />
< preference name="orientation" value="default" />
< preference name="target-device" value="universal" />
< preference name="fullscreen" value="false" />
< preference name="webviewbounce" value="true" />
< preference name="prerendered-icon" value="true" />
< preference name="stay-in-webview" value="false" />
< preference name="ios-statusbarstyle" value="black-opaque" />
< preference name="detect-data-types" value="true" />
< preference name="exit-on-suspend" value="false" />
< preference name="show-splash-screen-spinner" value="true" />
< preference name="auto-hide-splash-screen" value="true" />
< preference name="disable-cursor" value="false" />
< preference name="android-minSdkVersion" value="24.4.1" />
< preference name="android-installLocation" value="internalOnly" />
< preference name="phonegap-version" value="cli-5.2.0" />
< preference name="android-maxSdkVersion" value="" />
< preference name="android-targetSdkVersion" value="" />
< preference name="KeepRunning" value="true" />
< preference name="splash-screen-duration" value="5000" />
< preference name="ErrorUrl" value="error.html" />
< preference name="LoadingDialog" value="Please wait, the app is loading." />
< preference name="LoadingPageDialog" value="Please wait, the data is loading." />
< preference name="LoadUrlTimeoutValue" value="20000" />
< preference name="AndroidPersistentFileLocation" value="Internal" />
< icon src="icon.png" />
< icon gap:platform="android" gap:qualifier="ldpi" src="res/icon/android/icon-36-ldpi.png" />
< icon gap:platform="android" gap:qualifier="mdpi" src="res/icon/android/icon-48-mdpi.png" />
< icon gap:platform="android" gap:qualifier="hdpi" src="res/icon/android/icon-72-hdpi.png" />
< icon gap:platform="android" gap:qualifier="xhdpi" src="res/icon/android/icon-96-xhdpi.png" />
< icon gap:platform="android" gap:qualifier="xxhdpi" src="res/icon/android/icon-144-xxhdpi.png" />

<gap:splash gap:platform="android" gap:qualifier="port-ldpi" src="res/screen/android/screen-ldpi-portrait.png" />
<gap:splash gap:platform="android" gap:qualifier="port-mdpi" src="res/screen/android/screen-mdpi-portrait.png" />
<gap:splash gap:platform="android" gap:qualifier="port-hdpi" src="res/screen/android/screen-hdpi-portrait.png" />
<gap:splash gap:platform="android" gap:qualifier="port-xhdpi" src="res/screen/android/screen-xhdpi-portrait.png" />
<gap:splash gap:platform="android" gap:qualifier="port-xhdpi" src="res/screen/android/screen-xhdpi-n7-portrait.png" />
<gap:splash gap:platform="android" gap:qualifier="port-xxhdpi" src="res/screen/android/screen-xxhdpi-portrait.png" />
<gap:splash gap:platform="android" gap:qualifier="port-xxhdpi" src="res/screen/android/screen-xxhdpi-n7-portrait.png" />
<gap:splash gap:platform="android" gap:qualifier="land-xxhdpi" src="res/screen/android/screen-xxhdpi-n7-landscape.png" width="1920" height="1200" />
<gap:splash gap:platform="android" gap:qualifier="land-xxhdpi" src="res/screen/android/screen-xxhdpi-landscape.png" width="1920" height="1080" />
<gap:splash gap:platform="android" gap:qualifier="land-xhdpi" src="res/screen/android/screen-xhdpi-n7-landscape.png" width="1280" height="800" />
<gap:splash gap:platform="android" gap:qualifier="land-xhdpi" src="res/screen/android/screen-xhdpi-landscape.png" width="1280" height="720" />
<gap:splash gap:platform="android" gap:qualifier="land-hdpi" src="res/screen/android/screen-hdpi-landscape.png" width ="800" height="480" />
<gap:splash gap:platform="android" gap:qualifier="land-mdpi" src="res/screen/android/screen-mdpi-landscape.png" width="480" height="320" />
<gap:splash gap:platform="android" gap:qualifier="land-ldpi" src="res/screen/android/screen-ldpi-landscape.png" width="320" height="200" />
<gap:splash gap:platform="ios" height="1136" src="res/screen/ios/screen-iphone-portrait-568h-2x.png" width="640" />

< access origin="*" />
< gap:platform name="android" />
< feature name="http://api.phonegap.com/1.0/camera" />
< feature name="http://api.phonegap.com/1.0/file" />
< feature name="http://api.phonegap.com/1.0/geolocation" />
< feature name="http://api.phonegap.com/1.0/media" />
< feature name="http://api.phonegap.com/1.0/notification" />
< gap:plugin name="cordova-plugin-console" source="npm" />
< gap:plugin name="cordova-plugin-media-capture" source="npm" />
< gap:plugin name="cordova-plugin-device" source="npm" />
< gap:plugin name="cordova-plugin-file" source="npm" />
< gap:plugin name="cordova-plugin-file-transfer" source="npm" />
< gap:plugin name="cordova-plugin-geolocation" source="npm" />
< gap:plugin name="cordova-plugin-media" source="npm" />
< gap:plugin name="cordova-plugin-network-information" source="npm" />
< gap:plugin name="cordova-plugin-dialogs" source="npm" />
< gap:plugin name="cordova-plugin-splashscreen" source="npm" />
< gap:plugin name="com.synconset.imagepicker" source="pgb" />
< gap:plugin name="com.phonegap.plugins.pushplugin" source="pgb" />
< gap:plugin name="cordova-plugin-x-toast" source="npm" />
< gap:plugin name="cordova-plugin-whitelist" source="npm" />
< gap:plugin name="cordova-plugin-inappbrowser" source="npm" />

< gap:plugin name="cordova-plugin-mauron85-background-geolocation-phonegapbuild" source="npm"/>
< plugin name="de.appplant.cordova.plugin.background-mode" spec="0.6.4" source="pgb" />

`

I also followed the link, that adobe provided http://docs.build.phonegap.com/en_US/support_failed-builds.md.html#gradle_required, but none of those instructions solve the issue.

Could you please advise what to do, how can I fix it. I really need to make it work.
Thank you.

[iOS 9.2.1] Plugin can only be used once

I am testing the plugin on an iphone 6 running iOS 9.2.1.
I will configure the plugin and then call start and changePace. The plugin works as expected providing periodic location updates. Then I call stop, which works as expected stopping the location updates.

After that however I am unable to get periodic updates again, I've tried calling start and changePace again with no effect, I've also tried calling configure again and then calling start and change pace. In all scenarios I've tried I can't get the plugin to run the success (or error) callback again.

Can Not Build IOS

I can build it on android but not on ios. The error is below :

** BUILD FAILED **

The following build commands failed:
CompileC build/geolocation.build/Debug-iphonesimulator/geolocation.build/Objects-normal/i386/CDVBackgroundGeoLocation.o geolocation/Plugins/cordova-plugin-mauron85-background-geolocation/CDVBackgroundGeoLocation.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Error code 65 for command: xcodebuild with args: -xcconfig,/Users/catsoft/desktop/geolocation/platforms/ios/cordova/build-debug.xcconfig,-project,geolocation.xcodeproj,ARCHS=i386,-target,geolocation,-configuration,Debug,-sdk,iphonesimulator,build,VALID_ARCHS=i386,CONFIGURATION_BUILD_DIR=/Users/catsoft/desktop/geolocation/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/catsoft/desktop/geolocation/platforms/ios/build/sharedpch
ERROR building one of the platforms: Error: /Users/catsoft/desktop/geolocation/platforms/ios/cordova/build: Command failed with exit code 2
You may not have the required environment or OS to build this project
Error: /Users/catsoft/desktop/geolocation/platforms/ios/cordova/build: Command failed with exit code 2
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:139:23)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:818:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)

No signs of life and no error either

Hello,

I try to use your plugin in my cordova app on iPhone. I compile it on remote mac and install IPA on real device - iPhone 5c. I installed the plugin from git. Below is my test code. I can't get ANY response - no alert, nothing on js console, no js error, just simply nothing at all. Before and after execution of this code everything works fine. The code is triggered by a button press. It's after deviceReady. I use window.onerror = someFunction to capture js errors - nothing there too. The app has "location: always" access rights.

When I use
gpsWatch = navigator.geolocation.watchPosition(saveGpsPoint, silentFail, geolocationOptions);
then everything works fine, but only in foreground, and I need to receive gps location also when in background.

` backgroundGeoLocation.getLocations(function(location) {
alert("getLocations: " + JSON.stringify(location));
});

backgroundGeoLocation.watchLocationMode(function(location) {
    alert("getLocations: " + JSON.stringify(location));
});

backgroundGeoLocation.onStationary(function(location) {
    alert("onStationary: " + JSON.stringify(location));
});

backgroundGeoLocation.configure(function(location) {
    alert("configure ok: " + JSON.stringify(location));
    backgroundGeoLocation.finish();
}, function(msg) {
    alert("configure fail: " + JSON.stringify(msg));
}, {
    desiredAccuracy: 10,
    stationaryRadius: 15,
    distanceFilter: 20,
    stopOnTerminate: false,
    locationTimeout: 30,
    notificationTitle: 'TripTrack',
    notificationText: 'Recording trip',
    locationService: 0,
    activityType: 'AutomotiveNavigation',
    fastestInterval: 5000,
    activitiesInterval: 10000
});

backgroundGeoLocation.start();

backgroundGeoLocation.isLocationEnabled(function(location) {
    alert("isLocationEnabled: " + JSON.stringify(location));
});

backgroundGeoLocation.changePace(true);

`

Ionic app $http.post

Hey,

I would like to know how can I use $http.post to send GPS coordinates to my server. Without using jQuery. I've tried it but when I start the app, it sends nothing.

Thanks.

Start up on boot

In order for an app like this can be really complete, it should consider entering the geolocation service to the start up of the device in the background, without having to manually start the app.

It would be difficult to do this, remaining within cordova, ie without writing native code?

Thank you

Error on Samsung Galaxy S4 Mini at setColor

Firstly: Great plugin!
Unfortunately I have a problem using the plugin (version 0.4.3) with a Samsung Galaxy S4 mini running Android 4.4.4.

Once I start the background geolocation service, the app chrashes with the following error:

java.lang.NoSuchMethodError: android.app.Notification$Builder.setColor
    at com.marianhello.cordova.bgloc.LocationUpdateService.onStartCommand(LocationUpdateService.java:232)
    at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2989)
    at android.app.ActivityThread.access$2200(ActivityThread.java:174)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1404)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:146)
    at android.app.ActivityThread.main(ActivityThread.java:5593)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
    at dalvik.system.NativeStart.main(Native Method)

After some research, I think the problem is caused by the following line <-click me->

As the setColor-function was introduced in API level 21, this might not be available for devices running on Android 4.4.4, which is API level 19 and 20.

Is this issue known? Or maybe it is just a problem with my device?
Thans a lot!

Android: clicking the notification starts the app new

I found a problem with the notification on android.

In the original Version of the plugin a click on the "background-notification" has no effect.
In your Version a click opens my app, but the app starts new.
A click on my app in app-drawer just brings the app from the background to the foreground.
But a "notification-click" starts my app completely new, wich needs a few seconds.

Is this fixable? Or is there a way to disable the click functionality on the notification on android?

Thanks for your answer
Bastian

PhonegapBuild gives build error

The -phonegapbuild version of the plugin, does not build with cradle,
maybe some incompatibility with one of the other plugins?

My configured plug-ins:

<gap:plugin name="cordova-plugin-battery-status" version="1.1.0" source="npm" />
<gap:plugin name="cordova-plugin-camera" version="1.2.0" source="npm" />
<gap:plugin name="cordova-plugin-file" version="3.0.0" source="npm" />
<gap:plugin name="cordova-plugin-device" version="1.0.1" source="npm" />
<gap:plugin name="cordova-plugin-geolocation" version="1.0.1" source="npm" />

<gap:plugin name="cordova-plugin-inappbrowser" version="1.0.1" source="npm"/>
<gap:plugin name="cordova-plugin-splashscreen" version="2.1.0" source="npm" />
<gap:plugin name="cordova-plugin-media" version="1.0.1" source="npm" />
<gap:plugin name="cordova-plugin-network-information" version="1.0.1" source="npm" />

<gap:plugin name="phonegap-plugin-barcodescanner" version="4.1.0" source="npm" />

<!--Temperary only iOS, see issue: http://community.phonegap.com/nitobi/topics/cordova-plugin-push-notification-failed-with-gradle-android?rfm=1 -->
<gap:plugin name="cordova-plugin-push-notification" version="2.5.2" source="npm" gap:platform="ios" />
<gap:plugin name="cordova-plugin-statusbar" version="1.0.1" source="npm" />

<gap:plugin name="cordova-plugin-powermanagement" version="1.0.1" source="npm" />
<gap:plugin name="cordova-plugin-whitelist" version="1.0.0" source="npm" />
<gap:plugin name="cordova-plugin-mauron85-background-geolocation-phonegapbuild" version="0.7.3" source="npm" />
<gap:plugin name="cordova-plugin-keyboard" version="1.1.2" source="npm" />

My other settings:
<gap:platform name="android" />
<preference name="webviewbounce" value="false" />
<preference name="phonegap-version" value="cli-5.2.0" />
<preference name="detect-data-types" value="false" />
<preference name="stay-in-webview" value="false" />
<preference name="exit-on-suspend" value="false" />
<preference name="KeepRunning" value="true" />
<preference name="android-windowSoftInputMode" value="adjustPan" />
<preference name="KeyboardShrinksView" value="false" />
<preference name="orientation" value="both" />
<preference name="show-splash-screen-spinner" value="false" />
<preference name="auto-hide-splash-screen" value="false" />
<preference name="splash-screen-duration" value="2500" />
<preference name="fullscreen" value="true" />
<preference name="prerendered-icon" value="true" />
<preference name="load-url-timeout" value="75000" />
<preference name="android-build-tool" value="gradle" />
<preference name="StatusBarOverlaysWebView" value="false" />
<preference name="BackupWebStorage" value="cloud"/>
<preference name="KeyboardDisplayRequiresUserAction" value="false"/>
<preference name="SuppressesIncrementalRendering" value="true"/>
<gap:config-file platform="android" parent="/manifest/application">
<activity android:launchMode="singleTop" />
</gap:config-file>

Phonegap build log:

Build Date: 2015-11-26 14:46:14 +0000

Running: /project/gradlew cdvBuildRelease -b /project/build.gradle -Dorg.gradle.daemon=true -x lintVitalRelease
:preBuild
:compileReleaseNdk
:preReleaseBuild
:checkReleaseManifest
:CordovaLib:compileLint
:CordovaLib:copyReleaseLint UP-TO-DATE
:CordovaLib:mergeReleaseProguardFiles
:CordovaLib:preBuild
:CordovaLib:preReleaseBuild
:CordovaLib:checkReleaseManifest
:CordovaLib:prepareReleaseDependencies
:CordovaLib:compileReleaseAidl
:CordovaLib:compileReleaseRenderscript
:CordovaLib:generateReleaseBuildConfig
:CordovaLib:generateReleaseAssets UP-TO-DATE
:CordovaLib:mergeReleaseAssets
:CordovaLib:generateReleaseResValues
:CordovaLib:generateReleaseResources
:CordovaLib:packageReleaseResources
:CordovaLib:processReleaseManifest
:CordovaLib:processReleaseResources
:CordovaLib:generateReleaseSources
:CordovaLib:compileReleaseJavaNote: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

:CordovaLib:processReleaseJavaRes UP-TO-DATE
:CordovaLib:packageReleaseJar
:CordovaLib:compileReleaseNdk
:CordovaLib:packageReleaseJniLibs UP-TO-DATE
:CordovaLib:packageReleaseLocalJar UP-TO-DATE
:CordovaLib:packageReleaseRenderscript UP-TO-DATE
:CordovaLib:bundleRelease
:prepareProjectCordovaLibUnspecifiedReleaseLibrary
:prepareReleaseDependencies
:compileReleaseAidl
:compileReleaseRenderscript
:generateReleaseBuildConfig
:generateReleaseAssets UP-TO-DATE
:mergeReleaseAssets
:generateReleaseResValues
:generateReleaseResources
:mergeReleaseResources
:processReleaseManifest
:processReleaseResourceswarning: string 'menu_settings' has no default translation.

:generateReleaseSources
:compileReleaseJava/project/src/com/tenforwardconsulting/cordova/bgloc/AbstractLocationService.java:14: error: package android.support.v4.app does not exist
import android.support.v4.app.NotificationCompat;
^
/project/src/com/tenforwardconsulting/cordova/bgloc/AbstractLocationService.java:120: error: package NotificationCompat does not exist
protected NotificationCompat.Builder setClickEvent (NotificationCompat.Builder builder) {
^
/project/src/com/tenforwardconsulting/cordova/bgloc/AbstractLocationService.java:120: error: package NotificationCompat does not exist
protected NotificationCompat.Builder setClickEvent (NotificationCompat.Builder builder) {
^
/project/src/com/tenforwardconsulting/cordova/bgloc/AbstractLocationService.java:88: error: package NotificationCompat does not exist
NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
^
/project/src/com/tenforwardconsulting/cordova/bgloc/AbstractLocationService.java:88: error: package NotificationCompat does not exist
NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /project/src/org/apache/cordova/file/AssetFilesystem.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
5 errors
FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':compileReleaseJava'.
    > 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: 8.219 secs

/project/cordova/node_modules/q/q.js:126
throw e;
^
Error code 1 for command: /project/gradlew with args: cdvBuildRelease,-b,/project/build.gradle,-Dorg.gradle.daemon=true,-x,lintVitalRelease

Could not compile sample app

Hello,

This is more or less a question, I was able to compile the sample app for iOS but not for android, perhaps I am missing something. The build on android throws this error - Could not resolve all dependencies for configuration ':_debugCompile'. Could not find any version that matches com.google.android.gms:play-services-location:+.

Please what do you think?

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.