Online status

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

Moderators: Bax, Lapo, A51Integrated

Online status

Postby skipper3k » 22 Mar 2012, 16:48

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 ?
skipper3k
 
Posts: 20
Joined: 22 Feb 2012, 09:21

Re: Online status

Postby A51Integrated » 25 Mar 2012, 05:01

Why would the state be null - should it not be false (or true) (YES/NO)?
A51 Integrated
http://a51integrated.com / +1 416-703-2300
User avatar
A51Integrated
 
Posts: 240
Joined: 03 Jan 2012, 19:55
Location: Toronto, Canada

Re: Online status

Postby skipper3k » 26 Mar 2012, 11:34

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.
skipper3k
 
Posts: 20
Joined: 22 Feb 2012, 09:21

Re: Online status

Postby A51Integrated » 27 Mar 2012, 16:47

Can you provide some basic code to replicate this? Maybe a sample project?

Thanks.
A51 Integrated
http://a51integrated.com / +1 416-703-2300
User avatar
A51Integrated
 
Posts: 240
Joined: 03 Jan 2012, 19:55
Location: Toronto, Canada


Return to SFS2X iPhone / iPad / OSX API

Who is online

Users browsing this forum: No registered users and 2 guests