Getting Started

We provide API, based on Kakao Platform services such as Kakao Talk, Kakao Story and more. Kakao SDK is needed in order for developers to use such tools easily and correctly.

This document is not only for showing instructions on how to use Kakao SDK but also on develpment environment for using Kakao Platform service.

We recommend that you read this thoroughly before you refer to the guide or test functionalities.

These are the functionalities in which this guide will cover on.

  • User management: Provides simple login through kakao account. Also provides tools to easily manage each users information. Details on essential information on dealing with login through Kakao platform.
  • Kakao Story: Could directly use API in apps provided by KakaoStory.
  • Kakao Talk: Could directly use API in apps provided by KakaoTalk.
  • Kakao Link: Send variety of messages through KakaoTalk App.
  • Push Notification: Explain basics on how to use push notification
  • Applog Analytics: Functionality for analyzing app start/end, user session, and particular events.

Following document is based on following environment.

  • OS X Mountain Lion / Mavericks
  • XCode 5.0.2

Environment structure

In order to develop apps for iOS, Xcode must be installed For details on how to install Xcode, please refer here.

In order to test and launch sample, most recent version of KakaoTalk must be installed. Included sample only works in version 3.9.5 or above.

Kakao SDK Install

In order to use tools Kakao Platform service provides, Kakao SDK is needed.

Kakao SDK support ARMv7, ARMv7s, and ARM64. iOS 9.0 above should be installed. For details please refer iOS Support Matrix.

Download

In order to download most recent Kakao SDK for iOS directly, donwload SDK here.

For all other details on Kakao SDK, please refer SDK download.

Extract

Unzip downloaded file from above.

unzip kakao-ios-sdk-x.x.x.zip

Once downloaded file has been unziped KakaoOpenSDK.framework and samples folders are viewable.

sdk-ios-framework-unzip

Development project settings

Explains on how to apply Kakao SDK in development environment.

Create Project

Create project for referring to Kakao SDK .

Create project through File > New > New Project menu.

new_project

In order to add Kakao SDK in on going project, skip above.

Kakao SDK import

Downloaded KakaoOpenSDK framework folder should be drag & drop to newly created Project's Frameworks Group.

drag_sdk

drag_sdk

Image below is after KakaoOpenSDK framework has been added to project. KakaoOpenSDK framework is added in Frameworks.

drag_sdk

Check if SDK framework has been added correctly in Link Binary With Libraries. link_binary_with_binaries_confirm

After adding related file add "-all_load" in current project's Other Linker Flags

other_linker_flags

If build fails with option added please refer troubleshoot.

Basic environment for project is now set. Below explains on how to create and use application for project usage

Creating App

Create an application through My applications > Create new app menu.

  • Set your application name and icon. dev_0017.png
  • When you enter App's name and click on Create new app button, App will be created and App Key will be assigned. When using iOS SDK Native App key should be used. By clicking setting will take you in to setting details. dev_018.png
  • After selecting Add platform > iOS, you must enter Bundle ID. Bundle id you have entered here will be identical to Bundle Identifier in XCode Project.

Set my App in project

URL Types category must be added in order to verify through kakao account and to launch your personal App. "kakao" strings must be added in URL Schemes in front of KAKAO_APP_KEY. url_types

Native App key should be registered in plist which should have been registered in Kakao Developers website.

Key must be added with the name "KAKAO_APP_KEY" and its type must be a String type. Value should be registered with App's native app key. App Key & App Redirect URI Register

프로젝트에 내 앱 설정(iOS9 지원)

iOS9에서는 다양한 기능이 추가되면서 동작 및 설정의 변화가 생겼습니다. iOS9에서 올바로 Kakao SDK를 사용하기 위해서는 다음과 같은 두가지 설정을 앱의 plist(또는 프로젝트의 Info 설정)에 반드시 해 주어야 합니다.

Kakao SDK가 사용하는 카카오 앱들의 커스텀 스킴 스위칭을 허용하는 화이트리스트 추가

두번째, LSApplicationQueriesSchemes의 키로 Array 값 kakao{your_app_key} 및 카카오 앱들의 커스텀 스킴들을 등록합니다. 다음은 예시 입니다.

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>kakao0123456789abcdefghijklmn</string>
    <string>kakaokompassauth</string>
    <string>storykompassauth</string>
    <string>kakaolink</string>
    <string>kakaotalk-4.5.0</string>
    <string>kakaostory-2.9.0</string>
    <string>storylink</string>
</array>

보다 자세한 설명은 Privacy and Your App을 참고합니다.

보안 네트워크 통신을 원활히 하기 위해 Kakao 도메인의 화이트리스트 추가

