diff --git a/ionic/platform/platform.ts b/ionic/platform/platform.ts index 245cd35574..01a73482e5 100644 --- a/ionic/platform/platform.ts +++ b/ionic/platform/platform.ts @@ -290,7 +290,9 @@ export class Platform { // called by engines (the browser)that do not provide them /** - * @private + * The `exitApp` method is useful when running from a native platform, + * such as Cordova. This adds the ability to place the Cordova app + * in the background. */ exitApp() {} @@ -298,17 +300,29 @@ export class Platform { // ********************************************** /** - * @private + * The back button event is emitted when the user presses the native + * platform's back button, also referred to as the "hardware" back button. + * This event is only emitted within Cordova apps running on Android and + * Windows platforms. This event is not fired on iOS since iOS doesn't come + * with a hardware back button in the same sense an Android or Windows device + * does. It's important to note that this event does not emit when the Ionic + * app's back button within the navbar is clicked, but this event is only + * referencing the platform's hardward back button. */ backButton: EventEmitter = new EventEmitter(); /** - * @private + * The pause event emits when the native platform puts the application + * into the background, typically when the user switches to a different + * application. This event would emit when a Cordova app is put into + * the background, however, it would not fire on a standard web browser. */ pause: EventEmitter = new EventEmitter(); /** - * @private + * The resume event emits when the native platform pulls the application + * out from the background. This event would emit when a Cordova app comes + * out from the background, however, it would not fire on a standard web browser. */ resume: EventEmitter = new EventEmitter(); diff --git a/ionic/platform/registry.ts b/ionic/platform/registry.ts index ab6b7e6e83..598ee7f6e1 100644 --- a/ionic/platform/registry.ts +++ b/ionic/platform/registry.ts @@ -179,12 +179,12 @@ Platform.register({ doc.addEventListener('backbutton', function() { p.backButton.emit(null); }); - // doc.addEventListener('pause', function() { - // p.pause.emit(null); - // }); - // doc.addEventListener('resume', function() { - // p.resume.emit(null); - // }); + doc.addEventListener('pause', function() { + p.pause.emit(null); + }); + doc.addEventListener('resume', function() { + p.resume.emit(null); + }); // cordova has fully loaded and we've added listeners p.triggerReady();