페이지 이동경로
  • Docs>
  • Kakao Navi>
  • iOS

Kakao Navi

iOS

This document describes how to integrate the Kakao Navi API into your service with the Kakao SDK for iOS (hereinafter referred to as 'iOS SDK').

Before you begin

Register iOS Platform

To use the iOS SDK, you must register the iOS platform in advance. Go to [My Application] > [Platform] and register the iOS platform by specifying the Bundle ID. If not, an error may occur.

Add modules

To implement Kakao Navi, you need to install the Kakao Navi module. After adding KakaoSDKNavi(Kakao Navi module) to the Podfile, add the import statement for the module as follows.

import KakaoSDKNavi

Register Allowlist

The Kakao Navi API provides the navigateUrl() function for navigation and the shareUrl() function for location sharing.

navigateIntent() and shareDestinationIntent() return URL to invoke the navigation and location sharing function with the Kakao Navi application (hereinafter referred to as 'app'). If the Kakao Navi app is installed on a user's device, the app is launched. If not, the user is directed to the download page for the Kakao Navi app via the default web browser.

To allow a user's device to launch the Kakao Navi app, you must set a URI scheme in the plist file as follows:

  1. Add the LSApplicationQueriesSchemes key with an array type in the plist file.
  2. Add "kakaonavi-sdk'" to the LSApplicationQueriesSchemes key.

Set parameters

When you call the Kakao Navi API, pass the Location object containing destination information and the NaviOption object as arguments where search criteria is defined by specifying the following parameters.

NaviLocation

Name Type Description
name String Location name.
Example: "My Home", "Company"
rpFlag String Destination link.
Currently not supported.
x Int64 Longitude coordinate.
y Int64 Latitude coordinate.

NaviOption

Name Type Description
coordType CoordType Coordinate system to use. Refer to CoordType below.
vehicleType VehicleType Vehicle type. Refer to VehicleType below.
rpOption RpOption Criteria to optimize routes.
routeInfo Boolean Whether to view entire route information to the destination.
startX Int64 Longitude coordinate of the starting point.

NOTE: This value is only used for a reference to get directions.
For navigation, the current position is used as a starting point regardless of the designated starting point.
startY Int64 Latitude coordinate of the starting point.

NOTE: This value is only used for a reference to get directions.
For navigation, the current position is used as a starting point regardless of the designated starting point.
startAngle Int Angle of the vehicle at starting point.
A value between 0 and 359.

NOTE: This value is only used for a reference to get directions.
For navigation, the current position is used as a starting point regardless of the designated starting point.
returnUri URL URI to be redirected when stopping navigation (viewing entire routes).

You can optionally set the components of NaviOption. However, make sure to specify important search criteria. If not, Kakao Navi cannot find places and directions according to the set criteria.


You must set one of the predefined keys of the following Enum class for each component.

Enum: CoordType
Name Description
WGS84 World Geodetic System 84 coordinate system.
KATEC Katec coordinate system.
This is set as a default.

Enum: VehicleType
Name Description
1 First, Class 1: Passenger car, small van, small truck.
2 Second, Class 2: Mid-size van, mid-size truck.
3 Third, Class 3: Large van, 2-axis large truck.
4 Fourth, Class 4: 3-axis large truck.
5 Fifth, Class 5: Special truck with four axes or more.
6 Sixth, Class 6: Compact car.
7 TwoWheel, Class 7: Motorcycle.

Enum: RpOption
Name Description
1 Fast, Fastest route.
2 Free, Toll-free route.
3 Shortest, Shortest route.
4 NoAuto, Route excluding motorway.
5 Wide, Main road first.
6 Highway, Highway first.
8 Normal, Normal road first.
100 Recommended, Recommended route.
This is set as a default.

Navigation

The Navigation API starts directions from a user's current location to the entered destination via the Kakao Navi app. To implement this function, call the navigateUrl() method defined in the NaviApi class, which returns URL to launch the Kakao Navi app.

You must pass the NaviLocation object containing destination information and the NaviOption object containing search criteria as arguments when calling navigateUrl(). You can specify only the desired search criteria in NaviOption. Even though you use startX, startY, and startAngle in the NaviOption class, the information of the starting point is only used for a reference and the current information is set to a starting point when getting directions. You cannot specify a starting point for navigation.

This API also provides a function to specify a list of waypoints. Include information about the waypoints in the NaviLocation object and pass it as viaList when calling navigateUrl.

Here is an example of starting navigation.

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)
}

This is the screen of starting navigation on the Kakao Navi app.

End of support for Kakao Navi web version

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. Instead, if Kakao Navi is not installed, the download page for Kakao Navi is open. Since the web version of navigation will be no longer available in the old versions, we recommend you to use the latest SDK.

Share location

The Sharing location API provides a screen to share the destination specified on the Kakao Navi app. To implement this function, call the shareUrl() method defined in the NaviApi class, which returns URL to launch the Kakao Navi app.

You must pass the NaviLocation object containing destination information and the NaviOption object containing search criteria as arguments when calling shareUrl(). You can specify only the desired search criteria in NaviOption. Even though you use startX, startY, and startAngle in the NaviOption class, the information of the starting point is only used for a reference and the current information is set to a starting point when getting directions. You cannot specify a starting point for navigation.

This API also provides a function to specify a list of waypoints. Include information about the waypoints in the NaviLocation object and pass it as viaList when calling shareUrl.

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)
}

This is the screen of sharing location on the Kakao Navi app.

Legacy

To see how to integrate Kakao Navi using the Legacy Kakao SDK for iOS, click this button. It is highly recommended to migrate to the new version of iOS SDK as soon as possible because the Legacy version may not be supported anymore. The legacy guide is not provided in the English version. Refer to the original Korean documentation.

See more