Hi all,
We currently are in the process of developing a widget that may behave in slightly different ways depending on the connected user. In particular, there is a case where it would be great to have the widget able to manage an extra intent for a given user group.
As of now, I tried to make the modifications to the widget using OWF.Preferences.updateAndDeleteWidgets, like so:
OWF.Preferences.updateAndDeleteWidgets({
widgetsToUpdate:[{
guid: 'c1aee75e-f29e-0060-0806-b46141fd5e28',
intents: {
// Replace the existing list of intents, for testing purposes
receive: [{
action: 'a.new.action.for.user.only',
dataTypes: ['a.relevant.datatype']
}]
}
}],
widgetGuidsToDelete:[],
updateOrder:false,
onSuccess: function (e) {
console.log('success');
// Check that the modifications were properly saved
OWF.Preferences.getWidget({
widgetId: 'c1aee75e-f29e-0060-0806-b46141fd5e28',
onSuccess: function (result) {
console.log(result.value.intents.receive.length);
}
});
},
onFailure: function (e) {
console.log('failure');
}
});
The method call succeeds. However, the specified intents seem to be ignored. The console always logs 0 in the success callback of OWF.Preferences.getWidget rather than the expected value of 1.
Is it possible to modify the list of managed intents using this technique? If not, is there another way to do it? Does Ozone event consider user preferences when filtering the list of widgets that can respond to an intent, or if it only uses the general widget definition?
Thanks!