public class KakaoLinkService extends Object
카카오링크 v2를 사용하기 위한 클래스.
| Modifier and Type | Method and Description |
|---|---|
void |
deleteImageWithToken(android.content.Context context,
String imageToken,
ResponseCallback<com.kakao.network.storage.ImageDeleteResponse> callback)
Delete the image with the given token from Kakao storage server.
|
static KakaoLinkService |
getInstance()
Returns a singleton instance for KakaoLink v2 API.
|
android.content.Intent |
getKakaoTalkInstallIntent(android.content.Context context)
Returns an intent to start KakaoTalk install page of Google play store.
|
boolean |
isKakaoLinkV2Available(android.content.Context context) |
void |
scrapImage(android.content.Context context,
Boolean secureResource,
String imageUrl,
ResponseCallback<com.kakao.network.storage.ImageUploadResponse> callback)
Upload image with the given URL to Kakao storage server.
|
void |
sendCustom(android.content.Context context,
String templateId,
Map<String,String> templateArgs,
Map<String,String> serverCallbackArgs,
ResponseCallback<KakaoLinkResponse> callback)
Send KakaoLink v2 message with custom templates.
|
void |
sendCustom(android.content.Context context,
String templateId,
Map<String,String> templateArgs,
ResponseCallback<KakaoLinkResponse> callback)
Send KakaoLink v2 message with custom templates.
|
void |
sendDefault(android.content.Context context,
TemplateParams params,
Map<String,String> serverCallbackArgs,
ResponseCallback<KakaoLinkResponse> callback)
Send KakaoLink v2 message with default templates.
|
void |
sendDefault(android.content.Context context,
TemplateParams params,
ResponseCallback<KakaoLinkResponse> callback)
Send KakaoLink v2 message with default templates.
|
void |
sendScrap(android.content.Context context,
String url,
Map<String,String> serverCallbackArgs,
ResponseCallback<KakaoLinkResponse> callback)
Send a URL scrap message with default scrap template.
|
void |
sendScrap(android.content.Context context,
String url,
ResponseCallback<KakaoLinkResponse> callback)
Send a URL scrap message with default scrap template.
|
void |
sendScrap(android.content.Context context,
String url,
String templateId,
Map<String,String> templateArgs,
Map<String,String> serverCallbackArgs,
ResponseCallback<KakaoLinkResponse> callback)
Send a URL scrap message with custom template and template arguments.
|
void |
sendScrap(android.content.Context context,
String url,
String templateId,
Map<String,String> templateArgs,
ResponseCallback<KakaoLinkResponse> callback)
Send a URL scrap message with custom template and template arguments.
|
void |
uploadImage(android.content.Context context,
Boolean secureResource,
File imageFile,
ResponseCallback<com.kakao.network.storage.ImageUploadResponse> callback)
Upload image to Kakao storage server to be used in KakaoLink message.
|
public void deleteImageWithToken(android.content.Context context,
String imageToken,
ResponseCallback<com.kakao.network.storage.ImageDeleteResponse> callback)
context - Context to start an activity for KakaoLinkimageToken - Token of image to be deletedcallback - success/failure callback that will be passed detailed warnings or error messagespublic static KakaoLinkService getInstance()
public android.content.Intent getKakaoTalkInstallIntent(android.content.Context context)
context - Context to get app information (package name, app key, key hash, and KA header) from.public boolean isKakaoLinkV2Available(android.content.Context context)
public void scrapImage(android.content.Context context,
Boolean secureResource,
String imageUrl,
ResponseCallback<com.kakao.network.storage.ImageUploadResponse> callback)
context - Context to start an activity for KakaoLinksecureResource - true if https is needed for image url, false if http is sufficientimageUrl - URL of image to be scrappedcallback - success/failure callback that will be passed detailed warnings or error messagespublic void sendCustom(android.content.Context context,
String templateId,
Map<String,String> templateArgs,
Map<String,String> serverCallbackArgs,
ResponseCallback<KakaoLinkResponse> callback)
커스텀 템플릿을 사용하여 카카오링크 v2 메시지를 보냄. 서버 콜백에 넘길 값들을 지정할 수 있다.
context - Context to start an activity for KakaoLinktemplateId - id of the custom template created in developer websitetemplateArgs - template arguments to fill in the custom templateserverCallbackArgs - arguments for server callbackcallback - success/failure callback that will contain detailed warnings or error messagesIllegalStateException - if kakao app key or android key hash is not setpublic void sendCustom(android.content.Context context,
String templateId,
Map<String,String> templateArgs,
ResponseCallback<KakaoLinkResponse> callback)
커스텀 템플릿을 사용하여 카카오링크 v2 메시지를 보냄.
context - Context to start an activity for KakaoLinktemplateId - id of the custom template created in developer websitetemplateArgs - template arguments to fill in the custom templatecallback - success/failure callback that will contain detailed warnings or error messagesIllegalStateException - if kakao app key or android key hash is not setpublic void sendDefault(android.content.Context context,
TemplateParams params,
Map<String,String> serverCallbackArgs,
ResponseCallback<KakaoLinkResponse> callback)
디폴트 템플릿을 사용하여 카카오링크 v2 메시지를 보낸다. 별도의 템플릿 설정이 필요 없으며 아래의 템플릿 타입들을 지원한다.
- FeedTemplate
- ListTemplate
- LocationTemplate
- CommerceTemplate
- TextTemplate
context - Context to start an activity for KakaoLinkparams - TemplateParams object containing template arguments bulit with its builderserverCallbackArgs - arguments to be delivered to server callbackcallback - success/failure callback that will contain detailed warnings or error messagesIllegalStateException - if kakao app key or android key hash is not setpublic void sendDefault(android.content.Context context,
TemplateParams params,
ResponseCallback<KakaoLinkResponse> callback)
디폴트 템플릿을 사용하여 카카오링크 v2 메시지를 보낸다. 별도의 템플릿 설정이 필요 없으며 아래의 템플릿 타입들을 지원한다.
- FeedTemplate
- ListTemplate
- LocationTemplate
- CommerceTemplate
- TextTemplate
context - Context to start an activity for KakaoLinkparams - TemplateParams object containing template arguments bulit with its buildercallback - success/failure callback that will contain detailed warnings or error messagesIllegalStateException - if kakao app key or android key hash is not setpublic void sendScrap(android.content.Context context,
String url,
Map<String,String> serverCallbackArgs,
ResponseCallback<KakaoLinkResponse> callback)
별도의 템플릿 설정 없이 카카오링크 v2 스크랩 메시지를 보낸다. 서버 콜백에 넘길 값들을 지정할 수 있다.
context - Context to start an activity for KakaoLinkurl - URL to be scrappedcallback - success/failure callback that will be passed detailed warnings or error messagesserverCallbackArgs - arguments to be delivered to server callbackIllegalStateException - if kakao app key or android key hash is not setpublic void sendScrap(android.content.Context context,
String url,
ResponseCallback<KakaoLinkResponse> callback)
별도의 템플릿 설정 없이 URL 스크랩 메시지를 보낸다.
context - Context to start an activity for KakaoLinkurl - URL to be scrappedcallback - success/failure callback that will be passed detailed warnings or error messagesIllegalStateException - if kakao app key or android key hash is not setpublic void sendScrap(android.content.Context context,
String url,
String templateId,
Map<String,String> templateArgs,
Map<String,String> serverCallbackArgs,
ResponseCallback<KakaoLinkResponse> callback)
context - Context to start an activity for KakaoLinkurl - URL to be scrappedtemplateId - id of the custom template created in developer websitetemplateArgs - template arguments to fill in the custom templateserverCallbackArgs - arguments to be delivered to server callbackcallback - success/failure callback that will be passed detailed warnings or error messagesIllegalStateException - if kakao app key or android key hash is not setpublic void sendScrap(android.content.Context context,
String url,
String templateId,
Map<String,String> templateArgs,
ResponseCallback<KakaoLinkResponse> callback)
context - Context to start an activity for KakaoLinkurl - URL to be scrappedtemplateId - id of the custom template created in developer websitetemplateArgs - template arguments to fill in the custom templatecallback - success/failure callback that will be passed detailed warnings or error messagesIllegalStateException - if kakao app key or android key hash is not setpublic void uploadImage(android.content.Context context,
Boolean secureResource,
File imageFile,
ResponseCallback<com.kakao.network.storage.ImageUploadResponse> callback)
자체적인 이미지 서버를 거치지 않고 로컬 디바이스에 있는 이미지를 카카오링크에 사용하고 싶은 경우 카카오 이미지 서버에 업로드 하는 기능.
context - Context to start an activity for KakaoLinksecureResource - true if https is needed for image url, false if http is sufficientimageFile - Image filecallback - success/failure callback that will be passed detailed warnings or error messages