This document describes how to integrate the Kakao Navi API into your service with the Kakao SDK for iOS ("iOS SDK").
The Kakao Navi API provides the navigateUrl()
method for navigation and the shareUrl()
method for location sharing.
navigateUrl()
and shareUrl()
return URL
to invoke the navigation and location sharing function with the Kakao Navi application ("app"). If the Kakao Navi app is installed on a user's device, the app is launched. If not, the user should be directed to the download page for the Kakao Navi app.
To allow a user's device to launch the Kakao Navi app, you must set a URI scheme in the plist file as follows:
LSApplicationQueriesSchemes
key with an array type in the plist file. LSApplicationQueriesSchemes
key.Reference | App setting |
---|---|
[SDK] navigateUrl() [SDK] NaviLocation [SDK] NaviOption |
Install Import modules Initialize Register Allowlist |
Permission | Prerequisite | Kakao Login | User consent |
---|---|---|---|
- | Register platforms | - | - |
Starts directions from a user's current location to the entered destination.
In iOS SDK 2.8.4 or higher, Kakao Navi does not support its web version that is started on a device where the Kakao Navi app is not installed. Thus, implement to open the download page for Kakao Navi if Kakao Navi is not installed. Because the web version of navigation will be no longer available in the old versions, we recommend you to use the latest SDK. For more information, refer to Notice.
To start navigation from a user's current location to the entered destination on the Kakao Navi app, call the navigateUrl()
method defined in the NaviApi
class, which returns URL
to launch the Kakao Navi app. You must pass destination as NaviLocation
object containing the destination information as an argument. You can also specify the desired search criteria using NaviOption
.
let destination = NaviLocation(name: "카카오판교오피스", x: "321286", y: "533707")
let viaList = [NaviLocation(name: "판교역 1번출구", x: "321525", y: "532951")]
guard let navigateUrl = NaviApi.shared.navigateUrl(destination: destination, viaList: viaList) else {
return
}
if UIApplication.shared.canOpenURL(navigateUrl) {
UIApplication.shared.open(navigateUrl, options: [:], completionHandler: nil)
} else {
UIApplication.shared.open(NaviApi.webNaviInstallUrl, options: [:], completionHandler: nil)
}
To add waypoints, pass viaList
through NaviLocation
object.
Reference | App setting |
---|---|
[SDK] shareUrl() [SDK] NaviLocation [SDK] NaviOption |
Install Import modules Initialize Register Allowlist |
Permission | Prerequisite | Kakao Login | User consent |
---|---|---|---|
- | Register platforms | - | - |
Provides a screen to share the destination specified on the Kakao Navi app.
To share the specified location through the Kakao Navi app, call the shareUrl()
method in the NaviApi
class, which returns URL
. You must pass destination as NaviLocation
object containing the location information as an argument. You can also specify the desired search criteria using NaviOption
.
let destination = NaviLocation(name: "카카오판교오피스", x: "321286", y: "533707")
guard let shareUrl = NaviApi.shared.shareUrl(destination: destination) else {
return
}
if UIApplication.shared.canOpenURL(shareUrl) {
UIApplication.shared.open(shareUrl, options: [:], completionHandler: nil)
}
else {
UIApplication.shared.open(NaviApi.webNaviInstallUrl, options: [:], completionHandler: nil)
}
To share loacation with waypoints, pass viaList
through NaviLocation
object.