From 95ac7e1855b669ae396b4c4d30236f2de9a59391 Mon Sep 17 00:00:00 2001 From: gujiman Date: Mon, 13 Mar 2017 20:59:20 +0000 Subject: [PATCH] feat(background-mode): added moveToBackground and moveToForeground (#1181) feat(background-mode): add missing functions moveToBackground and moveToForeground as explained in https://github.com/driftyco/ionic-native/issues/1180 --- src/plugins/backgroundmode.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/plugins/backgroundmode.ts b/src/plugins/backgroundmode.ts index 5133a4f5e1..eecea91201 100644 --- a/src/plugins/backgroundmode.ts +++ b/src/plugins/backgroundmode.ts @@ -123,6 +123,24 @@ export class BackgroundMode { }) static on(event: string): Observable { return; } + /** + * Android allows to programmatically move from foreground to background. + */ + @Cordova({ + platforms: ['Android'], + sync: true + }) + static moveToBackground(): void {} + + /** + * Android allows to programmatically move from background to foreground. + */ + @Cordova({ + platforms: ['Android'], + sync: true + }) + static moveToForeground(): void {} + /** * Override the back button on Android to go to background instead of closing the app. */