Page 1 of 1

Online status

Posted: 22 Mar 2012, 16:48
by skipper3k
hello,

Something is puzzeling me. I login two buddies to a Zone on smartfox server. They are not joined to any room. I get the online state for each from the buddy list (that inits on login on the server) like this :

Code: Select all

    
id<Buddy> b = (id<Buddy>)obj;
if([[b getVariable:ReservedBuddyVariables_BV_ONLINE] getBoolValue]){
      NSLog(@"Buddy is online %@", b);
}
The thing that puzzles me is that i can't get the online state for the buddy that logged in first. It is always null.
What I do is right after the onInitBuddyList delegate comes back I call this method to check for any online buddies. But none appear online even though they are.
The other device - device that logged in first - recieves the onBuddyOnlineStateUpdate, where I can update the buddy state of the 2. device with this method and it works - it shows the correct online state.

Basically this way I can not show both buddies online on both devices.

What should I do to get the online state on onInitBuddyList event for the buddy that is already logged in ?

Re: Online status

Posted: 25 Mar 2012, 05:01
by A51Integrated
Why would the state be null - should it not be false (or true) (YES/NO)?

Re: Online status

Posted: 26 Mar 2012, 11:34
by skipper3k
Well that's true. It's not null. That was my bad in NSLog.

But it is set to false. Even though I know the user is online. The case is such. I start the app on one device and login a user. Then I start the app on the 2. device and login the user. The 1. device gets the onBuddy status changed and the 2. device user appears online. On the 2. device, when I load the buddy list, the 1. user appears offline (the buddy variable is set to false). I tried to call the GoOnline request on the device that starts first, but I get user already online response.

Re: Online status

Posted: 27 Mar 2012, 16:47
by A51Integrated
Can you provide some basic code to replicate this? Maybe a sample project?

Thanks.