From 7035ada867f1693b87b4a06ddf5c7602e4d39d63 Mon Sep 17 00:00:00 2001 From: Emily Janzer Date: Mon, 21 Mar 2016 18:38:13 -0700 Subject: [PATCH] Use 'background' app state when app is foregrounded from notif Summary:Changing app state back to 'background' for UIApplicationWillEnterForegroundNotification. On iOS we use the 'background' app state to determine whether a notification was tapped to foreground the app vs. received while app was already active. The PR https://github.com/facebook/react-native/pull/6379 changed RCTAppState so that it returned 'active' when app was being foregrounded from a notification; this changes it back to 'background' so that we can distinguish between the two cases again Reviewed By: hedgerwang Differential Revision: D3078746 fb-gh-sync-id: 8b5e9118a7e14f15871bfb68e9f85d20108b1faf shipit-source-id: 8b5e9118a7e14f15871bfb68e9f85d20108b1faf --- React/Modules/RCTAppState.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/React/Modules/RCTAppState.m b/React/Modules/RCTAppState.m index a71e2b3a8c7f6d..011e299fbd68e7 100644 --- a/React/Modules/RCTAppState.m +++ b/React/Modules/RCTAppState.m @@ -88,7 +88,7 @@ - (void)handleAppStateDidChange:(NSNotification *)notification if ([notification.name isEqualToString:UIApplicationWillResignActiveNotification]) { newState = @"inactive"; } else if ([notification.name isEqualToString:UIApplicationWillEnterForegroundNotification]) { - newState = @"active"; + newState = @"background"; } else { newState = RCTCurrentAppBackgroundState(); }