Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add kakao share button using SDK #555

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

zmrdltl
Copy link

@zmrdltl zmrdltl commented Jan 1, 2025

Resolve #512

Kakao SDK Behavior

  • SDK initialization (window.Kakao.init) is mandatory, making the createShareButton structure unsuitable.
  • SDK is dynamically loaded via a <script> tag, requiring direct DOM access.

Constraints

  • SDK Initialization: Requires a JavaScript Key issued by the Kakao Developer Console.
    image

  • URI Encoding: Kakao SDK performs internal encoding, so additional encoding is unnecessary.

  • Domain Registration: Only URLs from domains registered in My Application > App Settings > Platform are allowed. Unregistered URLs result in a blank page.

image

  • Image URL: Must use an external URL accessible by Kakao servers.

Implementation

  • Utilized the sendDefault API to compose messages with objectType: 'feed':
    • webUrl and mobileWebUrl: Links must belong to registered domains.

    • buttonTitle: Sets the button text displayed within the KakaoTalk message.

    • imageUrl: Requires an externally accessible URL for images.

    • Sharing counts are not provided via API but can be viewed in the developer console's statistics.

    • Share Count In Console

    • SDK load or initialization errors are logged using console.error without disrupting app execution.

  • Update README.md

Additional Setup For Demo

  • Add vite-env.d.ts in the demo folder to define the VITE_KAKAO_JS_KEY type.
  • Add .env file with VITE_KAKAO_JS_KEY to provide the required JavaScript Key.

Share Example in Kakao Chat Platform

1. Choosing Friends or Chat room for share

image

2. After chosen

image

other people's view in chat room

image

Signed-off-by: zmrdltl [email protected]

    - Kakao SDK Behavior:
      - SDK initialization (window.Kakao.init) is mandatory, making the createShareButton structure unsuitable.
      - SDK is dynamically loaded via a <script> tag, requiring direct DOM access.
    - Constraints:
      - SDK Initialization: Requires a JavaScript Key issued by the Kakao Developer Console.
      - URI Encoding: Kakao SDK performs internal encoding, so additional encoding is unnecessary.
      - Domain Registration: Only URLs from domains registered in My Application > App Settings > Platform are allowed. Unregistered URLs result in a blank page.
      - Image URL: Must use an external URL accessible by Kakao servers.
    - Implementation:
      - Utilized the sendDefault API to compose messages with objectType: 'feed':
        - webUrl and mobileWebUrl: Links must belong to registered domains.
        - buttonTitle: Sets the button text displayed within the KakaoTalk message.
        - imageUrl: Requires an externally accessible URL for images.
      - Sharing counts are not provided via API but can be viewed in the developer console's statistics.
      - SDK load or initialization errors are logged using console.error without disrupting app execution.
    - Additional Setup For Demo:
      - Add vite-env.d.ts in the demo folder to define the VITE_KAKAO_JS_KEY type.
      - Add .env file with VITE_KAKAO_JS_KEY to provide the required JavaScript Key.
Signed-off-by: zmrdltl <[email protected]>
Copy link

changeset-bot bot commented Jan 1, 2025

🦋 Changeset detected

Latest commit: 9bcab03

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
react-share Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support share to kakao talk
1 participant