Trigger event on exiting mobile app

Just started using Construct 2? Post your questions here

Post » Sun Oct 12, 2014 4:58 pm

I'm using CocoonJS to export to Android and am wondering- is there a way to trigger an event when the user presses one of the phone's soft buttons to exit the app (as far as I can tell, that's the only way to exit when using cJS)?

Eg: On press exit > Show text saying "Thanks! Please Rate the App"

Many thanks for any help!
B
10
S
3
Posts: 15
Reputation: 1,191

Post » Tue Oct 14, 2014 7:21 am

did you try browser object?
"If you want to move a mountain tomorrow, you should start by lifting stones today."
B
62
S
14
G
2
Posts: 286
Reputation: 6,576

Post » Tue Oct 14, 2014 11:56 am

Indeed the Browser's "On back button" could be your solution, even if it seems quite restricted indeed.
It might be worth to check out within CocoonJS' plugin itself if they don't have a "On exit" condition you could use.

But to be fair, it's likely that the condition your are looking for only happens when exiting the application. And so, your text would only be displayed an instant before "disappearing" along your closing application.
Think about that before spending too much time looking down for this.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
284
S
109
G
91
Posts: 7,319
Reputation: 87,487


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests