Untitled

mail@pastecode.io avatar
unknown
swift
a year ago
596 B
3
Indexable
Never
func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) {
    if message.name == "JSBridge" {
        guard let data = convertToDictionary(text: (message.body as? String) ?? "") else {
            return
        }
        // Parse string to dictionary
        switch data.getString(forKey: "type") {
        case "SendoExternalLogin":
            // Login func
            
            break
        case "SendoExternalLogout":
            // Logout func
            
            break
        default:
            break
        }
    }
}