not receiving onUserVariablesUpdate

Post here all your questions related with the SmartFoxServer iPhone API

Moderators: Lapo, Bax

intomo
Posts: 51
Joined: 22 Nov 2010, 21:21
Location: Los Angeles

not receiving onUserVariablesUpdate

Postby intomo » 25 Feb 2011, 01:36

Can you tell me what I'm doing wrong?
I'm setting variables for my user.

Code: Select all

NSString *test = @"blah";
   
   NSDictionary *dict = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:test,nil]
                                        forKeys:[NSArray arrayWithObjects:@"score",nil]];
   [self.smartFox setUserVariables:dict roomId:self.smartFox.activeRoomId];

But it does not fire onUserVariablesUpdate.

Am I setting the variables wrong?
Would the event fire on the same client that I am setting on, or do I have to test it with two clients?

BTW, all rooms have been set up with the config file on the server.

Many thanks
rahulvyas
Posts: 19
Joined: 05 Jul 2010, 05:23
Location: Jaipur,Rajasthan
Contact:

Postby rahulvyas » 25 Feb 2011, 07:50

you will receieve the notification if you have implemented onUserVariablesUpdate method. And if you have set user variables correctly.

Here is an example of mine

Code: Select all

 - (void)setAdditionalDetailsForSFSUser:(NSDictionary*)object roomID:(NSInteger)roomID {
   
   [self.smartFox setUserVariables:object roomId:roomID];
}
Thanks & Regards,
Rahul Vyas,
iPhone Developer.
intomo
Posts: 51
Joined: 22 Nov 2010, 21:21
Location: Los Angeles

Postby intomo » 25 Feb 2011, 15:48

Can you give me a bit more of an example from your code? I'm not finding this in any of the examples.
intomo
Posts: 51
Joined: 22 Nov 2010, 21:21
Location: Los Angeles

Postby intomo » 25 Feb 2011, 20:42

More is revealed. Apparently my mistake. Apparently you don't get onUserVariablesUpdate event on the same client as userVariables are set. That would make sense. Could not see that when only testing one client.

Return to “iPhone Objective-C API”

Who is online

Users browsing this forum: No registered users and 14 guests