Why not work ondeviceready function ?!


you have to define your own fnc

try {
  if (device) {
    document.addEventListener('deviceready', onDeviceReady, false)
} catch (e) {
  console.log('>>>error: WEB: ' + e)

async function onDeviceReady () {
  // some code

you dont need the try-catch i just copy and paste

I used this ondeviceready function only when back button pressed

some code would be helpful

1 Like