not receiving onUserVariablesUpdate

Post here all your questions related with the SmartFoxServer iPhone API

Moderators: Lapo, Bax

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

not receiving onUserVariablesUpdate

Post by intomo »

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:

Post by rahulvyas »

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

Post by intomo »

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

Post by intomo »

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.
Post Reply