Hello, I am currently building app using ionic2.
Basically, on app init, it will send request to http server to check whether device has been registered on my database or not, if server return true it will redirect to login page, otherwise go to either registration or wait for activation page.
On first run or after force kill app (using task manager), this works as it should be. However, when I exit the app via hardware back button, app init not working as it should be, it will always redirect to wait for activation page instead.
i found some of this error on adb log
06-10 03:26:52.904: I/chromium(10056): [INFO:CONSOLE(74905)] "Native: tried calling Device.device, but the Device plugin is not installed.", source: file:///android_asset/www/build/js/app.bundle.js (74905)
06-10 03:26:52.904: I/chromium(10056): [INFO:CONSOLE(74910)] "Install the Device plugin: 'cordova plugin add cordova-plugin-device'", source: file:///android_asset/www/build/js/app.bundle.js (74910)
06-10 03:26:52.905: I/chromium(10056): [INFO:CONSOLE(74905)] "Native: tried calling Device.device, but the Device plugin is not installed.", source: file:///android_asset/www/build/js/app.bundle.js (74905)
06-10 03:26:52.906: I/chromium(10056): [INFO:CONSOLE(74910)] "Install the Device plugin: 'cordova plugin add cordova-plugin-device'", source: file:///android_asset/www/build/js/app.bundle.js (74910)
06-10 03:26:53.161: I/chromium(10056): [INFO:CONSOLE(69183)] "Native: deviceready did not fire within 2000ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them.", source: file:///android_asset/www/build/js/app.bundle.js (69183)
I try to reinstall plugin already but still got same behaviour.
I have put my http request code under this.platform.ready().then{ ... }
block.
Note: same behaviour before and after trying to handle hardware back button as mentioned in this page
has anyone face this problem? How to make app certainly wait for plugin availability after suspend(?)?
Ionic Info :
Cordova CLI: 6.2.0
Ionic Framework Version: 2.0.0-beta.7
Ionic CLI Version: 2.0.0-beta.25
Ionic App Lib Version: 2.0.0-beta.15
OS: Distributor ID: Ubuntu Description: Ubuntu 16.04 LTS
Node Version: v4.4.5