@w6s/codash
Version:
A Cordova utility library.
12 lines (10 loc) • 344 B
JavaScript
;
export default function bindBackEvent(backEvent) {
const backButtonEvent = (channel) => {
if (channel.action === 'backbutton') {
backEvent && backEvent();
}
};
cordova.exec(null, null, "CoreAndroid", "overrideBackbutton", [true]);
cordova.exec(backButtonEvent, null, "CoreAndroid", "messageChannel", []);
}