Commit bd868cfc authored by 余玠's avatar 余玠

cherrypick: 最后一个flutter页面关闭的时候回调对Engine的OwnerViewController清空

parent 1f284d89
...@@ -75,6 +75,9 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -75,6 +75,9 @@ NS_ASSUME_NONNULL_BEGIN
params:(NSDictionary *)params params:(NSDictionary *)params
uniqueId:(NSString *)uniqueId; uniqueId:(NSString *)uniqueId;
- (void)onShownContainerChanged:(NSString *)uniqueId
params:(NSDictionary *)params;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
......
...@@ -67,8 +67,15 @@ ...@@ -67,8 +67,15 @@
result(@(r)); result(@(r));
}]; }];
}else if([@"onShownContainerChanged" isEqualToString:call.method]){ }else if([@"onShownContainerChanged" isEqualToString:call.method]){
NSString *newName = call.arguments[@"newName"]; NSDictionary *args = [FLBCollectionHelper deepCopyNSDictionary:call.arguments
filter:^bool(id _Nonnull value) {
return ![value isKindOfClass:NSNull.class];
}];
NSString *newName = args[@"newName"];
NSString *uid = args[@"uniqueId"];
if(newName){ if(newName){
[[FlutterBoostPlugin2 sharedInstance].application onShownContainerChanged:uid params:args];
[NSNotificationCenter.defaultCenter postNotificationName:@"flutter_boost_container_showed" [NSNotificationCenter.defaultCenter postNotificationName:@"flutter_boost_container_showed"
object:newName]; object:newName];
} }
......
...@@ -226,4 +226,13 @@ ...@@ -226,4 +226,13 @@
} }
} }
- (void)onShownContainerChanged:(NSString *)uniqueId
params:(NSDictionary *)params{
NSString *oldName = params[@"oldName"];
NSString *newName = params[@"newName"];
if (oldName!=nil && [newName isEqualToString:@"default"]) {
[self.flutterProvider detach];
}
}
@end @end
...@@ -268,7 +268,6 @@ static NSUInteger kInstanceCounter = 0; ...@@ -268,7 +268,6 @@ static NSUInteger kInstanceCounter = 0;
// [self surfaceUpdated:NO]; // [self surfaceUpdated:NO];
// } // }
[super bridge_viewDidDisappear:animated]; [super bridge_viewDidDisappear:animated];
[FLUTTER_APP resume];
} }
- (void)installSplashScreenViewIfNecessary { - (void)installSplashScreenViewIfNecessary {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment