mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
Observing "MemoryWarningNotification" and proxying it up to the DeviceEventEmitter
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user