ToniKorin / cordova-plugin-autostart

This Cordova plugin will start automatically your app after the every boot or the auto-update of your application. You can enable or disable the autostart function in your app.
https://github.com/ToniKorin/cordova-plugin-autostart
Apache License 2.0
108 stars 77 forks source link

plugin not working #6

Closed alaanasreng closed 8 years ago

alaanasreng commented 8 years ago

i installed the plugin and add this code to my js: cordova.plugins.autoStart.enable(); and after installing the app and reboot the device the app not started automatically

any help please? @ToniKorin

ToniKorin commented 8 years ago

Have you checked the android logs? During the boot phase the network connectivity is available after the pin unlock. So if your app is loading something over the network during the start up, it may cause your app to crash.

alaanasreng commented 8 years ago

how to check android logs? i dont have any pin lock. @ToniKorin

ToniKorin commented 8 years ago

Here you go: http://developer.android.com/tools/help/monitor.html

alaanasreng commented 8 years ago

hello sir, i checked android logs, and don't have any messages for the app at booting device. so the app doesn't start any help please? @ToniKorin

antiPoP commented 8 years ago

Similar issue here. The plugin does not start the app at boot, but works fine when updating the app with adb install -r. Is required some specific android version or permission to make it work?

ToniKorin commented 8 years ago

I just re-verified android versions 4, 5 and 6 successfully. I don't see any obstacles about older versions either. The plugin itself enables the required permission for RECEIVE_BOOT_COMPLETED. Do you have any special configuration, which could lead to this unwanted result?

antiPoP commented 8 years ago

I just made a trivial "Hello World" app with only this plugin and I got the same results. I'm using the latest Cordova version (5.4.0).

alaanasreng commented 8 years ago

hello sir, i don't have any special configuration, and i test app on "Galaxy Tab 4.0"

ToniKorin commented 8 years ago

Btw, it was also discovered that the installation into SD card prevents the start after the boot for some reason.

antiPoP commented 8 years ago

Installing in internal storage (adb and without the -s switch) works as expected. Is possible to fix the plugin so it also works with the sdcard?

ToniKorin commented 8 years ago

Unfortunately it seems to be impossible: http://stackoverflow.com/questions/9556944/broadcastreceiver-not-working-when-app-is-installed-on-sd-card

To avoid unnecessary hassle in the future I just updated the Readme about the limitations... ;)