From 0f325ed77225feecf5ae6f5de9339be432a47718 Mon Sep 17 00:00:00 2001 From: Daniel Sogl Date: Fri, 16 Mar 2018 13:53:28 +0100 Subject: [PATCH] feat(app-update): add app update options --- src/@ionic-native/plugins/app-update/index.ts | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/@ionic-native/plugins/app-update/index.ts b/src/@ionic-native/plugins/app-update/index.ts index 3b2158ac6..0da8452f1 100644 --- a/src/@ionic-native/plugins/app-update/index.ts +++ b/src/@ionic-native/plugins/app-update/index.ts @@ -1,5 +1,11 @@ -import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; import { Injectable } from '@angular/core'; +import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; + +export interface AppUpdateOptions { + authType: string; + username?: string; + password?: string; +} /** * @name App Update @@ -24,13 +30,15 @@ import { Injectable } from '@angular/core'; * * constructor(private appUpdate: AppUpdate) { * - * const updateUrl = 'http://your-remote-api.com/update.xml'; - * this.appUpdate.checkAppUpdate(updateUrl); + * const updateUrl = 'https://your-remote-api.com/update.xml'; + * this.appUpdate.checkAppUpdate(updateUrl).then(() => { console.log('Update available') }); * * } * ``` * * The plugin will compare the app version and update it automatically if the API has a newer version to install. + * @interfaces + * AppUpdateOptions */ @Plugin({ pluginName: 'AppUpdate', @@ -49,5 +57,7 @@ export class AppUpdate extends IonicNativePlugin { @Cordova({ callbackOrder: 'reverse' }) - checkAppUpdate(updateUrl: string): Promise { return; } + checkAppUpdate(updateUrl: string, options?: AppUpdateOptions): Promise { + return; + } }