Created
February 15, 2022 07:43
-
-
Save tssandor/a2c18a86b465a0b39a1319372dd12214 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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