Broadcast.trigger

We have an external app that listens for intents to be triggered and performs a number of actions. Below is a sample of my code that should trigger the intent and the external app should then trigger another intent which will provide the device’s battery level. There seems to be no intent being triggered and in turn nothing is returned.

What am I doing wrong?

var watchId;

function callback(data) {
    console.log("Data: " + JSON.stringify(data));
}

var target = {
    action: "za.co.company.BATTERYLEVEL",
    categories: []
};

watchId = Broadcast.register(target, callback);

function test(){
    var trigger_target = {
        action: "company://battery",
        categories: []
    }
    Broadcast.trigger(trigger_target, {});
}
1 Like

Hi @bruce-hayes

Just confirming that this issue was resolved via our direct support channels.

If so, can you confirm if the above code worked as intended, and if not, what did you change to get it to work?