Lens Scripting API

    Class UserContextSystem

    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);
    });

    Hierarchy (View Summary, Expand)

    Index

    Constructors

    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

      Returns void

    • Provides the user's current altitude in meters.

      Parameters

      • callback: (data: number) => void

      Returns void

    • Exposes User Data

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

      Parameters

      • callback: (data: Date) => void

      Returns void

    • Exposes User Data

      Provides the user's birth date as localized string.

      Parameters

      • callback: (formattedData: string) => void

      Returns void

    • Exposes User Data

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

      Parameters

      • callback: (data: string) => void

      Returns void

    • Provides the user's display name.

      Parameters

      • callback: (data: string) => void

      Returns void

    • Provides the user's current temperature in celsius.

      Parameters

      • callback: (data: number) => void

      Returns void

    • Provides the user's current temperature in fahrenheit.

      Parameters

      • callback: (data: number) => void

      Returns void

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

      Parameters

      • callback: (formattedData: string) => void

      Returns void

    • Exposes User Data

      Provides the user's username.

      Parameters

      • callback: (data: string) => 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

      Returns void

    MMNEPVFCICPMFPCPTTAAATR