Promise resolves when login is successful or rejects when login fails.
Checks if the user is authenticated using Snapchat and has a valid auth token.
Promise resolves true
if the user is authenticated using Snapchat, false
otherwise.
Returns the current local access token for the logged in user.
Note: If this method returns null, the access token may need to be refreshed by calling refreshAccessToken()
.
Promise resolves null
if there is no access token or the access token.
Refreshes the user's access token.
Promise resolves with the new access token or rejects if an access token cannot be refreshed.
Method to clear the access token. This method is used for logging out the user.
Determines whether the user has authorized the current session to have access to resources with the requested scope.
the scope to check access.
Promise resolves true
if the current session has access to resources with the scope, false
otherwise.
Method to fetch user data based on the scopes requested.
GraphQL query to request user data.
Record of variables for your GraphQL request.
Promise resolves with returned user data or rejects if there was an issue fetching the data.
Start the flow for Verify with Snapchat.
This checks an inputted phone number and verify that it matched the one on file for the user's Snapchat account. Users will be redirected to Snapchat to verify their phone number; once the number has been confirmed, user will return back to the app.
Note: This API is currently only supported on iOS.
A phone number with appropriate area codes that needs to be verified.
This should follow the National Format specified by the ITU-T Recommendation E.123.
For example, (302) 123-4567 is the National Format for this International Number +1 (302) 123-4567.
Note that the number doesn't specifically need to be formatted with Parentheses, Hyphens, Spaces, or other separating symbols and so 3021234567 will also work.
The two-letter country code (as per the ISO 3166-1 alpha-2 ) in upper-case that represents the country this phone number applies to.
For example, US is the country code for this International Number +1 (302) 123-4567.
Promise resolves with returned verify response or rejects if there was an issue during verification.
Start the flow for Verify and Login with Snapchat.
This checks an inputted phone number and verify that it matched the one on file for the user's Snapchat account. Users will be redirected to Snapchat to verify their phone number; once the number has been confirmed, they will be redirected to the Login / OAuth modal. After authorization, user will return back to the app.
Note: This API is currently only supported on iOS.
A phone number with appropriate area codes that needs to be verified.
This should follow the National Format specified by the ITU-T Recommendation E.123.
For example, (302) 123-4567 is the National Format for this International Number +1 (302) 123-4567.
Note that the number doesn't specifically need to be formatted with Parentheses, Hyphens, Spaces, or other separating symbols and so 3021234567 will also work.
The two-letter country code (as per the ISO 3166-1 alpha-2 ) in upper-case that represents the country this phone number applies to.
For example, US is the country code for this International Number +1 (302) 123-4567.
Promise resolves with returned verify response or rejects if there was an issue during verification.
Generated using TypeDoc
Begins the authentication flow using OAuth by linking into the Snapchat app. If the user does not have the Snapchat app installed, it will open up a WebView to Snapchat’s web authentication page.
You can register for
LoginState
updates using theDeviceEventEmitter
, for example: