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.
The Flutter SDK has the following features:
Here are what you need to use the Flutter SDK:
The Flutter SDK uses the following libraries that are automatically installed when installing the Flutter SDK:
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.
To import the Kakao Flutter library in your project, set dependencies as follows.
Step 1. Add dependenciesAdd 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
To get the packages, run the following command in Terminal.
$ flutter pub get
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.
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.
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());
}