CSLocationPermissionProtocol Protocol Reference
Conforms to | NSObject |
---|---|
Declared in | CSLocationPermissionProtocol.h |
Overview
Protocol that any object requesting location permissions through the CSSensePlatform should implement. After the user grants or denies permissions, one of these functions will be called on your object.
Below an example of how this could be implemented in a view object:
@interface TourViewController : UIViewController
@implementation TourViewController
(IBAction)handlePermissionButtonClick:(id)sender { [CSSensePlatform requestLocationPermissionWithDelegate: self]; }
(void) locationPermissionGranted { [self refreshView]; }
(void) locationPermissionDenied { [self refreshView]; }
(void)viewDidLoad { [super viewDidLoad]; [self refreshView]; }
(void) refreshView { CLAuthorizationStatus status = [CSSensePlatform locationPermissionState]; switch (status) { case kCLAuthorizationStatusAuthorizedAlways: break; case kCLAuthorizationStatusDenied: break; case kCLAuthorizationStatusNotDetermined: break; default: break; } }
@end
– locationPermissionGranted
required method
Callback that will be called in the event the user grants location updates permission.
- (void)locationPermissionGranted
Declared In
CSLocationPermissionProtocol.h
– locationPermissionDenied
required method
Callback that will be called in the event the user denies location updates permission.
- (void)locationPermissionDenied
Declared In
CSLocationPermissionProtocol.h