Commit 4b26feee authored by 余玠's avatar 余玠

ignore dummy's view appear/disappear message

parent 60da04f5
...@@ -52,6 +52,8 @@ ...@@ -52,6 +52,8 @@
_dummy = [[FLB2FlutterViewContainer alloc] initWithEngine:_engine _dummy = [[FLB2FlutterViewContainer alloc] initWithEngine:_engine
nibName:nil nibName:nil
bundle:nil]; bundle:nil];
_dummy.name = kIgnoreMessageWithName;
Class clazz = NSClassFromString(@"GeneratedPluginRegistrant"); Class clazz = NSClassFromString(@"GeneratedPluginRegistrant");
if (clazz) { if (clazz) {
if ([clazz respondsToSelector:NSSelectorFromString(@"registerWithRegistry:")]) { if ([clazz respondsToSelector:NSSelectorFromString(@"registerWithRegistry:")]) {
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface FLB2FlutterViewContainer : FlutterViewController<FLBFlutterContainer> @interface FLB2FlutterViewContainer : FlutterViewController<FLBFlutterContainer>
@property (nonatomic,copy,readwrite) NSString *name;
- (void)surfaceUpdated:(BOOL)appeared; - (void)surfaceUpdated:(BOOL)appeared;
- (void)setEnableForRunnersBatch:(BOOL)enable; - (void)setEnableForRunnersBatch:(BOOL)enable;
@end @end
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#define FLUTTER_VC FLUTTER_APP.flutterViewController #define FLUTTER_VC FLUTTER_APP.flutterViewController
@interface FLB2FlutterViewContainer () @interface FLB2FlutterViewContainer ()
@property (nonatomic,copy,readwrite) NSString *name;
@property (nonatomic,strong,readwrite) NSDictionary *params; @property (nonatomic,strong,readwrite) NSDictionary *params;
@property (nonatomic,assign) long long identifier; @property (nonatomic,assign) long long identifier;
@end @end
......
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
#import <Flutter/Flutter.h> #import <Flutter/Flutter.h>
#import "FLBTypes.h" #import "FLBTypes.h"
#define kIgnoreMessageWithName @"__flutterboost_dummy__"
@interface BoostMessageChannel : NSObject @interface BoostMessageChannel : NSObject
+ (void)onNativePageResult:(void (^)(NSNumber *))result uniqueId:(NSString *)uniqueId key:(NSString *)key resultData:(NSDictionary *)resultData params:(NSDictionary *)params; + (void)onNativePageResult:(void (^)(NSNumber *))result uniqueId:(NSString *)uniqueId key:(NSString *)key resultData:(NSDictionary *)resultData params:(NSDictionary *)params;
......
...@@ -100,6 +100,10 @@ ...@@ -100,6 +100,10 @@
+ (void)didShowPageContainer:(void (^)(NSNumber *))result pageName:(NSString *)pageName params:(NSDictionary *)params uniqueId:(NSString *)uniqueId + (void)didShowPageContainer:(void (^)(NSNumber *))result pageName:(NSString *)pageName params:(NSDictionary *)params uniqueId:(NSString *)uniqueId
{ {
if ([pageName isEqualToString:kIgnoreMessageWithName]) {
return;
}
NSMutableDictionary *tmp = [NSMutableDictionary dictionary]; NSMutableDictionary *tmp = [NSMutableDictionary dictionary];
if(pageName) tmp[@"pageName"] = pageName; if(pageName) tmp[@"pageName"] = pageName;
if(params) tmp[@"params"] = params; if(params) tmp[@"params"] = params;
...@@ -113,6 +117,10 @@ ...@@ -113,6 +117,10 @@
+ (void)willShowPageContainer:(void (^)(NSNumber *))result pageName:(NSString *)pageName params:(NSDictionary *)params uniqueId:(NSString *)uniqueId + (void)willShowPageContainer:(void (^)(NSNumber *))result pageName:(NSString *)pageName params:(NSDictionary *)params uniqueId:(NSString *)uniqueId
{ {
if ([pageName isEqualToString:kIgnoreMessageWithName]) {
return;
}
NSMutableDictionary *tmp = [NSMutableDictionary dictionary]; NSMutableDictionary *tmp = [NSMutableDictionary dictionary];
if(pageName) tmp[@"pageName"] = pageName; if(pageName) tmp[@"pageName"] = pageName;
if(params) tmp[@"params"] = params; if(params) tmp[@"params"] = params;
...@@ -126,6 +134,10 @@ ...@@ -126,6 +134,10 @@
+ (void)willDisappearPageContainer:(void (^)(NSNumber *))result pageName:(NSString *)pageName params:(NSDictionary *)params uniqueId:(NSString *)uniqueId + (void)willDisappearPageContainer:(void (^)(NSNumber *))result pageName:(NSString *)pageName params:(NSDictionary *)params uniqueId:(NSString *)uniqueId
{ {
if ([pageName isEqualToString:kIgnoreMessageWithName]) {
return;
}
NSMutableDictionary *tmp = [NSMutableDictionary dictionary]; NSMutableDictionary *tmp = [NSMutableDictionary dictionary];
if(pageName) tmp[@"pageName"] = pageName; if(pageName) tmp[@"pageName"] = pageName;
if(params) tmp[@"params"] = params; if(params) tmp[@"params"] = params;
...@@ -139,6 +151,10 @@ ...@@ -139,6 +151,10 @@
+ (void)didDisappearPageContainer:(void (^)(NSNumber *))result pageName:(NSString *)pageName params:(NSDictionary *)params uniqueId:(NSString *)uniqueId + (void)didDisappearPageContainer:(void (^)(NSNumber *))result pageName:(NSString *)pageName params:(NSDictionary *)params uniqueId:(NSString *)uniqueId
{ {
if ([pageName isEqualToString:kIgnoreMessageWithName]) {
return;
}
NSMutableDictionary *tmp = [NSMutableDictionary dictionary]; NSMutableDictionary *tmp = [NSMutableDictionary dictionary];
if(pageName) tmp[@"pageName"] = pageName; if(pageName) tmp[@"pageName"] = pageName;
if(params) tmp[@"params"] = params; if(params) tmp[@"params"] = params;
...@@ -152,6 +168,10 @@ ...@@ -152,6 +168,10 @@
+ (void)didInitPageContainer:(void (^)(NSNumber *))result pageName:(NSString *)pageName params:(NSDictionary *)params uniqueId:(NSString *)uniqueId + (void)didInitPageContainer:(void (^)(NSNumber *))result pageName:(NSString *)pageName params:(NSDictionary *)params uniqueId:(NSString *)uniqueId
{ {
if ([pageName isEqualToString:kIgnoreMessageWithName]) {
return;
}
NSMutableDictionary *tmp = [NSMutableDictionary dictionary]; NSMutableDictionary *tmp = [NSMutableDictionary dictionary];
if(pageName) tmp[@"pageName"] = pageName; if(pageName) tmp[@"pageName"] = pageName;
if(params) tmp[@"params"] = params; if(params) tmp[@"params"] = params;
...@@ -169,6 +189,10 @@ ...@@ -169,6 +189,10 @@
+ (void)willDeallocPageContainer:(void (^)(NSNumber *))result pageName:(NSString *)pageName params:(NSDictionary *)params uniqueId:(NSString *)uniqueId + (void)willDeallocPageContainer:(void (^)(NSNumber *))result pageName:(NSString *)pageName params:(NSDictionary *)params uniqueId:(NSString *)uniqueId
{ {
if ([pageName isEqualToString:kIgnoreMessageWithName]) {
return;
}
NSMutableDictionary *tmp = [NSMutableDictionary dictionary]; NSMutableDictionary *tmp = [NSMutableDictionary dictionary];
if(pageName) tmp[@"pageName"] = pageName; if(pageName) tmp[@"pageName"] = pageName;
if(params) tmp[@"params"] = params; if(params) tmp[@"params"] = params;
......
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