Skip to content

Instantly share code, notes, and snippets.

@tssandor
Created February 15, 2022 07:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tssandor/a2c18a86b465a0b39a1319372dd12214 to your computer and use it in GitHub Desktop.
Save tssandor/a2c18a86b465a0b39a1319372dd12214 to your computer and use it in GitHub Desktop.
import QDPublisher
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
let publisher = Publisher.shared
let integrationKey: String = "your integration key here"
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.
LaunchOptionsKey : Any]? = nil) -> Bool {
/// setup event. You need implement method from
`PublisherDelegate`
publisher.delegate = self
/// setup integration key
publisher.setup(integrationKey)
/// if this value is true it will not show custom alert from
our location SDK and if false it will show custom alert that we can
update the message
publisher.disableAlertWhenUserDenied = true
/// this is custom alert title to request access location
publisher.requestAccessAlertTitle = "Need Location Access"
/// this is custom alert message to request access location
publisher.requestAccessAlertMessage = {
"Please give authorization location access to continue the
process. Go to Settings > Privacy > Location Services \(Bundle.main.
object(forInfoDictionaryKey: kCFBundleNameKey as String) ?? "")"
}()
///start tracking location. After you call this method, our SDK
will automatically tracking event and do the logic for you
publisher.startTrackingLocation()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment