Skip to content

Commit

Permalink
fix: AppState "change" event
Browse files Browse the repository at this point in the history
  • Loading branch information
aleclarson committed Jul 11, 2019
1 parent 0c665c0 commit 77566a3
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions React/Modules/RCTAppState.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,12 @@

static NSString *RCTCurrentAppBackgroundState()
{
static NSDictionary *states;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
states = @{
// @(NSApplication): @"active",
// @(UIApplicationStateBackground): @"background",
// @(UIApplicationStateInactive): @"inactive"
};
});

if (RCTRunningInAppExtension()) {
return @"extension";
}

//return states[@(RCTSharedApplication().applicationState)] ?: @"unknown";
return @"unknown";
NSApplication *app = RCTSharedApplication();
return app.active ? @"active" : @"inactive";
}

@implementation RCTAppState
Expand Down

0 comments on commit 77566a3

Please sign in to comment.