PWLocationManager Protocol Reference

Conforms to NSObject
Declared in PWLocationManager.h

Overview

The PWLocationManager protocol defines the methods used to create a location manager. This location manager is typically used with indoor location providers.

Other Methods

  floorIDMapping required method

The floor ID mapping dictionary used to define the mapping between the location provider floor ID and the Phunware floor ID. The dictionary format must adhere to the following format: @{CUSTOMER_FLOORID : PHUNWARE_FLOOR_ID}.

@property (nonatomic, strong) NSDictionary *floorIDMapping

Declared In

PWLocationManager.h

  location required method

The most recently retrieved indoor location.

@property (nonatomic, readonly) PWIndoorLocation *location

Discussion

The value of this property is nil if no location data has ever been retrieved.

Declared In

PWLocationManager.h

Determining Availability of Services

– locationServicesAvailable required method

Returns a Boolean value indicating whether location services are enabled on the device.

- (BOOL)locationServicesAvailable

Discussion

In order to fetch the user’s location, the manager must be within proximity of the venue and have retrieved specific device information from Phunware’s servers.

Declared In

PWLocationManager.h

Initiating Location Updates

– startUpdatingLocation required method

Starts the generation of updates that report the user’s current location.

- (void)startUpdatingLocation

Discussion

This method returns immediately. Calling this method causes the location manager to obtain an initial location fix (which may take several seconds) and notify your delegate by calling its locationManager:didUpdateToLocation: method.

Declared In

PWLocationManager.h

– stopUpdatingLocation required method

Stops the generation of location updates.

- (void)stopUpdatingLocation

Discussion

Call this method whenever your code no longer needs to receive location-related events. Disabling event delivery gives the receiver the option of disabling the appropriate hardware (and thereby saving power) when no clients need location data. You can always restart the generation of location updates by calling the startUpdatingLocation method again.

Declared In

PWLocationManager.h

  delegate required method

The PWLocationManagerDelegate protocol defines the methods used to receive location updates from an object that subscribes to the PWLocationManager protocol.

@property (nonatomic, weak) id<PWLocationManagerDelegate> delegate

Discussion

The methods of your delegate object are always called from the main application thread.

Declared In

PWLocationManager.h