Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cordova-plugin-background-geolocation
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Aksimaya
cordova-plugin-background-geolocation
Commits
f56d47bd
Commit
f56d47bd
authored
Jul 29, 2014
by
Chris Scott
Browse files
Options
Browse Files
Download
Plain Diff
Merge sig-changes always ON
parents
975f77d6
16309141
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
CDVBackgroundGeoLocation.m
src/ios/CDVBackgroundGeoLocation.m
+12
-7
No files found.
src/ios/CDVBackgroundGeoLocation.m
View file @
f56d47bd
...
...
@@ -87,7 +87,7 @@
// UNUSED ANDROID VARS
//params = [command.arguments objectAtIndex: 0];
//headers = [command.arguments objectAtIndex: 1];
//url = [command.arguments object
//url = [command.arguments object
AtIndex: 2];
stationaryRadius
=
[[
command
.
arguments
objectAtIndex
:
3
]
intValue
];
distanceFilter
=
[[
command
.
arguments
objectAtIndex
:
4
]
intValue
];
locationTimeout
=
[[
command
.
arguments
objectAtIndex
:
5
]
intValue
];
...
...
@@ -183,6 +183,7 @@
NSLog
(
@"- CDVBackgroundGeoLocation start (background? %d)"
,
state
);
[
locationManager
startMonitoringSignificantLocationChanges
];
if
(
state
==
UIApplicationStateBackground
)
{
[
self
setPace
:
isMoving
];
}
...
...
@@ -282,7 +283,6 @@
{
NSLog
(
@"- CDVBackgroundGeoLocation resume"
);
if
(
enabled
)
{
[
locationManager
stopMonitoringSignificantLocationChanges
];
[
locationManager
stopUpdatingLocation
];
}
}
...
...
@@ -496,6 +496,12 @@
}
if
(
isMoving
)
{
isAcquiringSpeed
=
YES
;
speedAcquisitionAttempts
=
0
;
locationManager
.
distanceFilter
=
distanceFilter
;
// Power-up the GPS temporarily until we get a good speed sample.
locationManager
.
desiredAccuracy
=
kCLLocationAccuracyBest
;
[
locationManager
startUpdatingLocation
];
}
else
{
isAcquiringStationaryLocation
=
YES
;
}
...
...
@@ -517,15 +523,14 @@
if
(
stationaryRegion
!=
nil
)
{
[
locationManager
stopMonitoringForRegion
:
stationaryRegion
];
}
[
locationManager
startMonitoringSignificantLocationChanges
];
isAcquiringStationaryLocation
=
NO
;
[
locationManager
stopUpdatingLocation
];
locationManager
.
distanceFilter
=
distanceFilter
;
locationManager
.
desiredAccuracy
=
desiredAccuracy
;
stationaryRegion
=
[[
CLCircularRegion
alloc
]
initWithCenter
:
coord
radius
:
stationaryRadius
identifier
:
@"BackgroundGeoLocation stationary region"
];
stationaryRegion
.
notifyOnExit
=
YES
;
[
locationManager
startMonitoringForRegion
:
stationaryRegion
];
locationManager
.
distanceFilter
=
distanceFilter
;
locationManager
.
desiredAccuracy
=
desiredAccuracy
;
[
locationManager
stopUpdatingLocation
];
}
// If you don't stopMonitorying when application terminates, the app will be awoken still when a
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment