- Home /
Question by
flyingaudio · Feb 15, 2014 at 07:23 PM ·
u3dxt
Significant-Change Location Service App Wakeup
In U3DXT iOS SDK, does any one know how to set up the delegate for Significant-Change Location Service, so my method responds to a location change?
Comment
Best Answer
Answer by u3dxt · Feb 18, 2014 at 03:35 AM
void Init() {
// make sure to keep it as a member variable
manager = new CLLocationManager();
manager.DidUpdateLocations += delegate(object sender, CLLocationManager.DidUpdateLocationsEventArgs e){
CLLocation location = e.locations[e.locations.Length-1] as CLLocation
Debug.Log("current location coordinates: " + location.coordinate);
};
}
void StartMonitor() {
if (!CLLocationManager.LocationServicesEnabled() || !CLLocationManager.SignificantLocationChangeMonitoringAvailable()) {
Debug.Log("Significant change monitoring not available.");
} else {
manager.StartMonitoringSignificantLocationChanges();
}
}
Your answer