SFS2X Objective-C API  1.7.13
iOS / macOS / tvOS
SFSBuddyVariable Class Reference

#import <SFSBuddyVariable.h>

Inherits BaseVariable, and <BuddyVariable>.

Class Methods

(id) + variableWithName:value:type:
 
(id) + variableWithName:value:
 
(id< BuddyVariable >) + fromSFSArray:
 

Properties

BOOL isOffline
 
- Properties inherited from BaseVariable
NSString * name
 
NSString * type
 

Additional Inherited Members

- Instance Methods inherited from BaseVariable
(id) - initWithName:value:type:
 
(id) - getValue
 
(BOOL) - getBoolValue
 
(NSInteger) - getIntValue
 
(NSNumber *) - getDoubleValue
 
(NSString *) - getStringValue
 
(id< ISFSObject >) - getSFSObjectValue
 
(id< ISFSArray >) - getSFSArrayValue
 
(BOOL) - isNull
 
(id< ISFSArray >) - toSFSArray
 
- Protected Attributes inherited from BaseVariable
NSString * _name
 
NSString * _type
 
id _value
 

Detailed Description

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:

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 also
SFSBuddy
SetBuddyVariablesRequest
[ISFSEvents onBuddyVariablesUpdate:]

Method Documentation

◆ variableWithName:value:

+ (id) variableWithName: (NSString *)  name
value: (id)  value 
Parameters
namethe name of the variable
valuethe variable value ( can be BOOL, Integer, Double, String, SFSObject, SFSArray )

Reimplemented from BaseVariable.

◆ variableWithName:value:type:

+ (id) variableWithName: (NSString *)  name
value: (id)  value
type: (NSInteger)  type 
Parameters
namethe name of the variable
valuethe 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

Reimplemented from BaseVariable.

Property Documentation

◆ isOffline

- (BOOL) isOffline
readatomicassign

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.