/** * An enum representing the different Login states. */ export declare enum LoginState { /** * Called when the login request has started after the user has confirmed they want to approve the third party for * access to the scopes listed. */ LOGIN_KIT_LOGIN_STARTED = "LOGIN_KIT_LOGIN_STARTED", /** * Called when login through Snapchat has succeeded. */ LOGIN_KIT_LOGIN_SUCCEEDED = "LOGIN_KIT_LOGIN_SUCCEEDED", /** * Called when login through Snapchat has failed. */ LOGIN_KIT_LOGIN_FAILED = "LOGIN_KIT_LOGIN_FAILED", /** * Called whenever the User explicitly logs out via `clearToken()` or whenever the server returns `401`, requiring * forced logout. */ LOGIN_KIT_LOGOUT = "LOGIN_KIT_LOGOUT" } /** * An enum representing the different scopes your app can access. Scopes let your application declare which Login Kit * features it wants access to. If a scope is toggleable, the user can deny access to one scope while agreeing to grant * access to others. */ export declare enum UserDataScopes { /** * Grants access to the user's Snapchat display name. */ DISPLAY_NAME = "https://auth.snapchat.com/oauth2/api/user.display_name", /** * Grants access to the user's Bitmoji avatar; toggleable by user. */ BITMOJI_AVATAR = "https://auth.snapchat.com/oauth2/api/user.bitmoji.avatar" } /** * An interface representing the data model related to the active (connected) Snapchat User. */ export interface UserData { /** * The public display name of the user. */ displayName?: string; /** * The unique identifier for this user on your app. */ externalId?: string; /** * The public profile link for this Snapchat user. */ profileLink?: string; /** * The bitmoji avatar id. */ bitmojiId?: string; /** * The bitmoji url of the user. * @deprecated use 'bitmojiAvatar' instead. */ bitmojiSelfie?: string; /** * The bitmoji url of the user. */ bitmojiAvatar?: string; /** * A JSON blob representing the bitmoji sticker data. */ bitmojiPacksJson?: string; } /** * An interface representing the successful return response for the `verify()` and `verifyAndLogin()` calls. * * Note: A successful Verify response doesn't confirm if the phone number has been verified. You still need to make the * Server API call to confirm the result of the verification. */ export interface VerifyResponse { /** * A phone ID generated for the phone number and used to check that the number was successfully verified by Snapchat. */ phoneId: string | null; /** * A verify ID generated for the verify request and used with the `phoneId` to check if the phone number was * successfully verified by Snapchat. */ verifyId: string | null; } export declare type LoginKitType = { /** * 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 the `DeviceEventEmitter`, for example: *
* const eventCallbackLoginStarted = () => {
* // handle event emitted
* };
*
* // Subscribing to event
* const loginStartedListener = DeviceEventEmitter.addListener(
* LoginState.LOGIN_KIT_LOGIN_STARTED,
* eventCallbackLoginStarted
* );
*
* // Unsubscribing to event
* loginStartedListener.removeListener();
*
*
* @returns Promise resolves when login is successful or rejects when login fails.
*/
login(): Promise* 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. * * @param countryCode 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.
*
* @returns Promise resolves with returned verify response or rejects if there was an issue during verification.
*/
verify(phoneNumber: string, countryCode: string): Promise
* 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.
*
* @param countryCode 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.
*
* @returns Promise resolves with returned verify response or rejects if there was an issue during verification.
*/
verifyAndLogin(phoneNumber: string, countryCode: string): Promise