【发布时间】:2017-05-19 21:31:27
【问题描述】:
【问题讨论】:
标签: android cordova ionic-framework ionic2 startup
【问题讨论】:
标签: android cordova ionic-framework ionic2 startup
您可以使用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();
【讨论】: