Skip to main content

SnapchatFriendUserInfo

Class

Details about friendship between the active user and another user.

  • Available on all platforms
Platform details: Snapchat, SPECS, Camera Kit Web, Camera Kit Mobile fully supported.

Platform details

  • Snapchat — Fully supported.

  • SPECS — Fully supported.

  • Camera Kit Web — Fully supported.

  • Camera Kit Mobile — Fully supported.

Since Lens Scripting v347

Index

Example

async function getFriends() {
return new Promise(function (resolve, reject) {
global.userContextSystem.getAllFriends(function (friends) {
resolve(friends);
});
});
}

async function init(){
let friends = await getFriends();
friends.forEach(f => {
let friendshipStartDate = f.friendInfo.friendshipStart;
let lastInteractionTime = f.friendInfo.lastInteractionTime;
print(`Friendship with ${f.displayName} started on ${friendshipStartDate}, last interacted on ${lastInteractionTime}`)
});
}

init();

Properties

friendshipStart

readonly friendshipStart: Date

When this friendship started.

Since

Lens Scripting Version 347


lastInteractionTime

readonly lastInteractionTime: Date

Last interaction between this user and the active one.

Since

Lens Scripting Version 347

Methods

getTypeName()

static getTypeName(): TypeName<SnapchatFriendUserInfo>

Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().

Returns

TypeName<SnapchatFriendUserInfo>

Since

Lens Scripting Version 347