Skip to main content
TikTok for Developers


Share Kit for Android


Share Kit, part of our OpenSDK, enables third party apps to integrate directly with TikTok, providing creator's an ability to edit photos and videos in apps they love and seamlessly share content to TikTok. Using Share Kit and adding TikTok to your app's share sheet has these additional benefits:

  • Ease of use in integrating with TikTok as we provide the boilerplate code in this guide. Seamless sharing straight from your app's sharesheet.
  • Include your app's hashtag in content shared to TikTok. By engaging with the TikTok SDK, third party platforms will not only provide a new channel for their users to share their creations, but also expand the reach of their own platform through specified partner hashtags, as shown in the user journey below.
  • We show a toast to creators to return to your app after sharing content to TikTok.
  • Third party apps can leverage creative effects such as sharing a single image or video as a green screen background.

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 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 with TikTok in different formats.
    1. Format.DEFAULT: The default share format. This format allows your app to share images or videos, as is, with TikTok.
    2. Format.GREEN_SCREEN: See Green Screen 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, 
context.grantUriPermission("", your_content_uri, 

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 1 second.
    • The maximum video duration is 360 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.

If you don't want to integrate using the share kit for now, your app can also share to TikTok in another way.

Share with TikTok by using Intents

Developers can use Intent to share content with TikTok without using our Share Kit. However, using our Share Kit to share content provides additional benefits for our partners and their users with ease of use as mentioned above.


This guide details how to enable sharing from your app to TikTok by using a intents. TikTok supports sharing video, multi-video and multi-image currently.

Sharing on Android

For all types of sharing, create an intent to send simple data to TikTok:

  • Set Intent.ACTION_SEND/ACTION_SEND_MULTIPLE for Intent's action.
  • Set the appropriate MIME type. For example image/* for sharing images and video/mp4 for sharing video.
  • Place a URI / a list of URIs pointing to the content in the extra EXTRA_STREAM.

Here is the example for sharing single-video:

val intent = Intent()
intent.action = Intent.ACTION_SEND
intent.putExtra(Intent.EXTRA_STREAM, uriToImage)
intent.type = "video/*"
yourActivity.startActivityForResult(intent, resultCode)

Sharing multi-image:

val imageUris = mutableListOf<Uri>()
imageUris.add(imageUri1) // Add your image URIs here

val intent = Intent()
intent.action = Intent.ACTION_SEND_MULTIPLE
intent.putExtra(Intent.EXTRA_STREAM, imageUris)
intent.type = "image/*"
yourActivity.startActivityForResult(intent, resultCode)
  • Note: When sharing multi-image with TikTok, TikTok will make a slideshow.

Sharing multi-video:

val videoUris = mutableListOf<Uri>()
videoUris.add(videoUri1) // Add your video URIs here

val intent = Intent()
intent.action = Intent.ACTION_SEND_MULTIPLE
intent.putExtra(Intent.EXTRA_STREAM, videoUris)
yourActivity.startActivityForResult(intent, resultCode)
  • Note: When sharing multi-video with TikTok, TikTok will stitch into a long video. Users can edit the long video in TikTok.

If your shared images or videos are stored in internal storage of your app, then other apps can not access your files. When you want to share files with TikTok, you should grant permissions for these files by calling


PackageName for TikTok

If you don't want to call Intent.createChooser(). You can set packageName to share directly to TikTok.

String TIKTOK_M_PACKAGE = "com.zhiliaoapp.musically";
...//set packagename


TikTok for Developers