Creative Kit

Creative Kit lets users to share images or videos from your app to Snapchat camera or preview. An attachment URL, a caption, and a sticker can be added optionally. After the content is shared into Snapchat, users can apply any of Snapchat’s creative tools to edit the shared content before sending it to their friends or stories.

Requirements

To share any files with Snapchat, your app must target the right Android support library:

  • Android support library 22+

Getting started

We share the Creative Kit and Core Kit AARs from our Maven repository. To access them, add the following to your root project's build.gradle file:

repositories {
   maven {
       url "https://storage.googleapis.com/snap-kit-build/maven"
   }
}

Note: If you have trouble accessing Google (used in the link above), you can use our GitHub Maven repository with the following code block:

repositories {
   maven {
       url "https://raw.githubusercontent.com/Snap-Kit/release-maven/repo"
   }
}

Next, add the following implementation to the dependencies section of your application’s build.gradle file, not the root project’s build.gradle:

dependencies {
   ...
   implementation([
           'com.snapchat.kit.sdk:creative:1.1.4',
           'com.snapchat.kit.sdk:core:1.1.4'
   ])
}

Set up your application’s AndroidManifest.xml:

<application ...>
   <!-- Please put your client id here -->
   <meta-data android:name="com.snapchat.kit.sdk.clientId" android:value="your app’s client id" />

   <!-- See below in the next section for how to setup FileProvider -->
</application>

Set up your FileProvider to share media files to Snapchat.

To share any media or sticker content to Snapchat, follow the protocol specified by FileProvider API. Once you have set this up, your AndroidManifest.xml will contain the following under <application>:

        <provider
            android:authorities="${applicationId}.fileprovider"
            android:name="android.support.v4.content.FileProvider"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/file_paths"
                />
        </provider>

Note: The authority used by the SDK is explicitly <your-package-name>.fileprovider. Please ensure you follow this convention when setting the value. If you have different package names for debug and production builds, the ${applicationId} should resolve to it appropriately.


Features

Preparing a photo or video to send to Snapchat

A Snap with a still image or video is displayed in Snapchat’s preview screen, where the user can make the final modifications before sending it. Similarly, a Snap without any pre-populated content is displayed in Snapchat’s camera screen, letting users create their own content in a regular Snapchat flow. In both cases, your app can add metadata or overlays — like caption text, sticker images, and attachment URLs — to embed with the Snap.

This section explains how to use Creative Kit’s interfaces to let your users send to Snapchat.

Media size and length restrictions

  • Videos and photos must be 15 MB or smaller.
  • Use MP4 for video. For photos, use JPEG or PNG.
  • Videos must be 15 seconds or shorter.

A basic call:

SnapCreativeKitApi snapCreativeKitApi = SnapCreative.getApi(<Your-Activity>);
SnapMediaFactory snapMediaFactory = SnapCreative.getMediaFactory(<Your-Activity>);
snapCreativeKitApi.send(<Your-content>); // See below for examples

How your actual calls will look depends on your content. To provide still images for users to send to Snapchat, specify the photo content:

SnapMediaFactory snapMediaFactory = SnapCreative.getMediaFactory(<Your-Activity>);
SnapPhotoFile photoFile;
try {
   photoFile = snapMediaFactory.getSnapPhotoFromFile(<Your-photo-file>);
} catch (SnapMediaSizeException e) {
   handleError(e);
   return;
}
SnapPhotoContent snapPhotoContent = new SnapPhotoContent(photoFile);
snapCreativeKitApi.send(snapPhotoContent);

To provide videos for your users to send to Snapchat, specify the video content:

SnapMediaFactory snapMediaFactory = SnapCreative.getMediaFactory(<Your-Activity>);
SnapVideoFile videoFile;
try {
   videoFile = snapMediaFactory.getSnapVideoFromFile(<Your-video-file>);
} catch (SnapMediaSizeException|SnapVideoLengthException e) {
   handleError(e);
   return;
}
SnapVideoContent snapVideoContent = new SnapVideoContent(videoFile)
snapCreativeKitApi.send(snapVideoContent);

Or send your users right into the live camera on Snapchat:

SnapLiveCameraContent snapLiveCameraContent = new SnapLiveCameraContent();

Sharing with overlay stickers, caption text, and attachment URLs

You can add sticker overlays, caption text, and attachment URLs to any Snap content type — including when deeplinking to the live camera.

Media size and length restrictions

  • Stickers must be JPEG or PNG 1 MB or smaller.
  • Android currently does not support animated stickers.
  • Universal links are not supported

For stickers specifically, you can set the size, rotation, and placement position. Here’s an example:

SnapSticker snapSticker = null;
try {
    snapSticker = snapMediaFactory.getSnapStickerFromFile(stickerFile);
} catch (SnapStickerSizeException e) {
    handleError(e);
    return;
}
// Height and width~~ ~~in pixels
snapSticker.setWidth(300);
snapSticker.setHeight(300);

// Position is specified as a ratio between 0 & 1 to place the center of the sticker
snapSticker.setPosX(0.5f);
snapSticker.setPosY(0.5f);

// Specify clockwise rotation desired
snapSticker.setRotationDegreesClockwise(0); // degrees clockwise
<your-snap-content>.setSnapSticker(snapSticker);
// Note: Your snap content can be video, photo, or live-camera content

Provide captions for your users to easily add, letting their friends find your website directly from the Snap. Here’s how to add captions and URLs:

SnapCreativeKitApi snapCreativeKitApi = new SnapCreativeKitApi(<your-activity>, CLIENT_ID);
// Shows up as a caption text on top of the Snap
// User will be able to edit the vertical position in Preview screen
<snapContent>.setCaptionText(<your-caption-text>);

// The viewer of your Snap can swipe up to open this URL
<snapContent>.setAttachmentUrl(<your-website-url>);

snapCreativeKitApi.send(cameraPreviewSnapContent);

That’s it! You just learned how to integrate the Snapchat experience into your app.


Known issues on Android

Animated and WebP stickers are not yet supported.

What’s next

Is this page helpful?
Thanks for your feedback!