This commit is contained in:
Kris Pypen 2019-10-17 23:18:57 +02:00
parent ea71d3b2be
commit 72295561c7
4 changed files with 2 additions and 13 deletions

View File

@ -6,12 +6,11 @@
//
#import <Flutter/Flutter.h>
#import <UnityUtils.h>
@interface FlutterUnityWidgetPlugin : NSObject<FlutterPlugin>
@end
@interface FUController : NSObject <FlutterPlatformView, UnityEventListener>
@interface FUController : NSObject <FlutterPlatformView>
- (instancetype)initWithFrame:(CGRect)frame
viewIdentifier:(int64_t)viewId
@ -19,7 +18,6 @@
registrar:(NSObject<FlutterPluginRegistrar> *)registrar;
- (UIView*)view;
- (void)onMessage:(NSString *)message;
@end
@interface FUViewFactory : NSObject <FlutterPlatformViewFactory>

View File

@ -67,10 +67,6 @@
return self;
}
- (void)onMessage:(NSString *)message {
[_channel invokeMethod:@"onUnityMessage" arguments:message];
}
- (void)onMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
if ([[call method] isEqualToString:@"postMessage"]) {
[self postMessage:call result:result];

View File

@ -23,11 +23,6 @@ extern "C" {
} // extern "C"
#endif
@protocol UnityEventListener <NSObject>
- (void)onMessage:(NSString *)message;
@end
@interface UnityUtils : NSObject
+ (BOOL)isUnityReady;

View File

@ -153,7 +153,7 @@ static BOOL _isUnityReady = NO;
UnityAppController *controller = GetAppController();
[controller application:application didFinishLaunchingWithOptions:nil];
[controller applicationDidBecomeActive:application];
[UnityUtils listenAppState];
});
}