【问题标题】:How I can launch my app in startup device with cordova?如何使用cordova在启动设备中启动我的应用程序?
【发布时间】:2017-05-19 21:31:27
【问题描述】:

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

我了解https://github.com/olaferlandsen/cordova-plugin-autostart 但是效果不好

谢谢

【问题讨论】:

    标签: android cordova ionic-framework ionic2 startup


    【解决方案1】:

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

    一步一步:

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

    cordova plugin add cordova-plugin-autostart@latest
    

    或来自 master 分支:

    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();
    

    【讨论】:

      猜你喜欢
      • 2020-02-10
      • 1970-01-01
      • 2015-10-28
      • 1970-01-01
      • 2010-10-01
      • 2014-04-18
      • 2021-04-25
      • 2021-06-01
      • 2021-12-26
      相关资源
      最近更新 更多