package com.kakao.kakaolink.v2 public class KakaoLinkService extends Object
Modifier and Type | Method and Description |
---|---|
void |
deleteImageWithToken(Context context,
String imageToken,
ResponseCallback<com.kakao.network.storage.ImageDeleteResponse> callback)
Delete the image with the given token from Kakao storage server.
|
void |
deleteImageWithUrl(Context context,
String imageUrl,
ResponseCallback<com.kakao.network.storage.ImageDeleteResponse> callback)
Delete the image with the given URL from Kakao storage server.
|
static KakaoLinkService |
getInstance()
Returns a singleton instance for KakaoLink v2 API.
|
Intent |
getKakaoTalkInstallIntent(Context context)
Returns an intent to start KakaoTalk install page of Google play store.
|
boolean |
isKakaoLinkV2Available(Context context) |
void |
scrapImage(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(Context context,
String templateId,
Map<String,String> templateArgs,
Map<String,String> serverCallbackArgs,
ResponseCallback<KakaoLinkResponse> callback)
Send KakaoLink v2 message with custom templates.
|
void |
sendCustom(Context context,
String templateId,
Map<String,String> templateArgs,
ResponseCallback<KakaoLinkResponse> callback)
Send KakaoLink v2 message with custom templates.
|
void |
sendDefault(Context context,
TemplateParams params,
Map<String,String> serverCallbackArgs,
ResponseCallback<KakaoLinkResponse> callback)
Send KakaoLink v2 message with default templates.
|
void |
sendDefault(Context context,
TemplateParams params,
ResponseCallback<KakaoLinkResponse> callback)
Send KakaoLink v2 message with default templates.
|
void |
sendScrap(Context context,
String url,
Map<String,String> serverCallbackArgs,
ResponseCallback<KakaoLinkResponse> callback)
Send a URL scrap message with default scrap template.
|
void |
sendScrap(Context context,
String url,
ResponseCallback<KakaoLinkResponse> callback)
Send a URL scrap message with default scrap template.
|
void |
sendScrap(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(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(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(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 void deleteImageWithUrl(Context context, String imageUrl, ResponseCallback<com.kakao.network.storage.ImageDeleteResponse> callback)
context
- Context to start an activity for KakaoLinkimageUrl
- true if https is needed for image url, false if http is sufficientcallback
- success/failure callback that will be passed detailed warnings or error messagespublic static KakaoLinkService getInstance()
public Intent getKakaoTalkInstallIntent(Context context)
context
- Context to get app information (package name, app key, key hash, and KA header) from.public boolean isKakaoLinkV2Available(Context context)
public void scrapImage(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(Context context, String templateId, Map<String,String> templateArgs, Map<String,String> serverCallbackArgs, ResponseCallback<KakaoLinkResponse> callback)
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(Context context, String templateId, Map<String,String> templateArgs, ResponseCallback<KakaoLinkResponse> callback)
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(Context context, TemplateParams params, Map<String,String> serverCallbackArgs, ResponseCallback<KakaoLinkResponse> callback)
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(Context context, TemplateParams params, ResponseCallback<KakaoLinkResponse> callback)
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(Context context, String url, Map<String,String> serverCallbackArgs, ResponseCallback<KakaoLinkResponse> callback)
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(Context context, String url, ResponseCallback<KakaoLinkResponse> callback)
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(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(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(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