Provides information about the user such as display name, birthday, and current weather. Accessible through global.userContextSystem.

All callbacks will execute as soon as the requested information is available. In some rare cases, the requested information may be completely unavailable, and the callback will never occur.

Note that formatted or localized strings may appear differently to users depending on their region.

global.userContextSystem.requestDisplayName(function(displayName) {
print("Hello " + displayName);
});

global.userContextSystem.requestWeatherLocalized(function(weatherText) {
print("The weather outside is: " + weatherText);
});

global.userContextSystem.requestAltitudeFormatted(function(altitude) {
print("Your altitude is: " + altitude);
});


global.userContextSystem.requestCity(function(city) {
print("Your city is: " + city);
});

global.userContextSystem.requestBirthdateFormatted(function(birthdate) {
print("Your birthday is: " + birthdate);
});
interface UserContextSystem {
    getAllFriends(callback: ((data: SnapchatUser[]) => void)): void;
    getBestFriends(callback: ((data: SnapchatUser[]) => void)): void;
    getCurrentUser(callback: ((data: SnapchatUser) => void)): void;
    getMyAIUser(callback: ((data: SnapchatUser) => void)): void;
    getTypeName(): string;
    getUsersInCurrentContext(callback: ((data: SnapchatUser[]) => void)): void;
    isOfType(type: string): boolean;
    isSame(other: ScriptObject): boolean;
    requestAltitudeFormatted(callback: ((formattedData: string) => void)): void;
    requestAltitudeInMeters(callback: ((data: number) => void)): void;
    requestBirthdate(callback: ((data: Date) => void)): void;
    requestBirthdateFormatted(callback: ((formattedData: string) => void)): void;
    requestCity(callback: ((data: string) => void)): void;
    requestDisplayName(callback: ((data: string) => void)): void;
    requestTemperatureCelsius(callback: ((data: number) => void)): void;
    requestTemperatureFahrenheit(callback: ((data: number) => void)): void;
    requestTemperatureFormatted(callback: ((formattedData: string) => void)): void;
    requestUsername(callback: ((data: string) => void)): void;
    requestWeatherCondition(callback: ((data: WeatherCondition) => void)): void;
    requestWeatherLocalized(callback: ((formattedData: string) => void)): void;
}

Hierarchy (view full)

Methods

  • Exposes User Data

    Retrieve the Snapchatter's friends list in order to access details like display name, birthdate, or Bitmoji

    Parameters

    Returns void

  • Exposes User Data

    Retrieve the Snapchatter's best friends in order to access details like display name, birthdate, or Bitmoji.

    Parameters

    Returns void

  • Exposes User Data

    Retrieve a SnapchatUser representing the current user.

    Parameters

    Returns void

  • Exposes User Data

    Retrieve a SnapchatUser object for MyAI which you can use to access the MyAI Bitmoji or other details.

    Parameters

    Returns void

  • Exposes User Data

    Gets the list of friends in the current context, such as 1:1 chats, 1:many chats, and group chats.

    Parameters

    Returns void

  • Returns true if the object matches or derives from the passed in type.

    Parameters

    • type: string

    Returns boolean

  • Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

    Parameters

    Returns boolean

  • Provides the user's current altitude as a localized string.

    Parameters

    • callback: ((formattedData: string) => void)
        • (formattedData): void
        • Parameters

          • formattedData: string

          Returns void

    Returns void

  • Provides the user's current altitude in meters.

    Parameters

    • callback: ((data: number) => void)
        • (data): void
        • Parameters

          • data: number

          Returns void

    Returns void

  • Exposes User Data

    Provides the user's birth date as a Date object.

    Parameters

    • callback: ((data: Date) => void)
        • (data): void
        • Parameters

          • data: Date

          Returns void

    Returns void

  • Exposes User Data

    Provides the user's birth date as localized string.

    Parameters

    • callback: ((formattedData: string) => void)
        • (formattedData): void
        • Parameters

          • formattedData: string

          Returns void

    Returns void

  • Exposes User Data

    Provides the name of the city the user is currently located in.

    Parameters

    • callback: ((data: string) => void)
        • (data): void
        • Parameters

          • data: string

          Returns void

    Returns void

  • Provides the user's display name.

    Parameters

    • callback: ((data: string) => void)
        • (data): void
        • Parameters

          • data: string

          Returns void

    Returns void

  • Provides the user's current temperature in celsius.

    Parameters

    • callback: ((data: number) => void)
        • (data): void
        • Parameters

          • data: number

          Returns void

    Returns void

  • Provides the user's current temperature in fahrenheit.

    Parameters

    • callback: ((data: number) => void)
        • (data): void
        • Parameters

          • data: number

          Returns void

    Returns void

  • Provides the user's current temperature as a localized string.

    Parameters

    • callback: ((formattedData: string) => void)
        • (formattedData): void
        • Parameters

          • formattedData: string

          Returns void

    Returns void

  • Exposes User Data

    Provides the user's username.

    Parameters

    • callback: ((data: string) => void)
        • (data): void
        • Parameters

          • data: string

          Returns void

    Returns void

  • Provides the user's current weather condition.

    Parameters

    Returns void

  • Provides the user's current weather condition as a localized string.

    Parameters

    • callback: ((formattedData: string) => void)
        • (formattedData): void
        • Parameters

          • formattedData: string

          Returns void

    Returns void