This document describes how to integrate Kakao Talk Social APIs into your service with the Kakao SDK for iOS (hereinafter referred to as 'iOS SDK').
Tag | Description |
---|---|
Login required | The API marked with this tag requires Kakao Login. You must implement the Kakao Login function first, and then call the corresponding API by using the access token issued when a user logs in. |
Consent required | To use the API marked with this tag, you must enable a specific scope required for the corresponding API. In addition, a user must also consent to the scope. Otherwise, an error occurs or empty value is returned. To check which scopes a user has consented to, you can call the Retrieving consent details API. |
To use the iOS SDK, you must register the iOS platform in advance. Go to [My Application] > [Platform] and register the iOS platform by specifying the Bundle ID.
To use the Kakao Talk Social API,
KakaoSDKAuth
(Authentication and token management module), KakaoSDKUser
(Kakao Login module) and KakaoSDKTalk
(Kakao Talk Social module that provides UserApi
) in the Podfile by referring to Install SDK.import KakaoSDKAuth
import KakaoSDKUser
import KakaoSDKTalk
import KakaoSDKAuth
import RxKakaoSDKAuth
import KakaoSDKUser
import RxKakaoSDKUser
import KakaoSDKTalk
import RxKakaoSDKTalk
To retrieve the Kakao Talk profile of the user currently logged in, call the profile() method in the TalkApi
class.
To use this API,
TalkApi.shared.profile {(profile, error) in
if let error = error {
print(error)
else {
print("profile() success.")
// Do something
_ = profile
}
}
// Class member property
let disposeBag = DisposeBag()
TalkApi.shared.rx.profile()
.retry(when: Auth.shared.rx.incrementalAuthorizationRequired())
.subscribe (onSuccess:{ (profile) in
print("success.")
// Do something
_ = profile
}, onFailure: {error in
print(error)
})
.disposed(by: disposeBag)
profile()
returns the TalkProfile object which contains the user's Kakao Talk profile information.
The Kakao Talk profile obatained though profile()
is different from the profile of Kakao Account. Refer to Understand Concepts.
Name | Type | Description | Required |
---|---|---|---|
nickname | String |
Kakao Talk nickname. Required user consent: Profile Info(nickname/profile image) or Nickname |
X |
profileImageUrl | URL |
Kakao Talk profile image URL. Required user consent: Profile Info(nickname/profile image) or Profile image |
X |
thumbnailUrl | URL |
Kakao Talk profile thumbnail image URL. Required user consent: Profile Info(nickname/profile image) or Profile image |
X |
countryISO | String |
Code of country where the user is using Kakao Talk. | X |
This API enables you to get the list of Kakao Talk friends of the user currently logged in. To see the difference of profile information between Kakao Talk and Kakao Account, refer to Understand Concepts.
To use this API,
To get the list of Kakao Talk friends of the user currently logged in, call the friends() method in the TalkApi
class. You can also pass optional parameters through arguments. If you make a request without any parameters, the default settings are applied.
Name | Type | Description | Required |
---|---|---|---|
offset | Int |
Offset value that the list of friends starts from. (Default: 0 ) |
X |
limit | Int |
Maximum number of friends to be retrieved per page. (Maximum: 100 , Default: 10 ) |
X |
order | Order |
Sort order of friends list. Asc or Desc . - Asc : sort in ascending order.- Desc : sort in descending order. (Default: Asc ) |
X |
friendOrder | FriendOrder |
Method to sort friends in the list. - Nickname : sort by Kakao Talk nickname in ascending or descending order according to the set value of order . - Favorite : user's favorite friends appear ahead in the sort order according to the set value of order and then the rest friends are sorted with the same priority. (Default: Favorite ) |
X |
TalkApi.shared.friends {(friends, error) in
if let error = error {
print(error)
}
else {
// Do something
_ = friends
}
}
// Class member property
let disposeBag = DisposeBag()
TalkApi.shared.rx.friends()
.retry(when: Auth.shared.rx.incrementalAuthorizationRequired())
.subscribe (onSuccess:{ (friends) in
// Do something
_ = friends
}, onFailure: {error in
print(error)
})
.disposed(by: disposeBag)
friends()
returns Friends which contains a list of the user's Kakao Talk friends.
If the request fails because the user has not agreed to provide the Friends List in Kakao Service(Including profile image, nickname, and favorites) scope, proceed the followings:
Name | Type | Description | Required |
---|---|---|---|
elements | [Friend] |
List of Kakao Talk profile information of each friend. | X |
totalCount | Int |
Total number of Kakao Talk friends. | O |
beforeUrl | URL |
Previous page URL. If there is no previous page, null is returned. |
X |
afterUrl | URL |
Next page URL. If there is no next page, null is returned. |
X |
favoriteCount | Int |
Number of friends added as favorite . |
X |
Name | Type | Description | Required |
---|---|---|---|
uuid | String |
User's unique ID used to send a Kakao Talk message. Do not use this value to identify users since this value may change depending on user's account status. |
O |
id | Int64 |
Service user ID. | X |
profileNickname | String |
Friend's profile nickname. | X |
profileThumbnailImage | URL |
Friend's profile thumbnail image. | X |
favorite | Bool |
Whether or not the friend is added as a favorite. true : Added as favorite.false : Not added as favorite. |
X |
* Deprecated 'allowedMsg' that indicates whether or not the friend allows to receive Kakao Talk messages from the app as Profile visibility option is provided. For more details, refer to DevTalk.
To see how to integrate Kakao Talk Social using the Legacy Kakao SDK for iOS, click this button. It is highly recommended to migrate to the new version of iOS SDK as soon as possible because the Legacy version may not be supported anymore. The Legacy guide is not provided in the English version. Refer to the original Korean documentation.