안드로이드 개발 질문/답변
(글 수 45,052)
import com.kakao.talk.KakaoLink
String strMessage = "카카오링크를 사용하여 메세지를 전달해 보세요.";
String strURL = "http://link.kakao.com";
String strAppId = "com.android.kakaolinktest";
String strAppVer = "2.0";
String strAppName = "[카카오톡]";
String strInstallUrl = "market://details?id=com.kakao.talk";
try {
ArrayList< Map < String, String > > arrMetaInfo = new ArrayList< Map< String, String > >();
// If application is support Android platform. 안드로이드
Map < String, String > metaInfoAndroid = new Hashtable < String, String >(1);
metaInfoAndroid.put("os", "android");
metaInfoAndroid.put("devicetype", "phone");
metaInfoAndroid.put("installurl", strInstallUrl);
metaInfoAndroid.put("executeurl", "example://example");
arrMetaInfo.add(metaInfoAndroid);
// If application is support ios platform. 아이폰
Map < String, String > metaInfoIOS = new Hashtable < String, String >(1);
metaInfoIOS.put("os", "ios");
metaInfoIOS.put("devicetype", "phone");
metaInfoIOS.put("installurl", "pass");
metaInfoIOS.put("executeurl", "kakaoLinkTest://starActivity");
arrMetaInfo.add(metaInfoIOS);
KakaoLink link = new KakaoLink(this, strURL, strAppId, strAppVer,
strMessage, strAppName, arrMetaInfo, "UTF-8");
if( link.isAvailable() ) {
startActivity(link.getIntent());
}
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}
이게 기본 예제 소스인데용
카카오톡으로 앱링크를 보낸뒤 카카오톡에서 링크 클릭시에
제가만든 어플이 다시 실행되어야 하는데
실행하기 위해서 필요한 정보가 metainfo에 저장이 됩니다.
등록이 안되어서 설치 경로는 그냥 기본 카카오톡 주소로 쓰고 있구용
executeurl에 실행 경로를 지정해 주어야 하는거 같은데
경로를 어떤방식으로 적어주어야 하는것인가요 ㅠㅠ
data://com.android.kakaolinktest 머 이런식으로 적는것인가요
고수님들 부탁드립니닷!




메니페스트에 커스텀으로 인텐트 필터 만들어 넣으셔야함니다.
<intent-filter>
<data
android:host="starActivity"
android:scheme="CallTaxi" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
이런식으로...
그리고 안에 내용은 "name명://scheme명"으로 쓰세요.