첫번째, NSAppTransportSecurity의 키로 Dictionary 값 NSExceptionDomains을 등록하여 하위에 kakao.com을 설정합니다. 자세한 것은 아래의 예시를 참고합니다.

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSExceptionDomains</key>
    <dict>
        <key>kakaocorp.com</key>
        <dict>
            <key>NSExceptionAllowsInsecureHTTPLoads</key>
            <true/>
            <key>NSExceptionRequiresForwardSecrecy</key>
            <false/>
            <key>NSIncludesSubdomains</key>
            <true/>
        </dict>
        <key>kakao.com</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSExceptionRequiresForwardSecrecy</key>
            <false/>
            <key>NSExceptionAllowsInsecureHTTPLoads</key>
            <true/>
        </dict>
        <key>kakao.co.kr</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSExceptionRequiresForwardSecrecy</key>
            <false/>
            <key>NSExceptionAllowsInsecureHTTPLoads</key>
            <true/>
        </dict>
        <key>kakaocdn.net</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSExceptionRequiresForwardSecrecy</key>
            <false/>
            <key>NSExceptionAllowsInsecureHTTPLoads</key>
            <true/>
        </dict>
        <key>daumcdn.net</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSExceptionRequiresForwardSecrecy</key>
            <false/>
            <key>NSExceptionAllowsInsecureHTTPLoads</key>
            <true/>
        </dict>
    </dict>
</dict>

보다 자세한 설명은 App Transport Security Technote를 참고합니다.

그 밖의 설정

KakaoOpenSDK.h must be imported in order to call SDK's API from iOS App.

#import <KakaoOpenSDK/KakaoOpenSDK.h>

Before calling API from Kakao SDK in iOS app, bundle ID of app currently in development must be registered in developer website ( Dashboard setting > App information >iOS). App's bundle ID can be set in Xcode's project information. bundle_id

If bundle ID registered in developer website and bundle ID set in app you are about to launch is different, error below will occur.

invalid android_key_hash or ios_bundle_id

Launch sample App

Samples are included in Kakao SDK.

  • UserMgmtSample: These are samples related to user management.
  • KakaoLinkSample: This is a sample app related to KakaoLink.
  • KakaoStorySample: THis is sample app related to KakaoStory API.
  • KakaoTalkSample: This is sample app for KakaoTalk API.
  • PushSample: This is a sample app for push notification. Details will be introduced in Launch Sample APP.

Lets take a look in to app UserMgmtSample.

Launch

Screen example of installed UserMgmtSample app in iOS simulator follows. sample_app_run.png

Once you click on 'Kakao Account login' it will take you to Kakao Account login screen. First screen below is a screen without KakaoTalk installed. After logging in, user agreement page will show up as below to the right. kakao_account_login_browser.png sample_app_approval.png

Once 'agree' has been clicked, sample app will launch back. Screen below to the left is a first screen that will appear to user. If me button is clicked, notification will appear for users to register. UserMgmtSample is not set for auto registration which means you must singup and link Kakao with sample app.

sample_app_first.png sample_app_me_not_signup.png

After pressing Signup button, 'my information' will be retreived like screen to the right. ( If you signup with vlues filled inside text box, values you have filled in will be saved upon clicking singup inside user information. )

sample_app_me_not_signup.png sample_app_me.png

User information will be updated with current input. Unlinking disconnects current app with Kakao Account. Once current connection is disconnected, current user's information get deleted and account agreement procedures must be restated.


Troubleshoot

If there are troubles while following getting started, or sample app not launching as it should, please refer to help below. Or refer DevTalk_(Kakao developer forum) for iOS.

  • When logging in '+[NSBundle ko_appKey]: unrecognized selector sent to class 0x111111'error occurs with app crashing.

    In current project,check if "-all_load" is added in Other Linker Flags. For details refer Kakao SDK import.

  • When "-all_load" has been added In Other Linker Flags, build fails due to conflicting library

    Instead of "-all_load", try to load Kakao SDK through "-force_load $(SRCROOT)/KakaoOpenSDK.framework/KakaoOpenSDK".

  • dyld: Symbol not found: OBJC_CLASS$_NSJSONSerialization

    If such error occurs, you need iOS 5.1.1 or above installed in order to use Kakao SDK. Check back on your os version.

  • "The operation is cancelled." being called continuously after canceling login on web view.

    Before calling openWithCompletionHandler, check if [[KOSession sharedSession] close] logic has been included. Check back through login example.


More

Environmental setting is all set for App development. You can now use variety of tools Kakao Platform service provides.


Last Modified : 2018-11-12