diff --git a/apple/common/RAGameView.m b/apple/common/RAGameView.m index 36cb2297f4..3941b3e4a8 100644 --- a/apple/common/RAGameView.m +++ b/apple/common/RAGameView.m @@ -20,6 +20,10 @@ #include "gfx/gfx_common.h" #include "gfx/gfx_context.h" +#include + +static CLLocationManager *locationManager; + // Define compatibility symbols and categories #ifdef IOS #include @@ -308,6 +312,34 @@ didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer } #endif +- (void)onLocationInit +{ + // Create the location manager if this object does not + // already have one. + if (nil == locationManager) + locationManager = [[CLLocationManager alloc] init]; + + locationManager.delegate = self; + locationManager.desiredAccuracy = kCLLocationAccuracyKilometer; + + // Set a movement threshold for new events. + locationManager.distanceFilter = 500; // meters - TODO - make configurable +} + +- (void)onLocationStart +{ + [locationManager startUpdatingLocation]; +} + +- (void)onLocationStop +{ + [locationManager stopUpdatingLocation]; +} + +- (void)onLocationFree +{ +} + @end static RAScreen* get_chosen_screen()