// // GameMessageChannel.swift // Runner // // Created by xiaoyu on 2024/4/13. // import UIKit class GameMessageChannel: NSObject { var messageChannel:FlutterMethodChannel? init(message:FlutterBinaryMessenger) { super.init() messageChannel = FlutterMethodChannel.init(name: "wow_english/game_method_channel", binaryMessenger: message) messageChannel!.setMethodCallHandler { call, result in self.handle(call, result) } } func handle(_ call: FlutterMethodCall,_ result: @escaping FlutterResult) { if (call.method == "openGamePage") { print("openGamePage"); let dict = call.arguments as! Dictionary let gameid = dict["gameId"] as! Int WowGameCocosManager.shared().runGame(gameid); return } } }