Inherits from BaseVariable : NSObject
Conforms to BuddyVariable
Declared in SFSBuddyVariable.h
SFSBuddyVariable.m

Overview

BuddyVariables are custom values attached to any Buddy in a BuddyList. They work with the same principle of the User/Room Variables.

The only difference is the logic by which they get propagated to other Users. While RoomVariables are broadcast to all clients in the same Room, BuddyVariables are updated to all Users who have the BuddyVariable owner in their BuddyLists.

BuddyVariables support basic data types and nested complex objects:

  • Null
  • Bool
  • Int
  • Double
  • String
  • SFSObject
  • SFSArray

Also there is a special convention that allows certain Variables to be “offline” Buddy Variables. All variable names starting with a dollar sign ($) will set the BuddyVariable as persistent and make them available at any time whether the owner is online or not.

See SFSBuddy, , [ISFSEvents onBuddyVariablesUpdate:]

Properties

isOffline

Return true if this is an offline Buddy Variable

@property (readonly) BOOL isOffline

Discussion

Return true if this is an offline Buddy Variable

By convention any Buddy Variable whose name starts with the dollar sign ($) will be regarded as persistent and stored locally by the server.

These variables are also referred to as “offline variables” because they are available to other Users even when the Buddy is offline.

Declared In

SFSBuddyVariable.h

Class Methods

variableWithName:value:

the name of the variable

+ (id)variableWithName:(NSString *)name value:(id)value

Parameters

name

the name of the variable

value

the variable value ( can be BOOL, Integer, Double, String, SFSObject, SFSArray )

Declared In

SFSBuddyVariable.h

variableWithName:value:type:

the name of the variable

+ (id)variableWithName:(NSString *)name value:(id)value type:(NSInteger)type

Parameters

name

the name of the variable

value

the variable value ( can be BOOL, Integer, Double, String, SFSObject, SFSArray )

type

(optional -1) it’s usually not necessary to pass this parameter as the variable value is auto-detected

Declared In

SFSBuddyVariable.h