QPEngine
@objc
public class QPEngine : NSObject
Main class used by clients to integrate QuandoPasso SDK functionalities in their apps.
-
Returns the current Device ID, as returned by iOS
Declaration
Swift
public static var deviceID: String { get } -
Declaration
Swift
public var locationManager: CLLocationManager! -
Declaration
Swift
public var latestKnownLocation: CLLocation? { get } -
Declaration
Swift
public weak var delegate: QPManagerDelegate? -
Declaration
Swift
public var metricsManager: MetricsManager! -
Initialise a
QPEngineinstance with the providedQPSettingsparamsDeclaration
Swift
public init(settings: QPSettings)Parameters
settingsThe
QPSettingsinstance, containing the configuration parameters.Return Value
The initialised
QPEngineinstance.
-
Initialise and start all required services, like GPS updates.
Declaration
Swift
public func start() -
Shows the user the required permission popups
Declaration
Swift
public func askPermission() -
Fetch the list of nearby vSigns from the API
Declaration
Swift
public func fetchSignals(near: CLLocationCoordinate2D, completed: (() -> Void)? = nil) -
Forces an API call to update the list of nearby vSigns. Mainly used to debug and troubleshooting, but can be used to trigger an immediate API call without waiting for the scheduled ones.
Declaration
Swift
public func forceFetchSignals() -
Forces an API call to update the list of nearby vSigns. Mainly used to debug and troubleshooting, but can be useful to perform an immediate match, bypassing the scheduler.
Declaration
Swift
public func forceVSignScan() -
Clears the notification statuses for all known vSigns
Declaration
Swift
public func resetSignalsNotificationStatus()
-
Delegate method called by the GPS module when the current location has been updated.
Declaration
Swift
public func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) -
Delegate method called when a monitored geofence location is exited. Geofences are used to determine when we need to fetch vSigns from the APIs, i.e. when we exit from the area covered by the radius we pass when fetching the vsigns.
Declaration
Swift
public func locationManager(_ manager: CLLocationManager, didExitRegion region: CLRegion) -
Delegate method called when GPS updates are suspended by the system, commonly after a period of inactivity.
Declaration
Swift
public func locationManagerDidPauseLocationUpdates(_ manager: CLLocationManager) -
Delegate method called when the GPS permissions are updated by the user, for example by going into System Settings and manually revoke them.
Declaration
Swift
public func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus)
-
Declaration
Swift
public func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void)
-
Declaration
Swift
public static func trackAnalyticsEvent(_ type: String, props: [String : String] = [:]) -
Tracks the app opened event
Declaration
Swift
public static func trackAppOpened() -
Tracks when the application is returned to foreground
Declaration
Swift
public static func trackAppBecameActive() -
Tracks when the application is moved into background
Declaration
Swift
public static func trackAppInBackground() -
Tracks when the application is terminated
Declaration
Swift
public static func trackAppTerminated()
QPEngine Class Reference