Hi,
the PHP function that returns the template can also return Javascript code that will run when your plugin is rendered in the app. E.g. the Big Blue Button plugin does it.
the PHP function that returns the template can also return Javascript code that will run when your plugin is rendered in the app. E.g. the Big Blue Button plugin does it.
If you haven't done it already, I recommend you to read this page that contains a lot of information about supporting plugins in the app. As you'll see we provide some directives to easily call WebServices, like core-site-plugins-call-ws, maybe that's enough for you.
Cheers,
Dani