페이지 이동경로
  • Docs>
  • Getting started>
  • Flutter

Getting started

Flutter

This document describes what you should do to integrate the Kakao SDK for Flutter (hereinafter referred to as 'Flutter SDK') into your service before leveraging the Kakao APIs.

Features

The Flutter SDK has the following features:

  • Uses Dart language that enables you to develop multi-platforms from a single codebase.
  • Supports Android and iOS platforms. (Web platform will also be supported.)
  • Provides equal functionalities to the Kakao SDK for Android and iOS.
  • Has an intuitive interface similar to the usability of REST API.
  • Adopts various libraries for networking, cryptography, and JSON libraries to maximize performance.
  • Adopts a default browser (AuthenticationSession, CustomTabs) instead of WebView to enhance security.

Requirements

Here are what you need to use the Flutter SDK:

  • Dart 2.12.0 or higher
  • Flutter 2.0.0 or higher
  • Android Studio 3.6.1 or higher
  • Target Android API level 19 or higher (Android 4.4 (Kitkat) or higher)
  • Xcode 11.0 or higher
  • iOS 11.0 or higher
  • iOS Deployment Target 11.0 or higher
External library dependency

The Flutter SDK uses the following libraries that are automatically installed when installing the Flutter SDK:

Prerequisites

To use the Flutter SDK, you must register the platforms for both Android and iOS in the Kakao Developers and configure the settings for both platforms.

For Android

  1. Add key hashes.
  2. Specify your package name in [My Application] > [Platform] by referring to Register the platforms.
  3. Add a code block to grant Internet permission in the module-level build.gradle file.

For iOS

  1. Specify your Bundle ID in [My Application] > [Platform] by referring to Register the platforms.
  2. Register Allowlist and set URL Scheme.

Install SDK

To import the Kakao Flutter library in your project, set dependencies as follows.

Step 1. Add dependencies

Add the following dependencies in pubspec.yaml depending on the package you want to use. If you add kakao_flutter_sdk, you can use all packages.

dependencies:
  kakao_flutter_sdk: 1.2.0 # Add all packages
  kakao_flutter_sdk_user: 1.2.0 # Kakao Login
  kakao_flutter_sdk_talk: 1.2.0 # Kakao Talk Social, Kakao Talk messaging
  kakao_flutter_sdk_story: 1.2.0 # Kakao Story
  kakao_flutter_sdk_share: 1.2.0 # Kakao Talk sharing
  kakao_flutter_sdk_navi: 1.2.0 # Kakao Navi

To add all packages, you can also run the following command in Terminal.

$ flutter pub add kakao_flutter_sdk
Step 2. Get packages

To get the packages, run the following command in Terminal.

$ flutter pub get
Package dependency

Some packages in the Kakao SDK are dependent on another package. If you add the Common or Auth package, its subordinate packages are automatically added together.

Kakao SDK package dependency tree
IMPORTANT

If your app is using the Flutter SDK 0.9.0 or lower, update your source code by referring to What's new in Flutter SDK 1.1.1.

Initialize SDK

After installing the Flutter library, you need to initialize the SDK with your Native app key that is issued when you create an app in Kakao Developers.

In main.dart, add the init() method, and set nativeAppKey to your Native app key.

import 'package:kakao_flutter_sdk_common/kakao_flutter_sdk_common.dart';

// Initialize KakaoSdk to use Kakao APIs.
void main() {
    KakaoSdk.init(nativeAppKey: '${YOUR_NATIVE_APP_KEY}');
    runApp(MyApp());
}

See more