In order for the jQuery trigger() method to work, you need to create a click handler somewhere in your code. So you need both:
// put this at the end of the onReady() method
$(‘button’).on(‘click’, handleClick);
// now trigger should work in the onButtonPress or onButtonRelease methods
$(‘button’).trigger(‘click’);