Skip to content

How to use NUGUServiceKit for custom webview with javascript

jin-marino edited this page Jun 19, 2020 · 8 revisions

Custom webview with javascript

Wrote based on v0.12.0 (updated 2020.06.19)

NuguServiceKit

NuguServiceWebView

NuguServiceWebView is a customized webview inherited from WKWebView.

Public static variable

// Static url for NUGU services setting
// TODO: - not decided yet, to be confirmed
public static let serviceSettingUrl = "https://stg-webview.sktnugu.com/3pp/intro.html"

Public Methods

// Set custom cookie by promised variables as NuguServiceCookie
public func setNuguServiceCookie(domain: String, nuguServiceCookie: NuguServiceCookie)

// load url request with url string and queries
public func loadUrlString(_ urlString: String?, with queries: [URLQueryItem]? = nil)

NuguServiceWebJavascriptDelegate

NuguServiceWebJavascriptDelegate passes promised javascript method used in NUGU services webview with delegate methods

public func openExternalApp(openExternalAppItem: WebOpenExternalApp)
public func openInAppBrowser(url: String)