hi guys, is fuse provide any solution to handle hardware back button? or we need to use foreign code?
<OnBackButton></OnBackButton>
https://www.fusetools.com/learn/reference/fuse/triggers/onbackbutton
and for other buttons:
<OnKeyPress Key="MenuButton"></OnKeyPress>
https://www.fusetools.com/learn/reference/fuse/triggers/onkeypress
Hi,
Is it also possible to run a js function on back button?
I believe so:
<OnBackButton>
<CallBack Handler="{someFunction}" />
</OnBackButton>
and in your js:
function someFunction() {
// do stuff
}
module.exports = {
someFunction: someFunction
}
You might not even need the CallBack
a Handler
on the OnBackButton
should work as well
<OnBackButton Handler="{someFunction}" />
Works like a charm! thanks
Is it also possible to close the app OnBackButton?
There’s a user project showing how you can do that here: https://www.fusetools.com/community/forums/permalink/82984c7c-7084-46ca-886f-d2b095246fd9