TKUITripMonitorManager
@available(iOS 14.0, *)
@MainActor
public class TKUITripMonitorManager : NSObject, ObservableObject
The manager for trip notifications such as “get off at the next stop” or “your trip is about to start”
Requirements:
- Project > Your Target > Capabilities > Background Modes: Enable “Location Updates”
- Project > Your Target > Info: Include both
NSLocationAlwaysAndWhenInUseUsageDescription
andNSLocationWhenInUseUsageDescription
- Then call
TKUINotificationManager.shared.subscribe(to: .tripAlerts) { ... }
in your app. - Implement
TKUINotificationManagerDelegate
and set it onTKUINotificationManager.shared.delegate
Push notifications:
An additional feature is server-side notifications related to a trip being monitored. This requires additional set-up:
- Lastly, call
TKUINotificationManager.shared.subscribe(to: .pushNotifications) { _ in }
-
Will be set on
UNNotificationRequest.content.categoryIdentifier
These notifications will also get
UNNotificationRequest.identifier
set toTKAPI.TripNotification.id
Declaration
Swift
nonisolated public static let tripNotificationCategoryIdentifier: String
-
Undocumented
Declaration
Swift
@objc(sharedInstance) public static let shared: TKUITripMonitorManager
-
monitorRegions(from:
AsynchronousincludeTimeToLeaveNotification: ) Undocumented
Declaration
Swift
@MainActor public func monitorRegions(from trip: Trip, includeTimeToLeaveNotification: Bool = true) async throws
-
stopMonitoring()
AsynchronousUndocumented
Declaration
Swift
public func stopMonitoring() async
-
Undocumented
See moreDeclaration
Swift
public struct GeofenceMatch
-
Undocumented
Declaration
Swift
public func match(geofenceID: String) -> GeofenceMatch?