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

iOS

Migrate v1 to v2

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

Initialization

The Legacy iOS SDK requires configuring a project and importing the SDK to call APIs. On the other hand, the latest iOS SDK requires explicit initialization before calling an API.

Notice when using token-based APIs

The token-based APIs refer to the APIs that require Kakao Login, which provides an access token.

With the Legacy iOS SDK, use KOSessionTask to call an API that passes an access token issued through Kakao Login. When using the Legacy iOS SDK, the session changes according to a user's login status, and some APIs can be called only when a session is open.

APIs in the latest iOS SDK are separated by modules. However, for the API that passes an access token through Kakao Login, the Kakao Login module and implementing the login feature is required along with the desired module.

Considering the structural difference, check if the desired module is dependent on Kakao Login. For the token-based APIs that require Kakao Login, the development guide for each API describes the required modules and whether to implement Kakao Login.

API comparison by version

Common

  • Latest SDK: Call the initSDK() method that initializes the SDK through KakaoSDK.
Name Legacy SDK SDK
Initializing Kakao SDK - initSDK()
Note

In iOS SDK 2.8.3, the class names, used for initialization, have been changed: - KakaoSDKCommon → KakaoSDK - RxKakaoSDKCommon → RxKakaoSDK

Kakao Login

  • Legacy SDK:
    • Call the Kakao Login APIs including the Getting consent to desired service terms API through KOSession.
    • Call the token-based APIs such as including the Retrieving shipping address and the Retrieving consent details for service terms APIs through KOSessionTask.
  • Latest SDK:
    • Call the Kakao Login APIs through UserApi in the KakaoSDKUser module.
    • Call the Checking token presence API through AuthApi in the KakaoSDKAuth module.
Name Legacy SDK SDK
Checking if Kakao Talk is installed - isKakaoTalkLoginAvailable()
Kakao Login openWithCompletionHandler -
Login with Kakao Talk - loginWithKakaoTalk()
Login with Kakao Account - loginWithKakaoAccount()
Checking token presence isOpen hasToken()
Logout logoutAndCloseWithCompletionHandler logout()
Unlink unlinkTaskWithCompletionHandler unlink()
Retrieving token information accessTokenInfoTaskWithCompletionHandler accessTokenInfo()
Retrieving user information userMeTaskWithCompletion me()
Retrieving shipping address shippingAddressTask shippingAddresses()
Storing user information profileUpdateTaskWithProperties:properties: updateProfile(properties:)
Requesting additional consent updateScopes:needsAgreementScopes: loginWithKakaoTalk(scopes:)
loginWithKakaoAccount(scopes:)
Retrieving consent details for service terms serviceTermsTask serviceTerms()
Getting consent to desired service terms open loginWithKakaoTalk(serviceTerms:)
loginWithKakaoAccount(serviceTerms:)

Kakao Talk Social

  • Legacy SDK: Call the Kakao Talk Social APIs through KOSessionTask.
  • Latest SDK: Call the Kakao Talk Social APIs through TalkApi in the KakaoSDKTalk module.
Name Legacy SDK SDK
Retrieving Kakao Talk profile talkProfileTaskWithCompletionHandler profile()
Retrieving list of friends appFriendsWithContext:context: friends()

Message: Kakao Talk Sharing

  • Legacy SDK:
    • Call the Kakao Talk Sharing APIs through KLKTalkLinkCenter for Sending message API.
    • Call the Image API through KLKImageStorage.
    • 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 ShareApi in the KakaoSDKShare module.
    • 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 iOS 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 sendDefaultWithTemplate:template: shareDefault(templatable:)
Sending with custom template sendCustomWithTemplateId:templateId:templateArgs: shareCustom(templateId:templateArgs:)
Sending a scrap message sendScrapWithURL: url:templateId: shareScrap(requestUrl:templateId:)
Uploading an image uploadWithImage:sourceImage: imageUpload(image:)
Scraping an image scrapWithImageURL:imageURL: imageScrap(imageUrl:)
Deleting an image deleteWithImageURL:imageURL: -

Message: Kakao Talk Messaging

  • Legacy SDK: Call the Kakao Talk APIs through KOSessionTask.
  • Latest SDK: Call the Kakao Talk APIs through TalkApi in the KakaoSDKTalk module.
Name Legacy SDK SDK
Sending me with default template talkMemoSendTaskWithTemplate:template: sendDefaultMemo(templatable:)
Sending me with custom template talkMemoSendTaskWithTemplateId:templateId: sendCustomMemo(templateId:)
Sending me a scrap message talkMemoSendTaskWithURL:url:templateId: sendScrapMemo(requestUrl:templateId:)
Sending friends with default template sendMessageToFriendsWithTemplate:template: sendDefaultMessage(templatable:receiverUuids:)
Sending friends with custom template sendMessageToFriendsTaskWithTemplateId:templateId: sendCustomMessage(templateId:receiverUuids:)
Sending friends a scrap message sendMessageToFriendsTaskWithURL:url:templateId: sendScrapMessage(requestUrl:templateId:receiverUuids:)

Kakao Talk Channel

  • Legacy SDK:
    • Call the Adding Kakao Talk Channel and Kakao Talk Channel chat APIs through KPFPlusFriend.
    • Call the Checking Kakao Talk Channel relationship API through KOSessionTask.
  • Latest SDK:
    • Call the Kakao Talk Channel APIs through TalkApi in the KakaoSDKTalk module.
    • Call the Checking Kakao Talk Channel relationship API after implementing Kakao Login.
Name Legacy SDK SDK
Adding Kakao Talk Channel addFriend:plusFriendId: makeUrlForAddChannel(channelPublicId:)
Starting Kakao Talk Channel chat chat:plusFriendId: makeUrlForChannelChat(channelPublicId:)
Checking Kakao Talk Channel relationship talkPlusFriendsTask channels()

Kakao Navi

  • Legacy SDK:
    • Call the Navi APIs through KNVNaviLauncher.
    • Use a class builder to set parameters.
  • Latest SDK:
    • Call the Navi APIs through KakaoSDKNavi in the NaviApi module.
    • Define the constructor for each class to set parameters.
Name Legacy SDK SDK
Navigation navigateWithParams:params: navigateUrl(destination:)
Getting URL for navigation - Deprecated webNavigateUrl(destination:)
Sharing location shareDestinationWithParams:params: shareUrl(destination:)
Setting conditions for navigation locationWithName NaviOption()
Setting conditions for destination information paramsWithDestination NaviLocation()

Push Notification

  • Legacy SDK: Call the Push Notification API through KOSessionTask.
  • Latest SDK: Not support Push Notification API. The push Notification is available using REST API.
Name Legacy SDK SDK
Registering push token pushRegisterDeviceWithToken:deviceToken: -
Retrieving push token pushGetTokensTaskWithCompletionHandler -
Deleting push token pushDeregisterDeviceWithToken:deviceToken: -