Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SessionListener functionality #48

Open
michiyosony opened this issue Apr 30, 2015 · 3 comments
Open

SessionListener functionality #48

michiyosony opened this issue Apr 30, 2015 · 3 comments

Comments

@michiyosony
Copy link

I don't see anything in the plugin with functionality akin to the SessionListener, or some way of being notified that another party has left a joined session/the session has been closed, etc. Am I overlooking it? If it does not currently exist, is it planned?

@vjrantal
Copy link
Contributor

The only related functionality that exists is for the plugin user to be in control of who to let join into a session. You can see how the chat sample uses that functionality at AllJoyn-Cordova/cordova-chat-alljoyn@3585a19.

Having the functionality that the above-mentioned SessionListener provides is definitely a valid use case. As far as I know, no timeline exists for implementing it.

Before it gets supported by the plugin, I wonder would it be possible to do something in the app JavaScript layer? Setting the right kind of signal rules might allow you to be notified in these scenarios.

@michiyosony
Copy link
Author

I will look into signal rules; thank you.

@vjrantal
Copy link
Contributor

vjrantal commented May 7, 2015

@michiyosony After looking into this a bit more, it seems like you can get at least certain signals to an app that hosts sessions. An example below adds a listener to a case when someone leaves your session.

bus.addListener([0, 1, 0, 17], 'uu', function (response) {
    // response could be looked at but contained only undefined values when I tested
});

The way I concluded to [0, 1, 0, 17] was that it was the 17th value in this list https://github.com/AllJoyn-Cordova/ajtcl/blob/RB14.12/src/aj_std.c#L130 that matches to !SessionLostWithReason >u >u.

Seems that you don't have to set the signal rule for these yourself, because I believe the ones found in aj_std.c are already registered for behind the scenes.

I am not sure if this helps you at all and I think we should keep this issue open until there is a well-documented way for plugin users to get session-related information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants