Skip to content

Commit

Permalink
Use 'background' app state when app is foregrounded from notif
Browse files Browse the repository at this point in the history
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 facebook#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
  • Loading branch information
Emily Janzer authored and Facebook Github Bot 2 committed Mar 22, 2016
1 parent 90aa7b9 commit 7035ada
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion React/Modules/RCTAppState.m
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 7035ada

Please sign in to comment.