Share Content
Learn how to share Images/Video/Live Camera content on to Snapchat
Snapchat Kit allows to share image, video and even live camera. Along with the sharing media, you can attach stickers of your choice and attachment links (Check next article on how to add additional data).
Sharing content can be of three types
  • eSnapchatContentType.Photo
Images must be JPG or PNG. Size must be <= 15MB
  • eSnapchatContentType.Video
Videos must be <= 15MB in size Videos must be 15 seconds or shorter. Must be MP4 format
  • eSnapchatContentType.LiveCamera
    Opens up the camera for sharing live camera content

1. Create SnapchatContent instance by passing the content type.

For Sharing Image
1
SnapchatContent content = new SnapchatContent(eSnapchatContentType.Photo)
Copied!
For Sharing Video
1
SnapchatContent content = new SnapchatContent(eSnapchatContentType.Video)
Copied!
For Sharing Live Camera
1
SnapchatContent content = new SnapchatContent(eSnapchatContentType.LiveCamera)
Copied!

2. Set sharing content data

Pass file path of the sharing content to SnapchatContent instance.
1
content.SetContentData("PATH_TO_SHARING_CONTENT");
Copied!

3. Share and receive status in callback

Pass created SnapchatContent instance to SnapchatKitManager and register for callback
1
SnapchatKitManager.Share(content, OnShareComplete);
Copied!

Example

1
using VoxelBusters.SnapchatKit;
2
3
void ShareToSnapchat(string contentFilePath, bool isVideo)
4
{
5
SnapchatContent content;
6
if(isVideo)
7
{
8
content = new SnapchatContent(eSnapchatContentType.Video);
9
}
10
else
11
{
12
content = new SnapchatContent(eSnapchatContentType.Photo);
13
}
14
15
// Set content data
16
content.SetContentData(contentFilePath);
17
18
// Share
19
SnapchatKitManager.Share(content, OnShareComplete);
20
}
21
22
private void OnShareComplete(bool success, string error)
23
{
24
string message = success ? "Successfully Shared" : "Failed to share " + error;
25
Debug.Log(message);
26
}
Copied!
Last modified 2yr ago
Copy link
Contents
Example