Upgrade to Pro — share decks privately, control downloads, hide ads and more …

自社コンテンツ配信 のためのWebView Tips

自社コンテンツ配信 のためのWebView Tips

Swift愛好会 vol18

6473e817cfca9ae38d6bc2b468492d62?s=128

Shinji Kobayashi

April 28, 2017
Tweet

Transcript

  1. ࣗࣾίϯςϯπ഑৴ ͷͨΊͷWebView Tips Shinji Kobayashi TOPLOG / Gentlesoft SwiftѪ޷ձ vol18

  2. NameɿShinji Kobayashi Twitterɿ@gentlejkov GentleSoft Who are you? http://gentlesoft.net

  3. NameɿShinji Kobayashi Twitterɿ@gentlejkov GentleSoft Who are you? http://gentlesoft.net ด࠯த ετΞ࡟আ

  4. Work https://toplog.jp/ TOPLOG iOS Engineer

  5. TOPLOG ࣗࣾͰاըʗ੡࡞͍ͯ͠Δɺ ΞϓϦʹ࠷దԽͨ͠ϑΝογϣϯهࣄΛ഑৴

  6. TOPICS • දࣔͷ֦େʗ௕ԡ͠ͷϝχϡʔͳͲΛېࢭ ͍ͨ͠ • ಈըΛΠϯϥΠϯͰ࠶ੜ͍ͨ͠ • ಈըΛࣗಈ࠶ੜ͍ͨ͠ • ભҠઌʹΑͬͯը໘ͷಈ࡞Λมߋ͍ͨ͠

    • ಛघͳϦϯΫΛઃఆͯ͠ΞϓϦʹಛఆͷಈ ࡞Λ͍ͤͨ͞
  7. TOPICS • දࣔͷ֦େʗ௕ԡ͠ͷϝχϡʔͳͲΛېࢭ ͍ͨ͠ • ಈըΛΠϯϥΠϯͰ࠶ੜ͍ͨ͠ • ಈըΛࣗಈ࠶ੜ͍ͨ͠ • ભҠઌʹΑͬͯը໘ͷಈ࡞Λมߋ͍ͨ͠

    • ಛघͳϦϯΫΛઃఆͯ͠ΞϓϦʹಛఆͷಈ ࡞Λ͍ͤͨ͞
  8. // બ୒ېࢭ͢ΔCSS let css = "body{-webkit-user-select:none;-webkit-user-drag:none;- webkit-touch-callout: none;}" // CSSΛಡΈࠐΜͩHTMLʹద༻͢Δjavascript

    let js = "var style = document.createElement('style');" + "style.type = 'text/css';" + "var cssContent = document.createTextNode('\(css)');" + "style.appendChild(cssContent);" + "document.body.appendChild(style);" // javascriptΛϖʔδಡΈࠐΈ׬ྃ࣌ʹຖճ࣮ߦ͢ΔΑ͏ઃఆ let noneSelectScript = WKUserScript(source: js, injectionTime: WKUserScriptInjectionTime.atDocumentEnd, forMainFrameOnly: false) //WebView࡞੒ let config = WKWebViewConfiguration() config.userContentController.addUserScript(noneSelectScript) let webView = WKWebView.init(frame: rect, configuration: config) දࣔͷ֦େʗ௕ԡ͠ͷϝχϡʔ Λېࢭ͍ͨ͠
  9. // બ୒ېࢭ͢ΔCSS let css = "body{-webkit-user-select:none;-webkit-user-drag:none;- webkit-touch-callout: none;}" // CSSΛಡΈࠐΜͩHTMLʹద༻͢Δjavascript

    let js = "var style = document.createElement('style');" + "style.type = 'text/css';" + "var cssContent = document.createTextNode('\(css)');" + "style.appendChild(cssContent);" + "document.body.appendChild(style);" // javascriptΛϖʔδಡΈࠐΈ׬ྃ࣌ʹຖճ࣮ߦ͢ΔΑ͏ઃఆ let noneSelectScript = WKUserScript(source: js, injectionTime: WKUserScriptInjectionTime.atDocumentEnd, forMainFrameOnly: false) //WebView࡞੒ let config = WKWebViewConfiguration() config.userContentController.addUserScript(noneSelectScript) let webView = WKWebView.init(frame: rect, configuration: config) දࣔͷ֦େʗ௕ԡ͠ͷϝχϡʔ Λېࢭ͍ͨ͠ HTMLʹ௚઀CSS Λࢦఆͯ͠΋ྑ͍
  10. // બ୒ېࢭ͢ΔCSS let css = "body{-webkit-user-select:none;-webkit-user-drag:none;- webkit-touch-callout: none;}" // CSSΛಡΈࠐΜͩHTMLʹద༻͢Δjavascript

    let js = "var style = document.createElement('style');" + "style.type = 'text/css';" + "var cssContent = document.createTextNode('\(css)');" + "style.appendChild(cssContent);" + "document.body.appendChild(style);" // javascriptΛϖʔδಡΈࠐΈ׬ྃ࣌ʹຖճ࣮ߦ͢ΔΑ͏ઃఆ let noneSelectScript = WKUserScript(source: js, injectionTime: WKUserScriptInjectionTime.atDocumentEnd, forMainFrameOnly: false) //WebView࡞੒ let config = WKWebViewConfiguration() config.userContentController.addUserScript(noneSelectScript) let webView = WKWebView.init(frame: rect, configuration: config) දࣔͷ֦େʗ௕ԡ͠ͷϝχϡʔ Λېࢭ͍ͨ͠
  11. // બ୒ېࢭ͢ΔCSS let css = "body{-webkit-user-select:none;-webkit-user-drag:none;- webkit-touch-callout: none;}" // CSSΛಡΈࠐΜͩHTMLʹద༻͢Δjavascript

    let js = "var style = document.createElement('style');" + "style.type = 'text/css';" + "var cssContent = document.createTextNode('\(css)');" + "style.appendChild(cssContent);" + "document.body.appendChild(style);" // javascriptΛϖʔδಡΈࠐΈ׬ྃ࣌ʹຖճ࣮ߦ͢ΔΑ͏ઃఆ let noneSelectScript = WKUserScript(source: js, injectionTime: WKUserScriptInjectionTime.atDocumentEnd, forMainFrameOnly: false) //WebView࡞੒ let config = WKWebViewConfiguration() config.userContentController.addUserScript(noneSelectScript) let webView = WKWebView.init(frame: rect, configuration: config) දࣔͷ֦େʗ௕ԡ͠ͷϝχϡʔ Λېࢭ͍ͨ͠
  12. // બ୒ېࢭ͢ΔCSS let css = "body{-webkit-user-select:none;-webkit-user-drag:none;- webkit-touch-callout: none;}" // CSSΛಡΈࠐΜͩHTMLʹద༻͢Δjavascript

    let js = "var style = document.createElement('style');" + "style.type = 'text/css';" + "var cssContent = document.createTextNode('\(css)');" + "style.appendChild(cssContent);" + "document.body.appendChild(style);" // javascriptΛϖʔδಡΈࠐΈ׬ྃ࣌ʹຖճ࣮ߦ͢ΔΑ͏ઃఆ let noneSelectScript = WKUserScript(source: js, injectionTime: WKUserScriptInjectionTime.atDocumentEnd, forMainFrameOnly: false) //WebView࡞੒ let config = WKWebViewConfiguration() config.userContentController.addUserScript(noneSelectScript) config.selectionGranularity = .character let webView = WKWebView.init(frame: rect, configuration: config) NG: දࣔͷ֦େʗ௕ԡ͠ͷϝχϡʔ Λېࢭ͍ͨ͠ ͜ͷࢦఆ͸NG
  13. TOPICS • දࣔͷ֦େʗ௕ԡ͠ͷϝχϡʔͳͲΛېࢭ ͍ͨ͠ • ಈըΛΠϯϥΠϯͰ࠶ੜ͍ͨ͠ • ಈըΛࣗಈ࠶ੜ͍ͨ͠ • ભҠઌʹΑͬͯը໘ͷಈ࡞Λมߋ͍ͨ͠

    • ಛघͳϦϯΫΛઃఆͯ͠ΞϓϦʹಛఆͷಈ ࡞Λ͍ͤͨ͞
  14. ಈըΛΠϯϥΠϯͰ࠶ੜ͍ͨ͠ ಈըΛࣗಈ࠶ੜ͍ͨ͠ //WebViewઃఆ let config = WKWebViewConfiguration() config.allowsInlineMediaPlayback = true

    config.userContentController.addUserScript(noneSelectScript) if #available(iOS 10.0, *) { config.mediaTypesRequiringUserActionForPlayback = [] } else { config.requiresUserActionForMediaPlayback = false } //WebView࡞੒ let config = WKWebViewConfiguration() let webView = WKWebView.init(frame: rect, configuration: config)
  15. ಈըΛΠϯϥΠϯͰ࠶ੜ͍ͨ͠ ಈըΛࣗಈ࠶ੜ͍ͨ͠ //WebViewઃఆ let config = WKWebViewConfiguration() config.allowsInlineMediaPlayback = true

    config.userContentController.addUserScript(noneSelectScript) if #available(iOS 10.0, *) { config.mediaTypesRequiringUserActionForPlayback = [] } else { config.requiresUserActionForMediaPlayback = false } //WebView࡞੒ let config = WKWebViewConfiguration() let webView = WKWebView.init(frame: rect, configuration: config) ΠϯϥΠϯಈը࠶ੜΛڐՄ͢Δ
  16. ಈըΛΠϯϥΠϯͰ࠶ੜ͍ͨ͠ ಈըΛࣗಈ࠶ੜ͍ͨ͠ //WebViewઃఆ let config = WKWebViewConfiguration() config.allowsInlineMediaPlayback = true

    config.userContentController.addUserScript(noneSelectScript) if #available(iOS 10.0, *) { config.mediaTypesRequiringUserActionForPlayback = [] } else { config.requiresUserActionForMediaPlayback = false } //WebView࡞੒ let config = WKWebViewConfiguration() let webView = WKWebView.init(frame: rect, configuration: config) ࣗಈ࠶ੜΛڐՄ͢Δ (iOS ʙ9)
  17. ಈըΛΠϯϥΠϯͰ࠶ੜ͍ͨ͠ ಈըΛࣗಈ࠶ੜ͍ͨ͠ //WebViewઃఆ let config = WKWebViewConfiguration() config.allowsInlineMediaPlayback = true

    config.userContentController.addUserScript(noneSelectScript) if #available(iOS 10.0, *) { config.mediaTypesRequiringUserActionForPlayback = [] } else { config.requiresUserActionForMediaPlayback = false } //WebView࡞੒ let config = WKWebViewConfiguration() let webView = WKWebView.init(frame: rect, configuration: config) ࣗಈ࠶ੜΛڐՄ͢Δ (iOS 10ʙ)
  18. ಈըΛΠϯϥΠϯͰ࠶ੜ͍ͨ͠ ಈըΛࣗಈ࠶ੜ͍ͨ͠ <video src=“XXXXX.mp4” autoplay webkit-playsinline playsinline></video>

  19. ಈըΛΠϯϥΠϯͰ࠶ੜ͍ͨ͠ ಈըΛࣗಈ࠶ੜ͍ͨ͠ <video src=“XXXXX.mp4” autoplay webkit-playsinline playsinline></video> ࣗಈ࠶ੜͷઃఆ(PC, AndroidؚΉ)

  20. ಈըΛΠϯϥΠϯͰ࠶ੜ͍ͨ͠ ಈըΛࣗಈ࠶ੜ͍ͨ͠ <video src=“XXXXX.mp4” autoplay webkit-playsinline playsinline></video> ΠϯϥΠϯ࠶ੜͷઃఆ(ʙiOS 9 WebViewͷΈ)

  21. ಈըΛΠϯϥΠϯͰ࠶ੜ͍ͨ͠ ಈըΛࣗಈ࠶ੜ͍ͨ͠ <video src=“XXXXX.mp4” autoplay webkit-playsinline playsinline></video> ΠϯϥΠϯ࠶ੜͷઃఆ(iOS 10ʙ, WebView

    / Safari)
  22. ಈըΛΠϯϥΠϯͰ࠶ੜ͍ͨ͠ NG: ಈըΛࣗಈ࠶ੜ͍ͨ͠ //WebViewઃఆ let config = WKWebViewConfiguration() config.allowsInlineMediaPlayback =

    true config.userContentController.addUserScript(noneSelectScript) if #available(iOS 10.0, *) { config.mediaTypesRequiringUserActionForPlayback = [] } else { config.requiresUserActionForMediaPlayback = false } //WebView࡞੒ let config = WKWebViewConfiguration() let webView = WKWebView.init(frame: rect, configuration: config) ҰൠͷαΠτΛࢀর͢ΔWebViewʹ͸ ઃఆ͠ͳ͍ํ͕ྑ͍
  23. NG: ΠϯϥΠϯͰಈըΛ ࠶ੜͨ͠··ը໘ભҠ͢Δ

  24. ը໘ભҠ͢Δલʹ࠶ੜதͷಈըΛ શͯఀࢭ͢Δ NG: ΠϯϥΠϯͰಈըΛ ࠶ੜͨ͠··ը໘ભҠ͢Δ

  25. ը໘ભҠ͢Δલʹ࠶ੜதͷಈըΛ શͯఀࢭ͢Δ //࠶ੜதͷϜʔϏʔΛఀࢭ͢Δ func stopAllMovie() { let js = "var

    v = document.getElementsByTagName('video');" + "for (var i = 0; i < v.length; ++i) { v[i].pause(); }" webView.evaluateJavaScript(js, completionHandler: nil) } override func viewDidDisappear(_ animated: Bool) { super.viewDidDisappear(animated) self.stopAllMovie() }
  26. TOPICS • දࣔͷ֦େʗ௕ԡ͠ͷϝχϡʔͳͲΛېࢭ ͍ͨ͠ • ಈըΛΠϯϥΠϯͰ࠶ੜ͍ͨ͠ • ಈըΛࣗಈ࠶ੜ͍ͨ͠ • ભҠઌʹΑͬͯը໘ͷಈ࡞Λมߋ͍ͨ͠

    • ಛघͳϦϯΫΛઃఆͯ͠ΞϓϦʹಛఆͷಈ ࡞Λ͍ͤͨ͞
  27. func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy)

    -> Void) { var result = WKNavigationActionPolicy.cancel defer { decisionHandler(result) } guard let url = navigationAction.request.url else { return } if let info = TLConfig.getIndexUrlInfo(url.absoluteString) { // TOPLOGͷURLͰ͋Δ هࣄ༻ͷ7JFX$POUSPMMFSΛ࡞੒͠/BWJHBUJPO$POUSPMMFSʹPush } else { // ֎෦ͷ63-Ͱ͋Δ ผͷ8FC7JFXΛ࡞੒͠ϞʔμϧͰදࣔ } ભҠઌʹΑͬͯը໘ͷಈ࡞Λมߋ͍ͨ͠
  28. ભҠઌʹΑͬͯը໘ͷಈ࡞Λมߋ͍ͨ͠ func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping

    (WKNavigationActionPolicy) -> Void) { var result = WKNavigationActionPolicy.cancel defer { decisionHandler(result) } guard let url = navigationAction.request.url else { return } if let info = TLConfig.getIndexUrlInfo(url.absoluteString) { // TOPLOGͷURLͰ͋Δ هࣄ༻ͷ7JFX$POUSPMMFSΛ࡞੒͠/BWJHBUJPO$POUSPMMFSʹPush } else { // ֎෦ͷ63-Ͱ͋Δ ผͷ8FC7JFXΛ࡞੒͠ϞʔμϧͰදࣔ } WKNavigationDelegateͷ decidePolicyFornavigationActionΛ࣮૷ WebViewͷભҠΛϑοΫ͢Δ
  29. ભҠઌʹΑͬͯը໘ͷಈ࡞Λมߋ͍ͨ͠ func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping

    (WKNavigationActionPolicy) -> Void) { var result = WKNavigationActionPolicy.cancel defer { decisionHandler(result) } guard let url = navigationAction.request.url else { return } if let info = TLConfig.getIndexUrlInfo(url.absoluteString) { // TOPLOGͷURLͰ͋Δ هࣄ༻ͷ7JFX$POUSPMMFSΛ࡞੒͠/BWJHBUJPO$POUSPMMFSʹPush } else { // ֎෦ͷ63-Ͱ͋Δ ผͷ8FC7JFXΛ࡞੒͠ϞʔμϧͰදࣔ } decisionHandlerʹWKNavigationActionPolicy.cancelΛ ηοτ͢ΔͱભҠ͠ͳ͍
  30. ભҠઌʹΑͬͯը໘ͷಈ࡞Λมߋ͍ͨ͠ func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping

    (WKNavigationActionPolicy) -> Void) { var result = WKNavigationActionPolicy.cancel defer { decisionHandler(result) } guard let url = navigationAction.request.url else { return } if let info = TLConfig.getIndexUrlInfo(url.absoluteString) { // TOPLOGͷURLͰ͋Δ هࣄ༻ͷ7JFX$POUSPMMFSΛ࡞੒͠/BWJHBUJPO$POUSPMMFSʹPush } else { // ֎෦ͷ63-Ͱ͋Δ ผͷ8FC7JFXΛ࡞੒͠ϞʔμϧͰදࣔ } deferͰηοτ͓ͯ͘͠ͱguardͰ൑ఆͨ͠ޙʹ return͢Δ͚ͩͰྑ͍ͷͰॻ͖΍͍͢
  31. ભҠઌʹΑͬͯը໘ͷಈ࡞Λมߋ͍ͨ͠ func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping

    (WKNavigationActionPolicy) -> Void) { var result = WKNavigationActionPolicy.cancel defer { decisionHandler(result) } guard let url = navigationAction.request.url else { return } if let info = TLConfig.getIndexUrlInfo(url.absoluteString) { // TOPLOGͷURLͰ͋Δ هࣄ༻ͷ7JFX$POUSPMMFSΛ࡞੒͠/BWJHBUJPO$POUSPMMFSʹPush } else { // ֎෦ͷ63-Ͱ͋Δ ผͷ8FC7JFXΛ࡞੒͠ϞʔμϧͰදࣔ } URL͕ࣗࣾͷ΋ͷ͔Ͳ͏͔Λ൑ఆ
  32. ಛघͳϦϯΫΛઃఆͯ͠ ΞϓϦʹಛఆͷಈ࡞Λ͍ͤͨ͞ // ֎෦ͷ63-Ͱ͋Δ switch url.scheme! { case "safari-http": fallthrough

    case "safari-https": let str = url.absoluteString guard let url = URL(string: str.substring(from: str.index(str.startIndex, offsetBy: "safari-".characters.count))) else { return } // Safariىಈ UIApplication.shared.openURL(url) case "http": fallthrough case "https": …
  33. ಛघͳϦϯΫΛઃఆͯ͠ ΞϓϦʹಛఆͷಈ࡞Λ͍ͤͨ͞ // ֎෦ͷ63-Ͱ͋Δ switch url.scheme! { case "safari-http": fallthrough

    case "safari-https": let str = url.absoluteString guard let url = URL(string: str.substring(from: str.index(str.startIndex, offsetBy: "safari-".characters.count))) else { return } // Safariىಈ UIApplication.shared.openURL(url) case "http": fallthrough case "https": … SafariΛىಈ͢ΔಛघURL
  34. ಛघͳϦϯΫΛઃఆͯ͠ ΞϓϦʹಛఆͷಈ࡞Λ͍ͤͨ͞ // ֎෦ͷ63-Ͱ͋Δ switch url.scheme! { case "safari-http": fallthrough

    case "safari-https": let str = url.absoluteString guard let url = URL(string: str.substring(from: str.index(str.startIndex, offsetBy: "safari-".characters.count))) else { return } // Safariىಈ UIApplication.shared.openURL(url) case "http": fallthrough case "https": … URL͔Βsafari-ΛऔΓআ͍ͯ OpenURLͰsafariΛىಈ
  35. ಛघͳϦϯΫΛઃఆͯ͠ ΞϓϦʹಛఆͷಈ࡞Λ͍ͤͨ͞ case "http": fallthrough case "https": if navigationAction.targetFrame?.isMainFrame ??

    false { // ϝΠϯը໘ͷભҠͷ৔߹ guard let host = url.host else { return } if directNavigationHosts.index(of: host) != nil { // ௚઀ભҠ UIApplication.shared.openURL(url) } else { // ֎෦ࢀর༻ϒϥ΢βΛϞʔμϧͰىಈ } } else { // ຒΊࠐΈͷ৔߹ result = WKNavigationActionPolicy.allow } …
  36. ಛघͳϦϯΫΛઃఆͯ͠ ΞϓϦʹಛఆͷಈ࡞Λ͍ͤͨ͞ case "http": fallthrough case "https": if navigationAction.targetFrame?.isMainFrame ??

    false { // ϝΠϯը໘ͷભҠͷ৔߹ guard let host = url.host else { return } if directNavigationHosts.index(of: host) != nil { // ௚઀ભҠ UIApplication.shared.openURL(url) } else { // ֎෦ࢀর༻ϒϥ΢βΛϞʔμϧͰىಈ } } else { // ຒΊࠐΈͷ৔߹ result = WKNavigationActionPolicy.allow } … ભҠ͢Δը໘͕ϝΠϯͷ ϑϨʔϜ͔Ͳ͏͔ΛνΣοΫ
  37. ಛघͳϦϯΫΛઃఆͯ͠ ΞϓϦʹಛఆͷಈ࡞Λ͍ͤͨ͞ case "http": fallthrough case "https": if navigationAction.targetFrame?.isMainFrame ??

    false { // ϝΠϯը໘ͷભҠͷ৔߹ guard let host = url.host else { return } if directNavigationHosts.index(of: host) != nil { // ௚઀ભҠ UIApplication.shared.openURL(url) } else { // ֎෦ࢀর༻ϒϥ΢βΛϞʔμϧͰىಈ } } else { // ຒΊࠐΈͷ৔߹ result = WKNavigationActionPolicy.allow } … ௚઀ભҠ͍ͤͨ͞HostΛ ϦετΞοϓͯ͠൑ఆ (itunes.apple.comͳͲ)
  38. ಛघͳϦϯΫΛઃఆͯ͠ ΞϓϦʹಛఆͷಈ࡞Λ͍ͤͨ͞ case "http": fallthrough case "https": if navigationAction.targetFrame?.isMainFrame ??

    false { // ϝΠϯը໘ͷભҠͷ৔߹ guard let host = url.host else { return } if directNavigationHosts.index(of: host) != nil { // ௚઀ભҠ UIApplication.shared.openURL(url) } else { // ֎෦ࢀর༻ϒϥ΢βΛϞʔμϧͰىಈ } } else { // ຒΊࠐΈͷ৔߹ result = WKNavigationActionPolicy.allow } … SFSafariViewController΍ผͷ֎෦ϒϥ΢β༻ ViewControllerΛϞʔμϧͰදࣔ
  39. ಛघͳϦϯΫΛઃఆͯ͠ ΞϓϦʹಛఆͷಈ࡞Λ͍ͤͨ͞ case "http": fallthrough case "https": if navigationAction.targetFrame?.isMainFrame ??

    false { // ϝΠϯը໘ͷભҠͷ৔߹ guard let host = url.host else { return } if directNavigationHosts.index(of: host) != nil { // ௚઀ભҠ UIApplication.shared.openURL(url) } else { // ֎෦ࢀর༻ϒϥ΢βΛϞʔμϧͰىಈ } } else { // ຒΊࠐΈͷ৔߹ result = WKNavigationActionPolicy.allow } … iFrameͳͲ
  40. case "http": fallthrough case "https": … case "globalsetting-toplog": //ઃఆΛ։͘ case

    "nextpage": //࣍ϖʔδ΁ case "toplog-login": //ϩάΠϯ case "toplog-display-close": //Ϟʔμϧը໘Λด͡Δ … default: //֎෦ΞϓϦΛىಈ UIApplication.shared.openURL(url) } ಛघͳϦϯΫΛઃఆͯ͠ ΞϓϦʹಛఆͷಈ࡞Λ͍ͤͨ͞ ΞϓϦʹಈ࡞ΛϑΟʔυόοΫ
  41. ಛघͳϦϯΫΛઃఆͯ͠ ΞϓϦʹಛఆͷಈ࡞Λ͍ͤͨ͞ case "http": fallthrough case "https": … case "globalsetting-toplog":

    //ઃఆΛ։͘ case "nextpage": //࣍ϖʔδ΁ case "toplog-login": //ϩάΠϯ case "toplog-display-close": //Ϟʔμϧը໘Λด͡Δ … default: //֎෦ΞϓϦΛىಈ UIApplication.shared.openURL(url) } ผΞϓϦͷURLεΩʔϜ
  42. ࠓ೔࿩ͤͳ͔ͬͨTOPICS • LINE SDKΛυΩϡϝϯτʹै࣮ͬͯ૷ͨ͠ ΒWebViewͰ໰୊͕ग़ͨ࿩ • WebViewͷcontentInsetͷ᠘ • WebViewͷϩʔυΛૣ͘ݟ͔͚ͤΔ

  43. ·ͱΊ •WebView͸ػೳ΋ઃఆ΋๛෋ͳͷͰɺΧελϚΠ ζ࣍ୈͰ৭ʑͰ͖·͢ •ϋϚΓͲ͜Ζ΋͍ͬͺ͍͋ΔͷͰɺ஫ҙͯ͠࢖ͬ ͍͖ͯ·͠ΐ͏ •ϋϚͬͨΒͲ͔͜Ͱڞ༗ͯ͘͠ΕΔͱتͼ·͢