SFSInvitation validation.

Post here your questions about the Objective-C API for SFS2X

Moderators: Lapo, Bax

mmilen
Posts: 298
Joined: 09 Nov 2010, 00:48
Contact:

SFSInvitation validation.

Postby mmilen » 28 Jun 2012, 23:28

Hi,

I do send SFS from iOS to a user with 40 seconds time for response. The invited user attempts to join the game via custom Jon_game handler, in the the join request I do add a parameter "inv"='SFSInvitation id' .

Now on the server side I need to check if the Invitation is valid before joining the player.

How do I get a reference to the SFSInvitationManager and check the invitation using it's ID.
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: SFSInvitation validation.

Postby rjgtav » 29 Jun 2012, 09:32

Hi.
You can access the Invitation Manager through the SmartFoxServer class:

Invitation invitation = SmartFoxServer.getInvitationManager().findById(invitationId);
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
mmilen
Posts: 298
Joined: 09 Nov 2010, 00:48
Contact:

Re: SFSInvitation validation.

Postby mmilen » 29 Jun 2012, 11:30

Thanks.
mmilen
Posts: 298
Joined: 09 Nov 2010, 00:48
Contact:

Re: SFSInvitation validation.

Postby mmilen » 29 Jun 2012, 11:32

adding that to the text of the SFSInvitationManager JavaDoc would be nice.
User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: SFSInvitation validation.

Postby Lapo » 30 Jun 2012, 07:30

This is not the way it is supposed to work, that's why it's not in the docs.
If you want to validate an invitation, don't let the client send it. The client should instead send a request to your Extension which performs the validation and sends the Invitation from the server side API.

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SFS2X iPhone / iPad / OSX API”

Who is online

Users browsing this forum: No registered users and 14 guests