Snaps


new Snaps(opts)

Snapchat wrapper for Snap-related API calls.

Parameters:
Name Type Description
opts Object
Source:

Methods


loadFiltersForLocation(location, cb)

Loads filters for a location.

Parameters:
Name Type Description
location Object

{ lat, lng }

cb function
Source:

loadSnap(snap, cb)

Loads a snap.

Parameters:
Name Type Description
snap Snap
cb function
Source:

markSnapScreenshot(secondsViewed, cb)

Marks a snap as screenshotted and viewed for secondsViewed seconds.

Parameters:
Name Type Description
secondsViewed number

The number of seconds the snap was viewed for.

cb function
Source:

markSnapsViewed(snaps, times, secondsViewed, cb)

Marks a set of snaps as opened for the specified length at the given times.

Parameters:
Name Type Description
snaps Array.<SKSnap>

An array of SKSnap objects.

times Array.<Date>

An array of Date objects.

secondsViewed Array.<number>

An array of numbers.

cb function
Source:

markSnapViewed(secondsViewed, cb)

Marks a snap as opened for secondsViewed seconds.

Parameters:
Name Type Description
secondsViewed number

The number of seconds the snap was viewed for.

cb function
Source:

sendSnap(blob, recipients, text, duration, cb)

Sends a snap to everyone in recipients with text text for duration seconds.

Parameters:
Name Type Description
blob SKBlob

The SKBlob object containing the image or video data to send. Can be created with any NSData object.

recipients Array.<string> | string

An array of username strings.

text string

The text to label the snap with. This text is not superimposed upon the image; you must do that yourself.

duration number

The length of the snap. It must be greater than 0 or an exception will be raised.

cb function
Source:

sendSnapCustom(blob, opts, cb)

Sends a snap with the given options.

Parameters:
Name Type Description
blob SKBlob

The SKBlob object containing the image or video data to send. Can be created with any Buffer.

opts SnapOptions

The options for the snap to be sent.

cb function
Source: