Friends

Elements supports the concept of Friends between to Users. Friends are made at the User level and not at the Profile level. When two users are Friends, they have the following privileges.

  • Friends may view Leaderboard rankings relative to other friends.
  • Friends may view each other's Profiles associated with their account.
  • When one user views a User through a Friend, Elements will intentionally hide personal information.
  • Cloud Functions may perform friend checks and alter the behavior as the Friend API is fully exposed to the scripting engine.

Elements models Friends as a bi-directional relationship between two Users. The Friend model contains the following properties:

  • id
  • user - the User which is the other friend. This contains limited information on the User as some of it may be personally identificable.
  • profiles - the Profiles of the other User.
  • friendship - indicates the kind of friendship between the Users.
  • NONE - there is no association between the users. This is used internally and APIs should almost never use this value.
  • OUTGOING - the logged-in User has requested friendship from the other user
  • INCOMING - the other User has requested friendship from the currently logged-in user
  • MUTUAL - both users have accepted friendship.

Automatic Facebook Friends

When two Users connect with Facebook, Elements will automatically scan their friends list and mirror that association within Elements. This behavior is hardcoded in the Facebook workflow and cannot be disabled. Each new Facebook session forces a refresh of the friends list.

Associating Friends

At the time of this writing, you must write a Cloud Function to make Friend associations. This ensures that your game or application can make friend associations using the rules of your application. See the scripting API on the Friends Service for more details.