package kr.method.papaya;

import org.apache.cordova.CallbackContext;
import org.apache.cordova.CordovaPlugin;
import org.apache.cordova.LOG;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class KakaoLinkPlugin extends CordovaPlugin {
	private final String LINK = "link";
	

	public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
		//서비스 시작
		if (action.equals(LINK)) {
			final JSONObject options = args.getJSONObject(0);
			this.link(options);
		}
		
		return false;
	}
	
	/**
	 * 카카오 링크 열기
	 */
	private void link(JSONObject options){
		LOG.d("KakaoLinkPlugin", "link");
		
	}
}

@@ -222,16 +222,133 @@
 bject;%0A%0A
+import com.kakao.KakaoLink;%0Aimport com.kakao.KakaoParameterException;%0Aimport com.kakao.KakaoTalkLinkMessageBuilder;%0A%0A
 public c
@@ -430,16 +430,36 @@
 link%22;%0A%09
+KakaoLink kakaoLink;
 %0A%0A%09publi
@@ -807,16 +807,1169 @@
 link%22);%0A
-
 %09%09
+String message;%0A%09%09String image;%0A%09%09String url;%0A%09%09String label;%0A%09%09int width;%0A%09%09int height;%0A%09%09try %7B%0A%09%09%09kakaoLink = KakaoLink.getKakaoLink(cordova.getActivity().getApplicationContext());%0A%09%09%09final KakaoTalkLinkMessageBuilder kakaoTalkLinkMessageBuilder = kakaoLink.createKakaoTalkLinkMessageBuilder();%0A%0A%09%09%09try%7B%0A%09%09%09%09message = options.getString(%22message%22);%0A%09%09%09%09kakaoTalkLinkMessageBuilder.addText(message);%0A%09%09%09%7Dcatch(JSONException e)%7B%0A%09%09%09%09%0A%09%09%09%7D%0A%09%09%09%0A%09%09%09try%7B%0A%09%09%09%09image = options.getString(%22image%22);%0A%09%09%09%09width = options.getInt(%22width%22);%0A%09%09%09%09height = options.getInt(%22height%22);%0A%09%09%09%09kakaoTalkLinkMessageBuilder.addImage(image, width, height);%0A%09%09%09%7Dcatch(JSONException e)%7B%0A%09%09%09%09%0A%09%09%09%7D%0A%09%09%09%0A%09%09%09try%7B%0A%09%09%09%09url = options.getString(%22url%22);%0A%09%09%09%7Dcatch(JSONException e)%7B%0A%09%09%09%09url = %22%22;%0A%09%09%09%7D%0A%09%09%09%0A%09%09%09try%7B%0A%09%09%09%09label = options.getString(%22label%22);%0A%09%09%09%7Dcatch(JSONException e)%7B%0A%09%09%09%09label = %22%22;%0A%09%09%09%7D%0A%09%09%09%0A%09%09%09if(!url.equals(%22%22) && !label.equals(%22%22))%7B%0A%09%09%09%09kakaoTalkLinkMessageBuilder.addWebButton(label,url);%0A%09%09%09%7Delse if(url.equals(%22%22) && !label.equals(%22%22))%7B%0A%09%09%09%09kakaoTalkLinkMessageBuilder.addWebButton(label);%0A%09%09%09%7D%0A%09%09%09%0A%09%09%09%0A%09%09%7D catch (KakaoParameterException e) %7B%0A%09%09%09e.printStackTrace();%0A%09%09%7D
 %0A%09%7D%0A%7D%0A

Update KakaoLinkPlugin.java