Hi Rafael,
If you want the fresh ticket data to be loaded everytime you navigate between the tickets, you can use the same code that you used with ticket_background location. You need not wait for the property loaded event. Make sure the code is encapsulated within app.activated.
client.data.get("ticket").then(function(data) {
//get new ticket data
});
Sorry its not working. I am using this code:
app.initialized().then(function(client) {
executeMe(client);
});
app.activated().then(function(client) {
executeMe(client);
});
the executeMe function is only triggered when viewing first ticket, using next/previous does not work.
Hi Rafael,
oops, that's unfortunate and it shouldn't happen that way. Just a quick question. Are you testing the apps locally with ?dev=true or you have published them as custom apps? Also in the above code encapsulate the app.activated within app.initialized.
I published the app. Can you show me an example with the encapsulation.
Sure, Rafael. Here is an example.
app.initialized().then(function(_client) {
client = _client;
client.events.on('app.activated', function() {
client.data.get("ticket")
.then(function(data) {
console.log("Ticket Data", data);
})
.catch(function(e) {
console.log('Exception - ', e);
});
});
});