Page 1 of 1

not receiving onUserVariablesUpdate

Posted: 25 Feb 2011, 01:36
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

Posted: 25 Feb 2011, 07:50
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];
}

Posted: 25 Feb 2011, 15:48
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.

Posted: 25 Feb 2011, 20:42
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.