Shaking device exit

Quick question here, is it possible to shake the phone to exit the application?
I’ve been trying out some code and this was the last one I tried which obviously didn’t work…

[code]
function onShake(system)
if system.isShake then
os.exit()
end
end
Runtime:addEventListner(“system”, onShake) [import]uid: 114389 topic_id: 28059 reply_id: 328059[/import]

Although it is possible to do this it isn’t going to work in an iOS application - you CAN do it but Apple will reject the app for using os.exit() [import]uid: 52491 topic_id: 28059 reply_id: 113475[/import]

Dang that’s interesting, thanks for the heads up on that!

Although as of now, I only build for Android =D

I’m missing something in my code I’m assuming? [import]uid: 114389 topic_id: 28059 reply_id: 113584[/import]

Replace the last line with;
[lua]Runtime:addEventListener(“accelerometer”, onShake)[/lua]

That should do the trick I believe.

Peach :slight_smile: [import]uid: 52491 topic_id: 28059 reply_id: 113606[/import]