iOS and Cordova for geolocation tracking and monitorSignificantLocationChanges and other questions -


I write a Cordova plugin for background tracking in iOS, I understand the following:

  • I use startupdatingLocation to begin tracking
  • This location will send that my app is in the foreground or in the background
  • if I have background Take a moment to position and process it, iOS
  • For this reason I will also use startMonitoringSignificantLocationChanges Slia if my app is executed will open IOS then didFinishLaunchingWithOptions

That's right?

I also have two other questions:

Monitoring important location changes

I call startMonitoringSignificantLocationChanges If killed then my app relaunches. I have read that in this case, the latest position method has been given in the given options, but to keep the geographical location again to both startupdating location and startMonitoringSignificantLocationChanges Calling is coming, is this right?

In addition, if we have to call startupdatingLocation , and (I assume) it creates a new call to the location handler with the latest location, Instead of using the didFinishLaunchingWithOptions method, a point to using the given space as a parameter?

It seems that the same processing function in two parts of this code is therefore redundant (I believe that location processing is also done in the handler because it was killed before the purpose of the app Was - only a case that I think is geofenci ng apps that only need to be aware of a particular place without restarting it didFinishLaunchingWithOptions startupdatingLocation Without Tracking the user is the reason why this option is given?)

Now the question is: There is a way when writing straight to the Cordova plugin startUpdatingLocation and startMonitoringSignificantChanges < / Code> to call back didFinishLaunchingWithOptions for a handler method? Or is the only way to hear plugin related notifications?

The Javascript event

plugin when processing a geooconce calls a JavaScript event when it receives a location in the foreground or the background. However, this javascript code can run animation with some functions such as timer, etc. I want to see that the execution of Cordova will be better if it can cause a delay which causes the app to be killed if for example Geolocation starts a JavaScript timer which runs animation for a very long time Is this the application running and triggers the IOS watchdog, or is it run in the Piduguitous Thread?

For example, if I run an AngesSpeed ​​API, it responds to a new location, what happens after AngularJS is running, this is an automatically running loop, will the application be killed forever because AngularJS is seeing variables for constant change etc; When the app is in the background, I have to tell Angulus to close my run loop?

Specifically, what if I want to send an HTTP request from asynchronous on a server? Will Cordoba run JS in the background or will I have to wait for a certain incident, as if the JS code requests and tells Cordoba that Cordoba can finish the background?

I have created the Cordova plugin that handles it.

Yes, you have to be careful to execute your javascript in any background-thread callback and javascript in the original text is signal back , when it ends at its conclusion (For example after an async request on the server) so that the native side can kill the thread.


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -