Skip to content

Commit

Permalink
Merge pull request #123 from dcortright/add_activity_type
Browse files Browse the repository at this point in the history
feat: added ability to specify the activity type if needed
  • Loading branch information
lwdupont authored Oct 9, 2019
2 parents 95b93ae + 5f65e41 commit 91869f6
Show file tree
Hide file tree
Showing 9 changed files with 324 additions and 90 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ os: osx
cache: cocoapods
xcode_workspace: LocationManager/LocationManager.xcworkspace
xcode_scheme: LocationManagerExample
xcode_sdk: iphonesimulator11.0
osx_image: xcode9
xcode_sdk: iphonesimulator12.0
osx_image: xcode10
podfile: LocationManager/Podfile

before_install:
Expand All @@ -14,7 +14,7 @@ before_install:
- gem install cocoapods
- pod repo update

script: set -o pipefail && xcodebuild test -workspace LocationManager/LocationManager.xcworkspace -scheme LocationManagerExample -destination 'platform=iOS Simulator,name=iPhone 8 Plus,OS=11.0'
script: set -o pipefail && xcodebuild test -workspace LocationManager/LocationManager.xcworkspace -scheme LocationManagerExample -destination 'platform=iOS Simulator,name=iPhone 8 Plus,OS=12.0'

after_success:
slather
44 changes: 41 additions & 3 deletions LocationManager/INTULocationManager/INTULocationManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,43 @@ NS_ASSUME_NONNULL_BEGIN

/**
Asynchronously requests the current location of the device using location services.
@param desiredAccuracy The accuracy level desired (refers to the accuracy and recency of the location).
@param timeout The maximum amount of time (in seconds) to wait for a location with the desired accuracy before completing. If
@param timeout The maximum amount of time (in seconds) to wait for a location with the desired accuracy before completing. If
this value is 0.0, no timeout will be set (will wait indefinitely for success, unless request is force completed or canceled).
@param block The block to execute upon success, failure, or timeout.
@return The location request ID, which can be used to force early completion or cancel the request while it is in progress.
*/
- (INTULocationRequestID)requestLocationWithDesiredAccuracy:(INTULocationAccuracy)desiredAccuracy
timeout:(NSTimeInterval)timeout
block:(INTULocationRequestBlock)block;

/**
Asynchronously requests the current location of the device using location services, optionally delaying the timeout countdown until the user has
responded to the dialog requesting permission for this app to access location services.
@param desiredAccuracy The accuracy level desired (refers to the accuracy and recency of the location).
@param timeout The maximum amount of time (in seconds) to wait for a location with the desired accuracy before completing. If
this value is 0.0, no timeout will be set (will wait indefinitely for success, unless request is force completed or canceled).
@param delayUntilAuthorized A flag specifying whether the timeout should only take effect after the user responds to the system prompt requesting
permission for this app to access location services. If YES, the timeout countdown will not begin until after the
app receives location services permissions. If NO, the timeout countdown begins immediately when calling this method.
@param block The block to execute upon success, failure, or timeout.
@return The location request ID, which can be used to force early completion or cancel the request while it is in progress.
*/
- (INTULocationRequestID)requestLocationWithDesiredAccuracy:(INTULocationAccuracy)desiredAccuracy
timeout:(NSTimeInterval)timeout
delayUntilAuthorized:(BOOL)delayUntilAuthorized
block:(INTULocationRequestBlock)block;

/**
Asynchronously requests the current location of the device using location services, optionally delaying the timeout countdown until the user has
responded to the dialog requesting permission for this app to access location services.
@param desiredAccuracy The accuracy level desired (refers to the accuracy and recency of the location).
@param desiredActivityType The activity type desired, which controls when/if pausing occurs.
@param timeout The maximum amount of time (in seconds) to wait for a location with the desired accuracy before completing. If
this value is 0.0, no timeout will be set (will wait indefinitely for success, unless request is force completed or canceled).
@param delayUntilAuthorized A flag specifying whether the timeout should only take effect after the user responds to the system prompt requesting
Expand All @@ -82,6 +102,7 @@ NS_ASSUME_NONNULL_BEGIN
@return The location request ID, which can be used to force early completion or cancel the request while it is in progress.
*/
- (INTULocationRequestID)requestLocationWithDesiredAccuracy:(INTULocationAccuracy)desiredAccuracy
desiredActivityType:(CLActivityType)desiredActivityType
timeout:(NSTimeInterval)timeout
delayUntilAuthorized:(BOOL)delayUntilAuthorized
block:(INTULocationRequestBlock)block;
Expand All @@ -102,15 +123,32 @@ NS_ASSUME_NONNULL_BEGIN
Creates a subscription for location updates that will execute the block once per update indefinitely (until canceled), regardless of the accuracy of each location.
The specified desired accuracy is passed along to location services, and controls how much power is used, with higher accuracies using more power.
If an error occurs, the block will execute with a status other than INTULocationStatusSuccess, and the subscription will be canceled automatically.
@param desiredAccuracy The accuracy level desired, which controls how much power is used by the device's location services.
@param block The block to execute every time an updated location is available. Note that this block runs for every update, regardless of
whether the achievedAccuracy is at least the desiredAccuracy.
The status will be INTULocationStatusSuccess unless an error occurred; it will never be INTULocationStatusTimedOut.
@return The location request ID, which can be used to cancel the subscription of location updates to this block.
*/
- (INTULocationRequestID)subscribeToLocationUpdatesWithDesiredAccuracy:(INTULocationAccuracy)desiredAccuracy
block:(INTULocationRequestBlock)block;

/**
Creates a subscription for location updates that will execute the block once per update indefinitely (until canceled), regardless of the accuracy of each location.
The specified desired accuracy is passed along to location services, and controls how much power is used, with higher accuracies using more power.
If an error occurs, the block will execute with a status other than INTULocationStatusSuccess, and the subscription will be canceled automatically.
@param desiredAccuracy The accuracy level desired, which controls how much power is used by the device's location services.
@param desiredActivityType The activity type desired, which controls when/if pausing occurs.
@param block The block to execute every time an updated location is available. Note that this block runs for every update, regardless of
whether the achievedAccuracy is at least the desiredAccuracy.
The status will be INTULocationStatusSuccess unless an error occurred; it will never be INTULocationStatusTimedOut.
@return The location request ID, which can be used to cancel the subscription of location updates to this block.
*/
- (INTULocationRequestID)subscribeToLocationUpdatesWithDesiredAccuracy:(INTULocationAccuracy)desiredAccuracy
desiredActivityType:(CLActivityType)desiredActivityType
block:(INTULocationRequestBlock)block;

/**
Expand Down
Loading

0 comments on commit 91869f6

Please sign in to comment.