繁体   English   中英

如何使用Cordova在启动设备中启动我的应用程序?

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

我想在启动时启动应用程序,怎么办?

我了解到https://github.com/olaferlandsen/cordova-plugin-autostart,但效果不佳

谢谢

您可以使用cordova-plugin-autostart自动启动应用程序。

一步步:

从CLI安装最新版本的插件:

cordova plugin add cordova-plugin-autostart@latest

或从主分支:

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

启用自动启动:

cordova.plugins.autoStart.enable();

Ionic2示例:

文件: 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();

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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