mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Wire up memory warning notifications on iOS. (flutter/engine#3477)
This commit is contained in:
parent
9c4495c2c8
commit
02e781f347
@ -174,6 +174,11 @@ void FlutterInit(int argc, const char* argv[]) {
|
||||
selector:@selector(onVoiceOverChanged:)
|
||||
name:UIAccessibilityVoiceOverStatusChanged
|
||||
object:nil];
|
||||
|
||||
[center addObserver:self
|
||||
selector:@selector(onMemoryWarning:)
|
||||
name:UIApplicationDidReceiveMemoryWarningNotification
|
||||
object:nil];
|
||||
}
|
||||
|
||||
#pragma mark - Initializing the engine
|
||||
@ -438,6 +443,13 @@ static inline PointerChangeMapperPhase PointerChangePhaseFromUITouchPhase(
|
||||
_platformView->ToggleAccessibility(self.view, enabled);
|
||||
}
|
||||
|
||||
#pragma mark - Memory Notifications
|
||||
|
||||
- (void)onMemoryWarning:(NSNotification*)notification {
|
||||
NSDictionary* message = @{ @"type" : @"memoryPressure" };
|
||||
[self sendJSON:message withMessageName:@"flutter/system"];
|
||||
}
|
||||
|
||||
#pragma mark - Locale updates
|
||||
|
||||
- (void)onLocaleUpdated:(NSNotification*)notification {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user