Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set iOS AppState to inactive when app is launching #37690

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/react-native/Libraries/AppState/AppState.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {NativeEventSubscription} from '../EventEmitter/RCTNativeAppEventEmitter'
* App States
* active - The app is running in the foreground
* background - The app is running in the background. The user is either in another app or on the home screen
* inactive [iOS] - This is a transition state that currently never happens for typical React Native apps.
* inactive [iOS] - This is a transition state that happens when the app launches, is asking for permissions or when a call or SMS message is received.
* unknown [iOS] - Initial value until the current app state is determined
* extension [iOS] - The app is running as an app extension
*
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/React/CoreModules/RCTAppState.mm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
static NSDictionary *states;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
states = @{@(UIApplicationStateActive) : @"active", @(UIApplicationStateBackground) : @"background"};
states = @{@(UIApplicationStateActive) : @"active", @(UIApplicationStateBackground) : @"background", @(UIApplicationStateInactive) : @"inactive"};
});

if (RCTRunningInAppExtension()) {
Expand Down