Observing "MemoryWarningNotification" and proxying it up to the DeviceEventEmitter

This commit is contained in:
Jared Forsyth
2015-05-22 12:57:08 -07:00
parent 56d6ee3f0f
commit aad54006e3
3 changed files with 57 additions and 12 deletions

View File

@@ -53,11 +53,21 @@ RCT_EXPORT_MODULE()
selector:@selector(handleAppStateDidChange)
name:name
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleMemoryWarning)
name:UIApplicationDidReceiveMemoryWarningNotification
object:nil];
}
}
return self;
}
- (void)handleMemoryWarning
{
[_bridge.eventDispatcher sendDeviceEventWithName:@"memoryWarning"
body:nil];
}
- (void)dealloc
{