![]() | 1 | initial version |
To receive a notification in AllJoyn.js you need to add a match rule for the notification interface:
AJ.addMatch('org.alljoyn.Notification', 'notify');
Then add the onSignal function and check for the notify signal:
AJ.onSignal = function() {
if (this.member == 'notify') {
//here you can access the arguments[] array
//arguments[x] will one of the many arguments in the notif signal
//this will print them all as a JSON string
print(JSON.stringify(arguments));
}
}
I'm not sure what you mean by "is this a good one to experiment with". If you mean this example then yes as you can see its very simple to receive notifications. Regardless if you have little JavaScript background, AllJoyn.js is very easy to use. You should be able to pick it up very quickly.
![]() | 2 | No.2 Revision |
To receive a notification in AllJoyn.js you need to add a match rule for the notification interface:
AJ.addMatch('org.alljoyn.Notification', 'notify');
Then add the onSignal function and check for the notify signal:
AJ.onSignal = function() {
if (this.member == 'notify') {
//here you can access the arguments[] array
//arguments[x] will is one of the many arguments in the notif signal
//this will print them all as a JSON string
print(JSON.stringify(arguments));
}
}
I'm not sure what you mean by "is this a good one to experiment with". If you mean this example then yes as you can see its very simple to receive notifications. Regardless if you have little JavaScript background, AllJoyn.js is very easy to use. You should be able to pick it up very quickly.
© 2014 AllSeen Alliance, Inc. All Rights Reserved.
Linux Foundation is a registered trademark of The Linux Foundation. AllSeen and AllSeen Alliance are trademarks of the AllSeen Alliance, Inc.
Linux is a registered trademark of Linus Torvalds.
Please see our brand guidelines, trademark guidelines, terms of use and privacy policy.