I'm trying to capture the "home" button press event, and notify my web server that my iOS application is deactivated, and then, my web server can send messages through APNs.
I tried with this:
| NativeApplication.nativeApplication.addEventListener(Event.DEACTIVATE, | this.onDeactivate); |
and:
make a URLRequest in onDeactivate callback function to notify my server.
But i found, this request never got sent. Actually, it is sent when i press "home" again, and after
my iOS application is activated!
Is there a way to solve or work around?
I fixed it. in onDeactivate function, i tried this: NativeApplication.nativeApplication.executeInBackground = true;
And this way, my application can run in background.