페이지 이동경로
  • Docs>
  • Android>
  • Migrate v1 to v2

Android

Migrate v1 to v2

This document guides information to upgrade Kakao SDK for Android("Android SDK") from v1(lower version of 2.0.0) to v2(version 2.0.0 or higher).

Module structure

The latest Android SDK has a simpler module structure compared to the Legacy Android SDK. The latest Android SDK provides the common module that contains the common and utility features and the Kakao Login function. In addition, each module provides APIs that are grouped by service under Client, and object and structure information is located in Model to make the Android SDK more efficient and convenient.

Notice when using token-based APIs

The token-based APIs refer to the APIs that require an access token through the Kakao Login. To use the token-based APIs in the latest Android SDK, implement Kakao Login that the user module provides.

API comparison by version

Common

  • Legacy SDK:
    • Set an app key in AndroidManifest.xml.
    • Call a function that initializes SDK through KakaoSDK.
    • Call a function that gets a key hash through Utility in the com.kakao.util package.
  • Latest SDK:
Name Legacy SDK SDK
Initializing Kakao SDK init() init()
Getting a key hash getKeyHash() getKeyHash()

Kakao Login

  • Legacy SDK:
    • Call the Login API through LoginActivity.
    • Call the Retrieving token information API through AuthService.
    • Call the Logout, Unlink, Retrieving user information, and Storing user information APIs through Session.
    • Call the Retrieving shipping address and the Retrieving consent details for service terms APIs through UserManagement.
    • Call the Getting consent to desired service terms API through LoginActivity.
  • Latest SDK:
    • Call the Kakao Login APIs through UserApiClient in the v2-user module, except for the Checking token presence API.
    • Call the Checking token presence API through AuthApiClient.
Name Legacy SDK SDK
Checking if Kakao Talk is installed - isKakaoTalkLoginAvailable()
Login with Kakao Talk - loginWithKakaoTalk(context)
Login with Kakao Account - loginWithKakaoAccount(context)
Checking token presence isOpened() hasToken()
Logout requestLogout() logout()
Unlink requestUnlink() unlink()
Retrieving token information requestAccessTokenInfo() accessTokenInfo()
Retrieving user information me() me()
Retrieving shipping address shippingAddresses() shippingAddresses()
Storing user information requestUpdateProfile(properties) updateProfile()
Requesting additional consent updateScopes(scopes) loginWithNewScopes(context, scopes)
Retrieving consent details for service terms serviceTerms() serviceTerms()
Getting consent to desired service terms - loginWithKakaoTalk(context, serviceTerms)
loginWithKakaoAccount(context, serviceTerms)
Kakao Talk Social
  • Legacy SDK: Call the Kakao Talk Social APIs through KOSessionTask.
  • Latest SDK: Call the Kakao Talk Social APIs through TalkApiClient in the v2-talk module.
Name Legacy SDK SDK
Retrieving Kakao Talk profile requestProfile() profile()
Retrieving list of friends requestAppFriends() friends()
Message: Kakao Talk Sharing
  • Legacy SDK:
    • Call the Kakao Talk Sharing APIs through KakaoLinkService.
    • If Kakao Talk is not installed on a user's device, a message is internally sent through a WebView.
  • Latest SDK:
    • Call the Kakao Talk Sharing APIs through ShareClient in the v2-share module.
    • Pass context for the Sending message API.
    • If Kakao Talk is not installed on a user's device, implement a process to share URI through a WebView or a default browser.
Note

In Android SDK 2.11.0, the names of the module, classes, and methods related to Kakao Talk Sharing have been changed due to the change of its service name. To see more detailed changes, see Version history.

Name Legacy SDK SDK
Checking if Kakao Talk is installed - isKakaoTalkSharingAvailable()
Sending with default template sendDefault(template) shareDefault(context, defaultFeed)
Sending with custom template sendCustomWithTemplateId(templateId) shareCustom(context, templateId)
Sending a scrap message sendScrapWithURL(url) shareScrap(context, url)
Uploading an image uploadImage(imageFile) uploadImage(file)
Scraping an image scrapWithImageURL:imageURL: scrapImage(url)
Message: Kakao Talk Messaging
  • Legacy SDK: Call the Kakao Talk APIs through KakaoTalkService.
  • Latest SDK: Call the Kakao Talk APIs through TalkApiClient in the v2-talk module.
Name Legacy SDK SDK
Sending me with default template requestSendMemo(template) sendDefaultMemo(template)
Sending me with custom template requestSendMemo() sendCustomMemo(templateId)
Sending me a scrap message requestSendMemo(url) sendScrapMemo(url)
Sending friends with default template sendMessageToFriends(template, uuids) sendDefaultMessage(template, receiverUuids)
Sending friends with custom template sendMessageToFriends(templateId, uuids) sendCustomMessage(templateId, receiverUuids)
Sending friends a scrap message sendMessageToFriend(url, uuids) sendScrapMessage(url, receiverUuids)
Kakao Talk Channel
  • Legacy SDK:
    • Call the Adding Kakao Talk Channel and Kakao Talk Channel chat APIs through PlusFriendService.
    • Call the Checking Kakao Talk Channel relationship API through KakaoTalkService.
  • Latest SDK:
    • Call the Adding Kakao Talk Channel and Kakao Talk Channel chat APIs through TalkApiClient in the v2-talk module.
    • Call the Checking Kakao Talk Channel relationship API after implementing Kakao Login.
Name Legacy SDK SDK
Adding Kakao Talk Channel addFriend(plusFriendId) addChannelUrl(channelPublicId)
Starting Kakao Talk Channel chat chat(plusFriendId) channelChatUrl(channelPublicId)
Checking Kakao Talk Channel relationship requestPlusFriends() channels()
Kakao Navi
  • Legacy SDK:
    • Call the Navi APIs through KakaoNaviService.
    • Call newBuilder() of each class and setNaviOptions() to set parameters.
  • Latest SDK:
    • Call the Navi APIs through NaviClient in the v2-navi module.
    • Define the constructor for each class to set parameters.
Name Legacy SDK SDK
Navigation navigate(destination) navigateIntent(location, naviOption)
Getting URL for navigation - Deprecated navigateWebUrl(location, naviOption)
Sharing location shareDestination(destination) shareDestinationIntent(location, naviOption)
Setting conditions for navigation newBuilder()
setNaviOptions(options)
NaviOption()
Setting conditions for destination information newBuilder()
setNaviOptions(options)
Location()
Push Notification
  • Legacy SDK
  • Latest SDK: Not support Push Notification API. Push notifications is available with a REST API.
Name Legacy SDK SDK
Registering push token registerPushToken(pushToken, deviceId) -
Retrieving push token getPushTokens() -
Deleting push token deregisterPushToken(deviceId) -