iOS: AnnounceHandler when device lost connection

asked 2014-08-04 09:32:09 -0700

anacatarina gravatar image

Hi, I am integrating AllJoyn AboutService in an iOS App. In the project I am working on we are also developing for Android and we notice that the callback onDeviceLost from the AnnouncementHandler that exists on Android, doesn't exist on iOS. Is there any other way to know, in an iOS app, when a session is lost? Of course, without both devices being connected yet.

Thank you, Catarina

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-08-04 11:26:08 -0700

bspencer gravatar image

updated 2014-08-04 11:26:23 -0700

In the About feature Java language APIs the onDeviceLost is just a wrapper around a LostAdvertisedName callback from the BusListener class, not the SessionLost callback in a SessionListener. In the iOS About feature APIs it does not wrap create this method as the language binding is different and makes it problematic to allow this. You will need to use the BusListener class itself and register this with the BusAttachment as is done in the iOS About sample application: https://git.allseenalliance.org/cgit/core/alljoyn.git/tree/services/about/ios/samples/sampleApp/ViewController.m#n389 https://git.allseenalliance.org/cgit/core/alljoyn.git/tree/services/about/ios/samples/sampleApp/ViewController.m#n255

Hope the sample app helps you.

edit flag offensive delete publish link more


Thank you. It still doesn't solve my problem because in the sample you are calling findAdvertisedName: for each announce. In my app I am checking for every announce available but I won't call findAdvertisedName: for all of them and I want to keep my list of sessions available updated. The LostAdvertisedName won't be called in my case.

anacatarina ( 2014-08-05 01:08:54 -0700 )edit

If you are in a session, IE have called JoinSession, then you should implement a SessionListener which will fire the SessionLost callback when the session is no longer established. If you are NOT in a session then I would recommend that you ensure you are using the 14.06 SDK and utilize the new BusAttachment Ping method which will allow you to check if a application/device is still in proximity.

bspencer ( 2014-08-05 12:37:02 -0700 )edit

Thanks! I will try that.

anacatarina ( 2014-08-06 01:03:44 -0700 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2014-08-04 09:32:09 -0700

Seen: 56 times

Last updated: Aug 04 '14