Hi,
I need to send an application launch event to a running ftrack connect of current user. I tried many options but the events just go to nowhere. As I started to test the event system I came across the "send_message_to_user" code from the "ftrack-recipes" that looked like a good start.
Unfortunately, this code shows exactly the same: the evnts are sent but never received. I've double checked that the session.api_user is the same and the connection is established to the same server. I tried to switch the 'synchronous' option but that didn't change anything.
Here's my test code that runs fine but no messages are shown in the web client:
import ftrack_api
def main():
"""
Main entry point
"""
# Subscribe to events with the update topic.
session = ftrack_api.Session(auto_connect_event_hub=True)
session.event_hub.publish(
ftrack_api.event.base.Event(
topic='ftrack.action.trigger-user-interface',
data=dict(type='message', success=True, message='test message'),
target='applicationId=ftrack.client.web and user.id="{0}"'.format(
session.api_user
),
),
synchronous=True,
on_error='ignore',
)
print("Done")
session.event_hub.wait()
if __name__ == "__main__":
main()