How to handle iOS hardware button press?


#1

Hello, is in JSB any function to handle iOS hardware button pressed?
Thanks for any advice!


#2

Hi.
There are two function: applicationDidEnterBackground and applicationWillEnterForeground in AppController.mm.
they are the callback functions that triggers when iOS hardware button is pressed.
you can call your JS function in those 2 callbacks.