ZAF Client API trigger event



已于 2023年11月28日 发布

Hello, I am trying to trigger an event from the ticket/user sidebar using the ZAF Client like this https://developer.zendesk.com/api-reference/apps/apps-core-api/client_api/#clienttriggername-data

client.trigger('open_flex_popover');
And catch it in a different place (Twilio Flex Plugin) using another ZAF Client.
this.zaf.on('open_flex_popover', function() {  console.log('opening!')});
Since this happens in the same browser window, I was expecting to be able to catch the action, but it doesn't seem to work.
 
If I am triggering and listening in the same html file, it works, but that doesn't help me much.
 
Do you have any idea why the action is not caught? Do you have any alternatives? Ideas? I am kind of stuck.

0

2

2 条评论

Hi 1263082202789 ,

 

is it somehow possible to get a client instance of another app?

Let's say I'm responsible for “App_A” and I have another app “App_B” installed from the marketplace and I want to be able to trigger a desired behaviour in this other “App_B”?
Can I do something in the direction of:

instances = await clientAppA.get('instances')
instance_app_b = filter_instance({name:"App_B", location:"ticket_sidebar"})
...

Or is it just possible to fetch all instances of my own app “App_A"?
 

Thanks and best regards,

Alex

0


The basis of triggering custom events on a zaf_client is that those events need to be on the same client instance.

You can get client instances of same app in different locations and transfer data amongst them. 

differentLocationClientPromise = client.instance(<instance_guid_of_different_location>);
differentLocationClientPromise.then((differentLocationClient) => {
differentLocationClient.trigger("open_flex_popover");
})

0


登录以发表评论。

找不到所需的内容?

新建帖子