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

#import <JoinRoomInvitationRequest.h>

Inherits BaseRequest.

Instance Methods

(id) - initWithInvitedUserNames:targetRoom:expirySeconds:asSpectator:params:
 

Class Methods

(id) + initWithInvitedUserNames:targetRoom:expirySeconds:asSpectator:params:
 

Protected Attributes

id< Room > _targetRoom
 
NSArray * _invitedUserNames
 
NSInteger _expirySeconds
 
BOOL _asSpectator
 
id< ISFSObject > _params
 

Properties

id< Room > targetRoom
 
NSArray * invitedUserNames
 
NSInteger expirySeconds
 
BOOL asSpectator
 
id< ISFSObject > params
 

Detailed Description

Sends an invitation to other users/players to join a specific Room. Invitations can be used for different purposes such as playing games, visiting a specific Room, Buddy requests etc...

Depending on the Room's settings this invitation can be sent only by Room's owner or by all other players, with the exception of spectators. This behavior can be changed via the RoomSetting.allowOwnerOnlyInvitation parameter.

NOTE: spectators in a game Room are not allowed to invite other people.

An invitation can also specify the amount of time given to each invitee to reply. Default is 30 seconds. A positive answer will attempt to join the user in the designated Room. For game Rooms the asSpectator flag can be toggled to join the invitee as player or spectator (default = player).

There aren't any specific notifications sent back to the inviter after the invitee's response. Users that have accepted the invitation will join the Room while those who didn't reply or turned down the invitation won't generate any event. In case you want to send specific messages (e.g. chat) you can simply send a private message back to the inviter.

See also
RoomSettings

Method Documentation

◆ initWithInvitedUserNames:targetRoom:expirySeconds:asSpectator:params:

+ (id) initWithInvitedUserNames: (NSArray *)  invitedUserNames
targetRoom: (id< Room >)  room
expirySeconds: (NSInteger)  secs
asSpectator: (BOOL)  asSpect
params: (id< ISFSObject >)  params 

Sends an invitation to join an existing Room.

Parameters
invitedUserNamesan array of online user names to invite in the Room
targetRoomthe target Room for the invitation
expirySecondshow much time each invitee has to reply, in seconds (suggested = 30-60 secs)
asSpectindicates whether the invited people will join the target Room as players or spectators
paramsoptional SFSObject containing custom data about the invitation (e.g. custom message, game info etc...)
See also
[ISFSEvents onInvitationReply:]