提交 642e325f 编写于 作者: C Chinmay Garde 提交者: GitHub

Wire up memory warning notifications on iOS. (#3477)

上级 91c4c544
......@@ -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 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册