简体   繁体   中英

How I can launch my app in startup device with cordova?

I want launch the app on startup, how I can it?

I learn about https://github.com/olaferlandsen/cordova-plugin-autostart but it don't work well

Thanks

You can use cordova-plugin-autostart to auto start you application.

Step by step:

Install the latest version of the plugin from CLI:

cordova plugin add cordova-plugin-autostart@latest

Or from master branch:

cordova plugin add https://github.com/ToniKorin/cordova-plugin-autostart.git 

Enable autoStart:

cordova.plugins.autoStart.enable();

Example Ionic2:

FILE: app.component.ts

declare let cordova : any;
export class MyApp {
    rootPage:any = HomePage;
    constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) {
        platform.ready().then(() => {
            cordova.plugins.autoStart.enable();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM