Commit 8fa3d817 authored by Chris Scott's avatar Chris Scott

Update for PhoneGap 3

parent 0c34989d
......@@ -5,7 +5,7 @@
//
#import <Cordova/CDVPlugin.h>
#import <Cordova/CDVLocation.h>
#import "CDVLocation.h"
@interface CDVBackgroundGeoLocation : CDVPlugin <CLLocationManagerDelegate>
- (void) configure:(CDVInvokedUrlCommand*)command;
......@@ -20,7 +20,6 @@
@property(nonatomic,assign) BOOL enabled;
@property(nonatomic,retain) NSNumber *maxBackgroundHours;
@property (nonatomic, strong) CLLocationManager* locationManager;
@property (strong) CDVHeadingData* headingData;
@property (nonatomic, strong) CDVLocationData* locationData;
@property (strong) NSMutableArray *locationCache;
@property (nonatomic, retain) NSDate *suspendedAt;
......
......@@ -4,13 +4,13 @@
// Created by Chris Scott <chris@transistorsoft.com> on 2013-06-15
// Largely based upon http://www.mindsizzlers.com/2011/07/ios-background-location/
//
#import "CDVLocation.h"
#import "CDVBackgroundGeoLocation.h"
#import <Cordova/CDVJSON.h>
@implementation CDVBackgroundGeoLocation
@synthesize enabled, token, url, locationManager, locationData, headingData, locationCache, suspendedAt;
@synthesize enabled, token, url, locationManager, locationData, locationCache, suspendedAt;
- (CDVPlugin*) initWithWebView:(UIWebView*) theWebView
{
......@@ -30,7 +30,7 @@
}
- (void) configure:(CDVInvokedUrlCommand*)command
{
self.locationManager = [[[CLLocationManager alloc] init] autorelease];
self.locationManager = [[CLLocationManager alloc] init];
self.locationManager.delegate = self;
self.token = [command.arguments objectAtIndex: 0];
......@@ -177,15 +177,7 @@
- (void)dealloc
{
locationManager.delegate = nil;
[token release];
[url release];
[locationManager release];
[locationData release];
[headingData release];
[locationCache release];
[suspendedAt release];
[super dealloc];
self.locationManager.delegate = nil;
}
@end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment