feat(application): expose inBackground and suspended (#9897)

For IOSApplication to be like AndroidApplication
This commit is contained in:
farfromrefuge
2022-05-14 05:57:44 +00:00
committed by Nathan Walker
parent 665009b863
commit 8987babb08
3 changed files with 18 additions and 1 deletions

View File

@@ -20,7 +20,7 @@ import { profile } from '../profiling';
import { iOSNativeHelper } from '../utils';
import { initAccessibilityCssHelper } from '../accessibility/accessibility-css-helper';
import { initAccessibilityFontScale } from '../accessibility/font-scale';
import { setInBackground, setSuspended } from './application-common';
import { inBackground, setInBackground, setSuspended, suspended } from './application-common';
const IOS_PLATFORM = 'ios';
@@ -138,6 +138,13 @@ export class iOSApplication implements iOSApplicationDefinition {
private _rootView: View;
private _systemAppearance: 'light' | 'dark';
get paused() {
return suspended;
}
get backgrounded() {
return inBackground;
}
constructor() {
this._observers = new Array<NotificationObserver>();
this.addNotificationObserver(UIApplicationDidFinishLaunchingNotification, this.didFinishLaunchingWithOptions.bind(this));