Snapchat

Enable sharing of media directly to the Snapchat mobile app using the Median JavaScript Bridge.

Overview

This plugin allows you to share text and media directly to the Snapchat mobile app.

Implementation Guide

Checking for availability

Before attempting to share content, check whether Snapchat is installed on the user’s device to prevent errors and improves the user experience.

Use the following JavaScript command:

↔️Median JavaScript Bridge

Run the following Median JavaScript Bridge command to share the screen content

const { isInstalled } = await median.socialShare.snapchat.isInstalled();

Sharing media

Snapchat media sharing only supports media in a Blob object. You can save a remote image as a Blob using the following code snippet.

  fetch("url-to-image")
  .then(function(response) {
    return response.blob();
  })
  .then(function(blob) {
    // here the image is a blob
  });

Other plugins from Median (such as the Web Screenshot Plugin) also export images as Blobs which can then be used with this plugin.


Next Steps