Skip to main content
TikTok for DevelopersTikTok for Developers


Share Kit for Android

This guide demonstrates how to enable sharing videos and images from your app to TikTok.


Before sharing videos to TikTok from your app, you must complete all the steps in Android Quickstart.

Obtain the client_key located in the Appdetails section of your app on the TikTok for Developers website. Then add Share Kit and Login Kit to your app by navigating to the Manage apps page, and clicking + Add products.

Send a share request

  1. Create a ShareApi to send a share request.
  2. Build share content for images and videos into the MediaContent model.
  3. Create a ShareRequest object and set the required parameters. You can use the shareFormat field in the share request object to share images or videos to TikTok in different formats.
    1. Format.DEFAULT: The default share format. This format allows your app to share images or videos, as is, to TikTok.
    2. Format.GREEN_SCREEN: See Green Screen Kit for more details.
  4. Call the Share() method in ShareApi .
/* Step 1 */
shareApi = ShareApi(
    activity = [your_activity],

/* Step 2 */
val mediaContent = MediaContent(
    mediaType = if (isSharingImage) MediaType.IMAGE else MediaType.VIDEO, 
    mediaPaths = mediaUrls, // a list of selected media paths
// use Share.Format.GREEN_SCREEN for green screen share and Share.Format.DEFAULT for default share
val shareFormat = shareFormat = if (greenScreenEnabled) { 
} else {

/* Step 3 */
val request = ShareRequest(
    clientKey = clientKey,
    mediaContent = mediaContent,
    shareFormat = shareFormat,
    packageName = [package name of your activity which will receive share result intent from TikTok, e.g com.bytedance.sdk.demo.share],
    resultActivityFullPath = [full class path of your activity which will receive share result intent from TikTok, e.g com.bytedance.sdk.demo.share.ShareActivity]

/* Step 4 */

If you want to share a file with the file:///Uri path, follow Android's FileProvider instruction to create content://Uri for the file first, and then share it with TikTok.

Make sure you also grant TikTok access permission to your content Uri:

context.grantUriPermission("com.zhiliaoapp.musically", your_content_uri, Intent.FLAG_GRANT_READ_URI_PERMISSION)

context.grantUriPermission("", your_content_uri, Intent.FLAG_GRANT_READ_URI_PERMISSION)

After a successful sharing session, a dialog will prompt the user to either go back to their app or stay in TikTok.

If you want to receive callbacks when users stay in TikTok, register to receive a broadcast.

public static final String ACTION_STAY_IN_TT = "";

Receive callbacks

Provide the package name and the activity full path in the ShareRequest and then the response will be sent to your activity.

Make sure you have set android:exported="true" for your activity so that it can receive messages from sources outside its application.

    android:name="You activity which is gonna receive the sharing result intent from TikTok"

Parse ShareResponse from intent with ShareApi.getShareResponseFromIntent.

shareApi.getShareResponseFromIntent(intent)?.let { 
    val isSuccess = it.isSuccess
    val errorCode = it.errorCode
    val subErrorCode = it.subErrorCode
    val errorMsg = it.errorMsg

Requirements for media

  • For video sharing:
    • The minimum video duration is 3 seconds.
    • The supported video media type is .mp4.
    • The maximum frame size is 1100 px.
    • For multi-videos, the maximum number of videos is 35.
  • For image sharing:
    • The number of images should be more than 1 and up to 35.
  • For green screen sharing:
    • The number of images and videos should only be 1.
  • You must be authorized to use any brand logos and watermarks. See TikTok Brand and Use Guidelines for more details.

Error handling

If you receive an error sharing response, refer to the table below for error handling and debugging.

Error Code

Sub Error Code

Error Message






Unknown error.



Parameters parsing error.



App certificate does not match configurations。



TikTok has no album permissions.



TikTok Network error.



Photo doesn't meet requirements.



Processing photo resources failed.



Video format is not supported.



Sharing canceled.



Users store shared content for draft or user accounts are not allowed to post videos.



Share Denied.