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

Kakao Navi

Flutter

This document describes how to integrate the Kakao Navi API into your service with the Kakao SDK for Flutter ("Flutter SDK").

The Flutter SDK supports Android, iOS, and web platforms. However, if users use your web app in environments other than Android and iOS, they cannot use the Kakao Navi services because the Kakao Navi services are available only in the Kakao Navi mobile app.

Before you begin

Set Allowlist

To use Kakao Navi APIs on a iOS device, set Allowlist.

Check if Kakao Navi is available

To figure out if it is possible to launch the Kakao Navi app on a user's device, you can use the isKakaoNaviInstalled() method.

If the Kakao Navi app is installed on a user's mobile device, isKakaoNaviInstalled() returns true and the Kakao Navi app is launched. If not installed, false is returned, and thus the user should be directed to the download page for the Kakao Navi app.

In the case of a web app, the isKakaoNaviInstalled() method returns a different boolean value depending on the user environment where your web app is running. If a user on an Android or iOS environment attempts to start navigation or share location from the web app, isKakaoNaviInstalled() returns true regardless of whether Kakao Navi is installed. Thus, in the web app, true does not guarantee that Kakao Navi is installed on the user's Android or iOS device. On the other hand, in other environments where your web app is running such as Windows or Mac operating systems, false is returned.

bool result = await NaviApi.instance.isKakaoNaviInstalled();
if (result) {
    print('Possible to launch Kakao Navi for navigation or location sharing.');
} else {
    print('Kakao Navi app is not installed.');
    // If Kakao Navi is not available on a user's mobile device, open the download page for Kakao Navi. 
    launchBrowserTab(Uri.parse(NaviApi.webNaviInstall));
}

Start navigation

Basic information
Reference App setting
navigate()
Location
NaviOption
Install
Initialize
Set Allowlist
Permission Prerequisite Kakao Login User consent
- Register platforms - -

Starts directions from a user's current location to the entered destination.

Request

To start navigation from a user's current location to the entered destination on the Kakao Navi app, call the navigate() method in the NaviApi class. You must pass destination as Location object containing the destination information as an argument. You can also specify the desired search criteria using NaviOption.

Sample

if (await NaviApi.instance.isKakaoNaviInstalled()) {
  // If Kakao Navi is available on user's device, navigation starts on Kakao Navi with KATEC.
  await NaviApi.instance.navigate(
    destination: Location(name: '카카오 판교오피스', x: '321286', y: '533707'),
    viaList: [
      Location(name: '판교역 1번출구', x: '321525', y: '532951'),
    ],
  );
} else {
  // If Kakao Navi is not available, open the download page for Kakao Navi. 
  launchBrowserTab(Uri.parse(NaviApi.webNaviInstall));
}
길 안내 예시 화면

Addtional feature

Waypoint

This API also provides a function to specify a list of waypoints. To add waypoints, pass viaList through Location object.

if (await NaviApi.instance.isKakaoNaviInstalled()) {
  // If Kakao Navi is available on user's device, navigation to the specified destination via waypoints starts on Kakao Navi on the KATEC coordinate system.
  await NaviApi.instance.navigate(
    destination: Location(name: '카카오 판교오피스', x: '321286', y: '533707'),
    viaList: [ 
      Location(name: '판교역 1번출구', x: '321525', y: '532951'),
    ],
  );
} else {
  // If Kakao Navi is not available, open the download page for Kakao Navi.
  launchBrowserTab(Uri.parse(NaviApi.webNaviInstall));
}

Share location

Basic information
Reference App setting
shareDestination()
Location
NaviOption
Install
Initialize
Set Allowlist
Permission Prerequisite Kakao Login User consent
- Register platforms - -

Provides a screen to share the destination specified on the Kakao Navi app.

Request

To share the specified location through the Kakao Navi app, call the shareDestination() method in the NaviApi class. You must pass destination as Location object containing the location information as an argument. You can also specify the desired search criteria using NaviOption.

Sample

if (await NaviApi.instance.isKakaoNaviInstalled()) {
  // If Kakao Navi is available on user's device, location is shared on Kakao Navi on the KATEC coordinate system.
  await NaviApi.instance.shareDestination(
    destination: Location(name: '카카오 판교오피스', x: '321286', y: '533707'),
  );
} else {
  // If Kakao Navi is not available, open the download page for Kakao Navi.
  launchBrowserTab(Uri.parse(NaviApi.webNaviInstall));
}
목적지 공유 예시 화면

Additional feature

Waypoint

To share loacation with waypoints, pass viaList through Location object.

if (await NaviApi.instance.isKakaoNaviInstalled()) {
  // If Kakao Navi is available on user's device, location including waypoints is shared on Kakao Navi on the WGS84 coordinate system.
  await NaviApi.instance.shareDestination(
    destination: Location(name: '카카오 판교오피스', x: '127.108640', y: '37.402111'),
    option: NaviOption(coordType: CoordType.wgs84),
    viaList: [ 
      Location(name: '판교역 1번출구', x: '321525', y: '532951'),
    ],
  );
} else {
  // If Kakao Navi is not available, open the download page for Kakao Navi.
  launchBrowserTab(Uri.parse(NaviApi.webNaviInstall));
}