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 locationObject { lat, lng }
cbfunction - Source:
-
loadSnap(snap, cb)
-
Loads a snap.
Parameters:
Name Type Description snapSnap cbfunction - Source:
-
markSnapScreenshot(secondsViewed, cb)
-
Marks a snap as screenshotted and viewed for secondsViewed seconds.
Parameters:
Name Type Description secondsViewednumber The number of seconds the snap was viewed for.
cbfunction - 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 snapsArray.<SKSnap> An array of SKSnap objects.
timesArray.<Date> An array of Date objects.
secondsViewedArray.<number> An array of numbers.
cbfunction - Source:
-
markSnapViewed(secondsViewed, cb)
-
Marks a snap as opened for secondsViewed seconds.
Parameters:
Name Type Description secondsViewednumber The number of seconds the snap was viewed for.
cbfunction - Source:
-
sendSnap(blob, recipients, text, duration, cb)
-
Sends a snap to everyone in recipients with text text for duration seconds.
Parameters:
Name Type Description blobSKBlob The SKBlob object containing the image or video data to send. Can be created with any NSData object.
recipientsArray.<string> | string An array of username strings.
textstring The text to label the snap with. This text is not superimposed upon the image; you must do that yourself.
durationnumber The length of the snap. It must be greater than 0 or an exception will be raised.
cbfunction - Source:
-
sendSnapCustom(blob, opts, cb)
-
Sends a snap with the given options.
Parameters:
Name Type Description blobSKBlob The SKBlob object containing the image or video data to send. Can be created with any Buffer.
optsSnapOptions The options for the snap to be sent.
cbfunction - Source: