iOS 7 and IOS Background Location Enabler

  • 1
  • Praise
  • Updated 7 years ago
May I just say, WOW!

I added this plugin to my PGB 3.1.0 migration test build,

and now... My application keeps running, sending messages through the websocket and Ajax conections to my backoffice.

Including of course GPS positions and all other business data.

This is truly great!

Am I missing something or is this not something I can trust upon to continue to work in future versions?

I notice that when I open a browser, play a video, then switch tasks to the MAPS application, plan a route, it all keeps working, except that when my app tries to play a sound for an incoming chatmessage, this is only heard once switched back to the application itself.

Is there a solution for this, or do I have to wait for the localNotifications plugin to become available for 3.1.0 ?

Praise!
Photo of rene.vaessen

rene.vaessen

  • 114 Posts
  • 4 Reply Likes
  • happy like puppy

Posted 7 years ago

  • 1
Photo of rene.vaessen

rene.vaessen

  • 114 Posts
  • 4 Reply Likes
It would be great if we can set an option that allows the Media.play() function to play sounds in the background?

I tried .play({ playAudioWhenScreenIsLocked: true });

But that isn't working either, I think it needs some authorization with some flag somewhere in the package.

PhoneGap Build support, can you add that please?
Photo of Wayne Gardner

Wayne Gardner

  • 2 Posts
  • 0 Reply Likes
Could I ask you for a detailed description of your setup using PG 3.1.0 with the backgroundlocationenabler plugin. I want to be able to send GPS positions in the background continuously. How can I test the plugin is working, then ensure it runs and makes calls to my jSON/ Ajax interface (currently enbedding in my onDeviceReady).

function onDeviceReady() {
startWatch();
function startWatch() {
var options = { enableHighAccuracy: true, timeout: 3100, maximumAge: 0 };
watchID = navigator.geolocation.watchPosition(onSuccess, onError, options);
timerID = setInterval ( updateLocation, 3000 );
}
.
.

Cheers,
Wayne
Sydney Australia
Photo of Pablo Gómez Margareto

Pablo Gómez Margareto

  • 1 Post
  • 0 Reply Likes
Hi Rene,

I am trying the plugin, but I am not sure how it works.

I would need to know my position even when the app is in background. Then lets say I want to print or send my position to a server.

Can I do that from the Javascript function? Could you show us an example?

Thanks a lot in advance for your helP!