Last active
June 4, 2021 18:10
-
-
Save wess/3c4d2f5afaaeeebcea920dee6fd778a3 to your computer and use it in GitHub Desktop.
FlutterChannel.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FlutterChannel { | |
static private let _instance = FlutterChannel() | |
private let channel = { | |
let _channel = FlutterMethodChannel(...) | |
channel.setMethodCallhandler(FlutterChannel.route) | |
return _channel | |
}() | |
private class func route(call:FlutterMethodCall, result: FlutterResult) { | |
switch call.method { | |
case "accessToken": | |
result(SessionCache...accessToken) | |
break | |
} | |
} | |
private func init() {} | |
public class func init() { _instance.init() } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment