Wire up memory warning notifications on iOS. (flutter/engine#3477)
This commit is contained in:
@@ -174,6 +174,11 @@ void FlutterInit(int argc, const char* argv[]) {
|
|||||||
selector:@selector(onVoiceOverChanged:)
|
selector:@selector(onVoiceOverChanged:)
|
||||||
name:UIAccessibilityVoiceOverStatusChanged
|
name:UIAccessibilityVoiceOverStatusChanged
|
||||||
object:nil];
|
object:nil];
|
||||||
|
|
||||||
|
[center addObserver:self
|
||||||
|
selector:@selector(onMemoryWarning:)
|
||||||
|
name:UIApplicationDidReceiveMemoryWarningNotification
|
||||||
|
object:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Initializing the engine
|
#pragma mark - Initializing the engine
|
||||||
@@ -438,6 +443,13 @@ static inline PointerChangeMapperPhase PointerChangePhaseFromUITouchPhase(
|
|||||||
_platformView->ToggleAccessibility(self.view, enabled);
|
_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
|
#pragma mark - Locale updates
|
||||||
|
|
||||||
- (void)onLocaleUpdated:(NSNotification*)notification {
|
- (void)onLocaleUpdated:(NSNotification*)notification {
|
||||||
|
|||||||
Reference in New Issue
Block a user