How to share Link to Kakao Story by opening Kakao Story from my own app rather than using the profile api and requestPostLink?

I want to share a link to Kakao Story. Is there a way to open the Kakao story use the code which contains the message about the link and then it will open the Kakao Story.

@ync618 Sure. If you can download KakaoSDK, you will see the story link sample in the SDK zip package. We provide only the sample code for the story link.

@michael Do you mean this?

private void requestPostLink(final KakaoStoryLinkInfo kakaoStoryLinkInfo) {
        final LinkKakaoStoryPostParamBuilder postParamBuilder = new LinkKakaoStoryPostParamBuilder(kakaoStoryLinkInfo);
        postParamBuilder.setContent(linkContent);
        requestPost(StoryType.LINK, postParamBuilder);
    }

private void requestPost(final StoryType storyType, final BasicKakaoStoryPostParamBuilder postParamBuilder) {
        // 앱이 설치되어 있는 경우 kakao<app_key>://kakaostory?place=1111 로 이동.
        // 앱이 설치되어 있지 않은 경우 market://details?id=com.kakao.sample.kakaostory&referrer=kakaostory로 이동
        postParamBuilder.setAndroidExecuteParam(execParam).setIOSExecuteParam(execParam).setAndroidMarketParam(marketParam).setIOSMarketParam(marketParam);
        try {
            final Bundle parameters = postParamBuilder.build();
            KakaoStoryService.requestPost(storyType, new MyKakaoStoryHttpResponseHandler<MyStoryInfo>() {
                @Override
                protected void onHttpSuccess(final MyStoryInfo myStoryInfo) {
                    if (myStoryInfo.getId() != null) {
                        lastMyStoryId = myStoryInfo.getId();
                        getPostButton.setEnabled(true);
                        getPostsButton.setEnabled(true);
                        deletePostButton.setEnabled(true);
                        Toast.makeText(getApplicationContext(), "succeeded to post " + storyType + " on KakaoStory.\nmyStoryId=" + lastMyStoryId, Toast.LENGTH_SHORT).show();
                    } else {
                        Toast.makeText(getApplicationContext(), "failed to post " + storyType + " on KakaoStory.\nmyStoryId=null", Toast.LENGTH_SHORT).show();
                    }
                }
            }, parameters);
        } catch (KakaoParameterException e) {
            Toast.makeText(getApplicationContext(), e.getMessage(), Toast.LENGTH_SHORT).show();
        }
    }

But it need to profile at first. According the KakaoSDK sample, when we want to post the link to Kakao Story, we should request profile at first and the requestPostLink. However, if I have installed the Kakao Story app, I want to post the link by start kakao Story( such as using Intent or the KakaoSDK to start Kakao Story).

@ync618 No. The above source is not story link. Please see the “kakao-open-android-link-sample” project(com.kakao.sdk.link.sample.storylink/*).

@michael Oh my god! I reference the 1.0.52 version…Thanks very much. It has take me a lot of time…

1개의 좋아요

@michael Does this sample like StoryLink source code have upload to “http://devrepo.kakao.com:8088/nexus/content/groups/public/com/kakao/sdk/”? It likes I can not access it. I can only see it at you sample.