Class SFSInvitation
java.lang.Object
com.smartfoxserver.entities.invitation.SFSInvitation
- All Implemented Interfaces:
Invitation
Overview
An Invitation object provides the ability to send a generic invitation for a specific event going on in your application, be it a game, visiting a personal room or another location of the virtual world etc...The SFS Invitation Manager is very simple to use. All you need to provide is:
- inviter: the User starting the invitation (null == Server)
- invitee: the User to invite
- expiryTime: the amount of time (in seconds) that the invitee has to accept/refuse the invitation. (default is 15 sec)
- params: any custom params to send with the invitation (e.g. a message, game name etc...)
InvitationCallback.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSFSInvitation(User inviter, User invitee, int secondsForAnswer) SFSInvitation(User inviter, User invitee, int secondsForAnswer, ISFSObject params) -
Method Summary
Modifier and TypeMethodDescriptionstatic InvitationfromSFSArray(ISFSArray sfsa) Obtain a reference to the CallBack handler classintThe expiration timestamp.intgetId()Get the unique invitation IDGet the Invitee, the user that receives the invitationGet the Inviter, the user that started this invitationAn SFSObject of custom parameters can be attached to the invitation.intThe amount of seconds given to the invitee to respond to the invitationbooleanChecks if the invitation is expired.voidsetCallback(InvitationCallback callback) Set the CallBack handler for the invitation.voidsetParams(ISFSObject params) An SFSObject of custom parameters can be attached to the invitation.toString()
-
Constructor Details
-
SFSInvitation
-
SFSInvitation
-
-
Method Details
-
fromSFSArray
-
getId
public int getId()Description copied from interface:InvitationGet the unique invitation ID- Specified by:
getIdin interfaceInvitation- Returns:
- the id
-
getParams
Description copied from interface:InvitationAn SFSObject of custom parameters can be attached to the invitation. It could contain any properties relevant to the invitation, like a message, the game type/settings and any other parameter.- Specified by:
getParamsin interfaceInvitation- Returns:
- the custom parameters
- See Also:
-
setParams
Description copied from interface:InvitationAn SFSObject of custom parameters can be attached to the invitation. It could contain any properties relevant to the invitation, like a message, the game type/settings and any other parameter.- Specified by:
setParamsin interfaceInvitation- Parameters:
params- the custom parameters- See Also:
-
getInviter
Description copied from interface:InvitationGet the Inviter, the user that started this invitation- Specified by:
getInviterin interfaceInvitation- Returns:
- the inviter
-
getInvitee
Description copied from interface:InvitationGet the Invitee, the user that receives the invitation- Specified by:
getInviteein interfaceInvitation- Returns:
- the invitee
-
getExpiryTime
public int getExpiryTime()Description copied from interface:InvitationThe expiration timestamp.- Specified by:
getExpiryTimein interfaceInvitation- Returns:
- expiration timestamp.
-
isExpired
public boolean isExpired()Description copied from interface:InvitationChecks if the invitation is expired.- Specified by:
isExpiredin interfaceInvitation- Returns:
- true if the invitation is expired
-
getSecondsForAnswer
public int getSecondsForAnswer()Description copied from interface:InvitationThe amount of seconds given to the invitee to respond to the invitation- Specified by:
getSecondsForAnswerin interfaceInvitation- Returns:
- the amount of seconds given to the invitee to respond to the invitation
-
getCallback
Description copied from interface:InvitationObtain a reference to the CallBack handler class- Specified by:
getCallbackin interfaceInvitation- Returns:
- the callback handler
- See Also:
-
setCallback
Description copied from interface:InvitationSet the CallBack handler for the invitation. The handler will be invoked by the system when the invited User accepts or refuses the invitation or if the invitation expires.- Specified by:
setCallbackin interfaceInvitation- Parameters:
callback- the callback handler- See Also:
-
toString
-