사이드 메뉴
Getting started
Kakao Developers
Login
Communication
Advertisement
- Concepts
- Ad creation: Ad account
- Ad creation: Campaign
- Ad creation: Ad group
- Targeting for ad group
- Custom audience targeting for ad group
- Ad creation: Creative common
- Ad creation: Display creative
- Ad creation: Message creative
- Ad creation: Personalized message creative
- Bizboard landing settings
- Report
- Message management
- Personalized message management
- Message ad management
- Message ad operation
- Ad View management
- Business Form+ management
- Business Form linkage management
- Pixel & SDK linkage management
- Audience management
- Engagement targeting management
- Customer file management
- Friend group management
- Ad account management
- Reference
- Type information
- Error code
Android
This document describes how to integrate Kakao Talk Social APIs into your service with the Kakao SDK for Android ("Android SDK").
| Reference | App setting |
|---|---|
[SDK, RxSDK] profile()[SDK] TalkProfile | Install Initialize |
| Permission | Prerequisite | Kakao Login | User consent |
|---|---|---|---|
| - | Native app key Activate Kakao Login Manage consent items | Required | Required: Profile Info(nickname/profile image) Nickname Profile image |
Retrieves Kakao Talk profile information linked to the Kakao Account of the logged-in user.
You can check the types and differences of user profiles available through the Kakao API in User profile.
Call profile().
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 REST API.
// Retrieve Kakao Talk profileTalkApiClient.instance.profile { profile, error ->if (error != null) {Log.e(TAG, "Failed to retrieve Kakao Talk profile", error)}else if (profile != null) {Log.i(TAG, "Succeeded in retrieving Kakao Talk profile" +"\nNickname: ${profile.nickname}" +"\nProfile Thumbnail: ${profile.thumbnailUrl}")}}
| Reference | App setting |
|---|---|
[SDK, RxSDK] selectFriend()[SDK] OpenPickerFriendRequestParams | Install Initialize |
| Permission | Prerequisite | Kakao Login | User consent |
|---|---|---|---|
| Required | Native app key Activate Kakao Login Manage consent items | Required | Required: Friends List in Kakao Service(Including profile image, nickname, and favorites) |
Opens the Friend picker and returns the information of the Kakao Talk friends selected by the user.
Call selectFriend() to open the Friend picker.
Use viewType to set the display format to full screen (FULL) or popup view (POPUP).
Create the SelectParams configuration object and pass it to selectParams to set the Friend picker type (SelectionMode) and the number of selectable friends (minPickableCount, maxPickableCount).
If mode is SINGLE (single picker), the minimum and maximum selection counts are fixed to 1. If mode is MULTIPLE (multi-picker), the selectable range can be set from 1 to 100 (default: minimum 1, maximum 30). See How to create SelectParams.
Other detailed settings such as picker orientation and search function can be modified by specifying OpenPickerFriendRequestParams. For more information on parameters, refer to the reference and Friend picker custom elements.
For the Android Friend picker, SelectParams must be created with a helper method. Pass the value created by the friend() method to selectParams. When you use the method, default values are applied to unspecified selection parameters. See the sample.
If the request is successful, the information of the friends that a user selects from the Friend picker is returned through SelectedUsers. If you encounter errors, refer to Error code.
// Set parametersval openPickerFriendRequestParams = OpenPickerFriendRequestParams(title = "Single picker", // Name of the pickerfriendFilter = PickerFriendFilter.REGISTERED, // Friend list filterviewAppearance = ViewAppearance.AUTO, // Display modeorientation = PickerOrientation.PORTRAIT, // Picker orientationselectParams = SelectParams.friend(mode = SelectionMode.SINGLESINGLE: Single picker, MULTIPLE: Multi-picker))PickerClient.instance.selectFriend(context = context!!,params = openPickerFriendRequestParams,viewType = ViewType.FULL,FULL: Full screen, POPUP: Popup view) { selectedUsers, error ->if (error != null) {Log.e(TAG, "Failed to retrieve the selected friend through the picker.", error)} else {Log.d(TAG, "Succeeded in retrieving the selected friend through the picker. $selectedUsers")}}
| Reference | App setting |
|---|---|
[SDK, RxSDK] friends()[SDK] Friends | Install Initialize |
| Permission | Prerequisite | Kakao Login | User consent |
|---|---|---|---|
| Required | Native app key Activate Kakao Login Manage consent items | Required | Required: Friends List in Kakao Service (Including profile image, nickname, and favorites) |
Retrieves Kakao Talk friend information linked to the Kakao Account of the logged-in user.
Note that Kakao Talk profiles may be different from Kakao Account profiles. Refer to Concepts.
To get the list of Kakao Talk friends of the user currently logged in, call the friends() method in the TalkApiClient class. You can also pass optional parameters through arguments. If you make a request without any parameters, the default settings are applied.
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, proceed the followings:
- Check if 'Friends List in Kakao Service(Including profile image, nickname, and favorites)' is set to 'Consent during use' in Consent items.
- Request additional consent to the 'Friends List in Kakao Service(Including profile image, nickname, and favorites)' scope.
// Retrieve a list of friends (Default)TalkApiClient.instance.friends { friends, error ->if (error != null) {Log.e(TAG, "Failed to retrieve a list of friends.", error)}else if (friends != null) {Log.i(TAG, "Succeeded in retrieving a list of friends. \n${friends.elements.joinToString("\n")}")// You can send a message to the friends using their UUIDs.}}