- Print
- DarkLight
Location-Based Functionality for the ADP
Summary
The Attraction Detail Page (ADP) has the ability to display results that are occurring near a fans desired location, along with other events occurring for the selected Attraction.
Note: On Android, the TMPrePurchaseNavigationListener interface MUST be implemented as your app is required to request location permissions from your users and interact with the location callbacks available to you (onDidRequestCurrentLocation and onDidUpdateCurrentLocation)
Features
Fans can view events at either current location or any other desired location by entering city or zip code. To provide the fan with an optimal experience with regards to location for event selection, the integrating app needs to ensure that they have obtained the fan's permission to access their location and provide the location to the PrePurchase SDK using our provided callbacks.
Location flow:
When the user clicks on the location from ADP, that is highlighted in image, they are presented with 2 options to change the location from ADP
- Manually entering city/zipcode
- Using current location
Manually entering city/zipcode
Whenever the user changes location manually by entering city/zip code from ADP, SDK informs your app with the following callback:
func prePurchaseViewController(_ viewController: TMPrePurchaseViewController, didChangeLocationTo location: MarketLocation)
/* * Current Location Updated by user */
public fun onDidUpdateCurrentLocation( globalMarketDomain: TMMarketDomain?, location: Location )
Using current location
When user selects "current location" from the location popup, SDK informs your app with the following callback:
func prePurchaseViewControllerDidRequestCurrentLocation(_ viewController: TMPrePurchaseViewController) }
/* * Current Location Requested by user * Obtain necessary permissions * return location as string */
public fun onDidRequestCurrentLocation( globalMarketDomain: TMMarketDomain?, completion: (CoordinatesWithMarketDomain) -> Unit )
Location Public Methods
TMPrePurchaseViewController {
// Used to tell the SDK of new latitude and longitude, possibly obtained using GPS
public func changeLocation(coordinate: CLLocationCoordinate2D)
// Used to tell the SDK that the app has failed to obtain the GPS location
// This is so we can dismiss the spinner that comes up when the location is in the process of being resolved by the device
public func communicateLocationFetchError() }
public interface TMPrePurchaseNavigationListener : Serializable {
…
/* * Current Location Requested by user * Obtain necessary permissions * return location as string */
public fun onDidRequestCurrentLocation( globalMarketDomain: TMMarketDomain?, completion: (CoordinatesWithMarketDomain) -> Unit )
/* * Current Location Updated by user */
public fun onDidUpdateCurrentLocation( globalMarketDomain: TMMarketDomain?, location: Location )
}