| 12345678910111213141516171819202122232425 |
- import Flutter
- import UIKit
- import UM
- public class UmengCommonPlugin: NSObject, FlutterPlugin {
- public static func register(with registrar: FlutterPluginRegistrar) {
- let channel = FlutterMethodChannel(name: "umeng_common", binaryMessenger: registrar.messenger())
- let instance = UmengCommonPlugin()
- registrar.addMethodCallDelegate(instance, channel: channel)
- }
- public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
- switch call.method {
- case "getPlatformVersion":
- result("iOS " + UIDevice.current.systemVersion)
- default:
- result(FlutterMethodNotImplemented)
- }
- }
- public func initialize() {
- //设置AppKey,初始化友盟所有组件产品,开发者在友盟官网申请的appkey
- UMConfigure.initWithAppkey("66b07337cac2a664de82d457", channel: "AppStore")
- }
- }
|