{"id":801,"date":"2016-07-01T14:38:36","date_gmt":"2016-07-01T05:38:36","guid":{"rendered":"http:\/\/sonic.blue\/it\/?p=801"},"modified":"2016-09-09T15:13:42","modified_gmt":"2016-09-09T06:13:42","slug":"xamarin-forms%e3%81%aeweb%e3%82%a2%e3%83%97%e3%83%aa%e3%81%a7javascript%e3%81%8b%e3%82%89c%e3%82%92%e5%91%bc%e3%81%b3%e5%87%ba%e3%81%99%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"http:\/\/sonic.blue\/it\/801","title":{"rendered":"Xamarin.Forms\u306eWeb\u30a2\u30d7\u30ea\u3067Javascript\u304b\u3089C#\u3092\u547c\u3073\u51fa\u3059\u65b9\u6cd5"},"content":{"rendered":"<p>\u524d\u56de\u306e<a href=\"http:\/\/sonic.blue\/it\/744\" target=\"_blank\">\u300eXamarin.Forms\u3067\u30aa\u30d5\u30e9\u30a4\u30f3WEB\u30a2\u30d7\u30ea\u3092\u4f5c\u6210\u3059\u308b\u65b9\u6cd5\u300f<\/a>\u3067\u306fWeb\u30a2\u30d7\u30ea\u306e\u57fa\u672c\u7684\u306a\u4f5c\u6210\u307e\u3067\u3067\u3057\u305f\u306e\u3067\u3001\u305d\u308c\u3092\u62e1\u5f35\u3059\u308b\u5f62\u3067C#\u5074\u306e\u30b3\u30fc\u30c9\u3092Web\u5074\uff08Javascript\uff09\u304b\u3089\u5b9f\u884c\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<br \/>\n\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u4f5c\u6210\u307e\u3067\u306e\u624b\u9806\u306f\u307b\u307c\u540c\u3058\u3067\u3059\u306e\u3067\u7701\u7565\u3057\u307e\u3059\u3002\u524d\u56de\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>\u4e8b\u524d\u6e96\u5099<\/h2>\n<p>\u4eca\u56de\u306f\u300cNativeCallWebApp\u300d\u3068\u3044\u3046\u540d\u524d\u3067\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u203b\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d\u306f\u597d\u304d\u306b\u5909\u66f4\u3057\u3066\u3001\u8aad\u307f\u66ff\u3048\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n<a href=\"http:\/\/sonic.blue\/it\/wp-content\/uploads\/newproject.png\" rel=\"lightbox[801]\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-846 size-medium\" src=\"http:\/\/sonic.blue\/it\/wp-content\/uploads\/newproject-300x217.png\" alt=\"newproject\" width=\"300\" height=\"217\" srcset=\"http:\/\/sonic.blue\/it\/wp-content\/uploads\/newproject-300x217.png 300w, http:\/\/sonic.blue\/it\/wp-content\/uploads\/newproject-768x557.png 768w, http:\/\/sonic.blue\/it\/wp-content\/uploads\/newproject.png 905w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\n\u524d\u56de\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30b3\u30fc\u30c9\u300cBaseUrl.cs\u300d\u3092Namespace\u306b\u6c17\u3092\u4ed8\u3051\u3066\u4fee\u6b63\u3057\u306a\u304c\u3089\u3001iOS\u5074\u3068Android\u5074\u306b\u4f5c\u6210\u307e\u305f\u306f\u30b3\u30d4\u30fc\u3057\u307e\u3059\u3002<\/p>\n<p><strong>\u5171\u901a\u51e6\u7406[NativeCallWebApp&gt;NativeCallWebApp.cs]<\/strong><\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\n\tpublic interface IBaseUrl { string Get(); }\r\n<\/pre>\n<p><strong>Android\u5074[NativeCallWebApp.Droid&gt;BaseUrl.cs]<\/strong><\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\n&#x5B;assembly: Dependency(typeof(BaseUrl))]\r\nnamespace NativeCallWebApp.Droid\r\n{\r\n    public class BaseUrl : IBaseUrl\r\n    {\r\n        public string Get()\r\n        {\r\n            return &quot;file:\/\/\/android_asset\/webdir\/&quot;;\r\n        }\r\n    }\r\n}\r\n<\/pre>\n<p><strong>iOS\u5074[NativeCallWebApp.iOS&gt;BaseUrl.cs]<\/strong><\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\n&#x5B;assembly: Dependency(typeof(BaseUrl))]\r\nnamespace NativeCallWebApp.iOS\r\n{\r\n    public class BaseUrl : IBaseUrl\r\n    {\r\n        public string Get()\r\n        {\r\n            return NSBundle.MainBundle.BundlePath + &quot;\/webdir&quot;;\r\n        }\r\n    }\r\n}\r\n<\/pre>\n<h2>\u78ba\u8a8d\u7528HTML\u30b3\u30f3\u30c6\u30f3\u30c4\u4f5c\u6210<\/h2>\n<p>\u5b9f\u884c\u78ba\u8a8d\u7528\u306b2\u30da\u30fc\u30b8\u306eHTML\u30da\u30fc\u30b8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<br \/>\n<strong>page-a.html<\/strong><\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&amp;lt;html&amp;gt;\r\n\t&amp;lt;head&amp;gt;\r\n\t\t&amp;lt;title&amp;gt;page A&amp;lt;\/title&amp;gt;\r\n\t&amp;lt;\/head&amp;gt;\r\n\t&amp;lt;body style=&quot;background-color:#ff0;&quot;&amp;gt;\r\n\r\n\r\n&amp;lt;h2&amp;gt;page A&amp;lt;\/h2&amp;gt;\r\n\r\n\r\n\t\t&amp;lt;a href=&quot;page-b.html&quot;&amp;gt;Link page B&amp;lt;\/a&amp;gt;\r\n\t\t&amp;lt;a href=&quot;javascript:window.location.href='page-b.html';&quot;&amp;gt;location.href page B&amp;lt;\/a&amp;gt;\r\n\t\t&amp;lt;a href=&quot;javascript:window.open('page-b.html','_blank');&quot;&amp;gt;window.open page B&amp;lt;\/a&amp;gt;\r\n\t\t\r\n\t\t&amp;lt;a href=&quot;NativeCallWebApp:\/\/link\/&quot;&amp;gt;Link appC#&amp;lt;\/a&amp;gt;\r\n\t\t&amp;lt;a href=&quot;NativeCallWebApp:\/\/link_blank\/&quot; target=&quot;_blank&quot;&amp;gt;Link targetblank appC#&amp;lt;\/a&amp;gt;\r\n\t\t&amp;lt;a href=&quot;javascript:window.location.href='NativeCallWebApp:\/\/location.href\/';&quot;&amp;gt;location.href appC#&amp;lt;\/a&amp;gt;\r\n\t&amp;lt;\/body&amp;gt;\r\n&amp;lt;\/html&amp;gt;\r\n<\/pre>\n<p><strong>page-b.html<\/strong><\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&amp;lt;html&amp;gt;\r\n\t&amp;lt;head&amp;gt;\r\n\t\t&amp;lt;title&amp;gt;page B&amp;lt;\/title&amp;gt;\r\n\t&amp;lt;\/head&amp;gt;\r\n\t&amp;lt;body style=&quot;background-color:#0ff;&quot;&amp;gt;\r\n\r\n\r\n&amp;lt;h2&amp;gt;page B&amp;lt;\/h2&amp;gt;\r\n\r\n\r\n\t\t&amp;lt;a href=&quot;page-a.html&quot;&amp;gt;Link page A&amp;lt;\/a&amp;gt;\r\n\t&amp;lt;\/body&amp;gt;\r\n&amp;lt;\/html&amp;gt;\r\n<\/pre>\n<p>Android\u30a2\u30d7\u30ea\u5074\u306f\u4f5c\u6210\u3057\u305fHTML\u3092\u300cNativeCallWebApp.Droid\u300d\u5185\u306e\u300cAssets\u300d\u30d5\u30a9\u30eb\u30c0\u5185\u306b\u300cwebdir\u300d\u30d5\u30a9\u30eb\u30c0\u3092\u4f5c\u308a\u3001\u305d\u306e\u4e2d\u306b\u5165\u308c\u307e\u3059\u3002<br \/>\n\u5165\u308c\u305fHTML\u30d5\u30a1\u30a4\u30eb\u306e\u30d3\u30eb\u30c9\u30a2\u30af\u30b7\u30e7\u30f3\u3092\u300cNone\u300d\u304b\u3089\u300cAndroidAsset\u300d\u306b\u5909\u66f4\u3059\u308b\u306e\u3092\u5fd8\u308c\u306a\u3044\u3067\u304f\u3060\u3055\u3044\u3002<br \/>\niOS\u30a2\u30d7\u30ea\u5074\u306f\u300cNativeCallWebApp.iOS\u300d\u5185\u306e\u300cResources\u300d\u30d5\u30a9\u30eb\u30c0\u5185\u306b\u300cwebdir\u300d\u30d5\u30a9\u30eb\u30c0\u3092\u4f5c\u308a\u3001\u540c\u3058\u3082\u306e\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<br \/>\n\u3053\u3061\u3089\u3082\u30d3\u30eb\u30c9\u30a2\u30af\u30b7\u30e7\u30f3\u304c\u300cBundleResource\u300d\u306b\u306a\u3063\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>\u30ab\u30b9\u30bf\u30e0WebView\u306e\u30b3\u30fc\u30c9\u8ffd\u52a0<\/h2>\n<p>Android\u5074\u3067\u306f\u30ab\u30b9\u30bf\u30e0\u30ec\u30f3\u30c0\u30e9\u30fc\u3092\u5229\u7528\u3057\u307e\u3059\u306e\u3067\u3001Android\u306e\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u306b\u7a7a\u306e\u30af\u30e9\u30b9\u3067\u300cCustomWebView.cs\u300d\u3092\u4f5c\u6210\u3057\u3066\u3001\u6b21\u306e\u3088\u3046\u306b\u4fee\u6b63\u3057\u307e\u3059\u3002\u4eca\u56de\u306fWebViewRenderer\u5074\u3060\u3051\u3067\u306f\u306a\u304f\u3001WebViewClient\u5074\u3067\u3082\u51e6\u7406\u3092\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p><strong>Android\u5074[NativeCallWebApp.Droid&gt;CustomWebView.cs]<\/strong><\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\nusing System;\r\nusing Xamarin.Forms;\r\nusing Xamarin.Forms.Platform.Android;\r\nusing NativeCallWebApp;\r\nusing NativeCallWebApp.Droid;\r\n\r\n&#x5B;assembly: ExportRenderer(typeof(CustomWebView), typeof(CustomWebViewRenderer))]\r\nnamespace NativeCallWebApp.Droid\r\n{\r\n\tpublic class CustomWebViewRenderer : WebViewRenderer\r\n\t{\r\n\t\tprotected override void OnElementChanged(ElementChangedEventArgs&amp;lt;Xamarin.Forms.WebView&amp;gt; e)\r\n\t\t{\r\n\t\t\tbase.OnElementChanged(e);\r\n\t\t\tif (Control == null) return;\r\n\r\n\t\t\tControl.Settings.DomStorageEnabled = true;\r\n\t\t\tControl.Settings.JavaScriptEnabled = true;\r\n\r\n\t\t\t\/\/javascript\u306efile\u30b9\u30ad\u30fc\u30e0\u3078\u306e\u30a2\u30af\u30bb\u30b9\u8a31\u53ef\r\n\t\t\tControl.Settings.AllowFileAccessFromFileURLs = true;\r\n\t\t\tControl.Settings.AllowUniversalAccessFromFileURLs = true;\r\n\r\n\t\t\t\/\/Xamarin.Form\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb(CustomWebView)\r\n\t\t\tCustomWebView _formsWebView = (CustomWebView)e.NewElement;\r\n\t\t\t\/\/\u30cd\u30a4\u30c6\u30a3\u30d6\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb(Android.Webkit.WebView)\r\n\t\t\tAndroid.Webkit.WebView _droidWebView = this.Control;\r\n\r\n\t\t\t\/\/Xamarin.Form\u306eWebView\u3067\u306fNavigate\u306e\u30a4\u30d9\u30f3\u30c8\u3092\u62fe\u3048\u306a\u3044\u305f\u3081WebViewClient\u3092\u4e0a\u66f8\u304d\u3059\u308b\r\n\t\t\t_droidWebView.SetWebViewClient(new CustomWebViewClient(_formsWebView));\r\n\t\t}\r\n\t}\r\n\r\n\tpublic class CustomWebViewClient : Android.Webkit.WebViewClient\r\n\t{\r\n\t\tprivate readonly CustomWebView _formsWebView;\r\n\r\n\t\tpublic CustomWebViewClient(CustomWebView formsWebView)\r\n\t\t{\r\n\t\t\t_formsWebView = formsWebView;\r\n\t\t}\r\n\r\n\t\tpublic override bool ShouldOverrideUrlLoading(Android.Webkit.WebView view, string url)\r\n\t\t{\r\n\t\t\tif (url != null) { \r\n\t\t\t\tConsole.WriteLine(url);\r\n\r\n\t\t\t\t\/\/\u30a4\u30d9\u30f3\u30c8\u3092URL\u3067\u5224\u65ad\u3057\u3066\u30cd\u30a4\u30c6\u30a3\u30d6\u51e6\u7406\u5b9f\u884c\r\n\t\t\t\tif (url.Contains(&quot;nativecallwebapp:\/\/&quot;)) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tApplication.Current.MainPage.DisplayAlert(&quot;open url schemes&quot;, url, &quot;ok&quot;);\r\n\r\n\t\t\t\t\t\/\/Web\u51e6\u7406\u306e\u30ad\u30e3\u30f3\u30bb\u30eb\r\n\t\t\t\t\tview.StopLoading();\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n}\r\n<\/pre>\n<h2>Custom Url Scheme\u306e\u8a2d\u5b9a<\/h2>\n<p>iOS\u5074\u306f\u3001\u30ab\u30b9\u30bf\u30e0Web\u30b9\u30ad\u30fc\u30e0\u3092\u5229\u7528\u3057\u307e\u3059\u3002<br \/>\n\u57fa\u672c\u7684\u306b\u8a2d\u5b9a\u3060\u3051\u3067\u3059\u306e\u3067\u3001\u7c21\u5358\u3067\u3059\u3002<br \/>\n\u300cinfo.plist\u300d\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u3001\u8a2d\u5b9a\u753b\u9762\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<br \/>\n<a href=\"http:\/\/sonic.blue\/it\/wp-content\/uploads\/infoplist1.png\" rel=\"lightbox[801]\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-844 size-medium\" src=\"http:\/\/sonic.blue\/it\/wp-content\/uploads\/infoplist1-300x226.png\" alt=\"infoplist1\" width=\"300\" height=\"226\" srcset=\"http:\/\/sonic.blue\/it\/wp-content\/uploads\/infoplist1-300x226.png 300w, http:\/\/sonic.blue\/it\/wp-content\/uploads\/infoplist1-768x578.png 768w, http:\/\/sonic.blue\/it\/wp-content\/uploads\/infoplist1-1024x770.png 1024w, http:\/\/sonic.blue\/it\/wp-content\/uploads\/infoplist1.png 1230w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\n\u4e0b\u306e\u30bf\u30d6\u3092\u300cAdvanced\u300d\u30bf\u30d6\u306b\u5207\u308a\u66ff\u3048\u307e\u3059\u3002<br \/>\n<a href=\"http:\/\/sonic.blue\/it\/wp-content\/uploads\/infoplist2.png\" rel=\"lightbox[801]\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-845 size-medium\" src=\"http:\/\/sonic.blue\/it\/wp-content\/uploads\/infoplist2-300x226.png\" alt=\"infoplist2\" width=\"300\" height=\"226\" srcset=\"http:\/\/sonic.blue\/it\/wp-content\/uploads\/infoplist2-300x226.png 300w, http:\/\/sonic.blue\/it\/wp-content\/uploads\/infoplist2-768x578.png 768w, http:\/\/sonic.blue\/it\/wp-content\/uploads\/infoplist2-1024x770.png 1024w, http:\/\/sonic.blue\/it\/wp-content\/uploads\/infoplist2.png 1230w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\n\u300cURL Types\u300d\u306e\u9805\u76ee\u304c\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u305d\u306e\u4e2d\u306e\u300cURL Schemes\u300d\u306b\u5c0f\u6587\u5b57\u3067\u300cnativecallwebapp\u300d\u3068\u5165\u529b\u3057\u3066\u3001\u4fdd\u5b58\u3057\u307e\u3059\u3002<br \/>\n<a href=\"http:\/\/sonic.blue\/it\/wp-content\/uploads\/infoplist3.png\" rel=\"lightbox[801]\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-843 size-medium\" src=\"http:\/\/sonic.blue\/it\/wp-content\/uploads\/infoplist3-300x64.png\" alt=\"infoplist3\" width=\"300\" height=\"64\" srcset=\"http:\/\/sonic.blue\/it\/wp-content\/uploads\/infoplist3-300x64.png 300w, http:\/\/sonic.blue\/it\/wp-content\/uploads\/infoplist3-768x165.png 768w, http:\/\/sonic.blue\/it\/wp-content\/uploads\/infoplist3.png 779w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u6b21\u306b\u3001\u300cAppDelegate.cs\u300d\u3092\u4fee\u6b63\u3057\u307e\u3059\u3002<br \/>\nAppDelegate\u30af\u30e9\u30b9\u306e\u4e2d\u306bOpenUrl\u30a4\u30d9\u30f3\u30c8\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<p><strong>iOS\u5074[NativeCallWebApp&gt;AppDelegate.cs\uff08\u4fee\u6b63\uff09]<\/strong><\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\n\t\tpublic override bool OpenUrl(UIApplication application, NSUrl url, string sourceApplication, NSObject annotation)\r\n\t\t{\r\n\t\t\t\/\/\u30a4\u30d9\u30f3\u30c8\u3092URL\u3067\u5224\u65ad\u3057\u3066\u51e6\u7406\r\n\t\t\tif (url != null)\r\n\t\t\t{\r\n\t\t\t\t\/\/\u30a4\u30d9\u30f3\u30c8\u3092URL\u3067\u5224\u65ad\u3057\u3066\u30cd\u30a4\u30c6\u30a3\u30d6\u51e6\u7406\u5b9f\u884c\r\n\t\t\t\tif (url.AbsoluteString.Contains(&quot;nativecallwebapp:\/\/&quot;))\r\n\t\t\t\t{\r\n\t\t\t\tglobal::Xamarin.Forms.Application.Current.MainPage.DisplayAlert(&quot;open url schemes&quot;, url.AbsoluteString, &quot;ok&quot;);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}\r\n<\/pre>\n<h2>WebView\u306e\u958b\u59cb\u30da\u30fc\u30b8\u3092\u8a2d\u5b9a\u3059\u308b\u30b3\u30fc\u30c9\u8ffd\u52a0<\/h2>\n<p>\u524d\u56de\u3068\u540c\u69d8\u306b\u51e6\u7406\u3057\u307e\u3059\u304c\u3001\u308f\u304b\u308a\u3084\u3059\u304f\u306a\u308b\u3088\u3046\u306b\u5c11\u3057\u30a4\u30d9\u30f3\u30c8\u306e\u547c\u3073\u51fa\u3057\u65b9\u3092\u5909\u66f4\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u307e\u305f\u3001\u6700\u521d\u306eHTML\u547c\u3073\u51fa\u3057\u306e\u30da\u30fc\u30b8\u3082\u300cpage-a.html\u300d\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<p><strong>\u5171\u901a\u90e8\u5206[NativeCallWebApp&gt;NativeCallWebApp.cs\uff08\u4fee\u6b63\uff09]<\/strong><\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\nnamespace NativeCallWebApp\r\n{\r\n\tpublic class CustomWebView : WebView { }\r\n\tpublic interface IBaseUrl { string Get(); }\r\n\r\n\tpublic class App : Application\r\n\t{\r\n\t\tpublic App()\r\n\t\t{\r\n\t\t\tCustomWebView FormsWebView = new CustomWebView { Source = GetHTML() };\r\n\r\n\t\t\t\/\/ The root page of your application\r\n\t\t\tvar content = new ContentPage\r\n\t\t\t{\r\n\t\t\t\tTitle = &quot;NativeCallWebApp&quot;,\r\n\t\t\t\tContent = FormsWebView\r\n\t\t\t};\r\n\t\t\tMainPage = content;\r\n\t\t}\r\n\r\n\t\tprivate HtmlWebViewSource GetHTML()\r\n\t\t{\r\n\t\t\tHtmlWebViewSource html = new HtmlWebViewSource\r\n\t\t\t{\r\n\t\t\t\tHtml = @&quot;&amp;lt;!DOCTYPE html&amp;gt;\r\n\t\t\t\t\t\t &amp;lt;meta http-equiv=&quot;&quot;refresh&quot;&quot; content=&quot;&quot;0;URL=.\/page-A.html&quot;&quot;\/&amp;gt;\r\n\t\t\t\t\t\t &amp;lt;\/html&amp;gt;&quot;,\r\n\t\t\t\tBaseUrl = DependencyService.Get&amp;lt;IBaseUrl&amp;gt;().Get()\r\n\t\t\t};\r\n\t\t\treturn html;\r\n\t\t}\r\n\t}\r\n}\r\n<\/pre>\n<h2>\u52d5\u4f5c\u78ba\u8a8d<\/h2>\n<p>\u3053\u308c\u3067\u5b8c\u4e86\u3057\u307e\u3057\u305f\u306e\u3067\u3001\u30b9\u30bf\u30fc\u30c8\u30a2\u30c3\u30d7\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u5404\u30c7\u30d0\u30a4\u30b9\u306b\u5909\u66f4\u3057\u3066\u52d5\u4f5c\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<p><strong>Android\u5074<\/strong><br \/>\n<a href=\"http:\/\/sonic.blue\/it\/wp-content\/uploads\/droidtest.png\" rel=\"lightbox[801]\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-851 size-medium\" src=\"http:\/\/sonic.blue\/it\/wp-content\/uploads\/droidtest-300x270.png\" alt=\"droidtest\" width=\"300\" height=\"270\" srcset=\"http:\/\/sonic.blue\/it\/wp-content\/uploads\/droidtest-300x270.png 300w, http:\/\/sonic.blue\/it\/wp-content\/uploads\/droidtest-768x691.png 768w, http:\/\/sonic.blue\/it\/wp-content\/uploads\/droidtest-1024x922.png 1024w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><strong>iOS\u5074<\/strong><br \/>\n<a href=\"http:\/\/sonic.blue\/it\/wp-content\/uploads\/iostest.png\" rel=\"lightbox[801]\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-852 size-medium\" src=\"http:\/\/sonic.blue\/it\/wp-content\/uploads\/iostest-300x280.png\" alt=\"iostest\" width=\"300\" height=\"280\" srcset=\"http:\/\/sonic.blue\/it\/wp-content\/uploads\/iostest-300x280.png 300w, http:\/\/sonic.blue\/it\/wp-content\/uploads\/iostest-768x717.png 768w, http:\/\/sonic.blue\/it\/wp-content\/uploads\/iostest-1024x956.png 1024w, http:\/\/sonic.blue\/it\/wp-content\/uploads\/iostest.png 1847w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u3053\u308c\u3067\u3001\u3046\u307e\u304f\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u3092\u5224\u65ad\u3055\u305b\u3066C#\u306e\u51e6\u7406\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<br \/>\n\u30b5\u30f3\u30d7\u30eb\u3067\u306f\u500b\u3005\u306e\u7aef\u672b\u3067\u51e6\u7406\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u5171\u901a\u90e8\u5206\u5074\u306b\u5206\u5c90\u51e6\u7406\u3092\u8ffd\u52a0\u3057\u3066\u547c\u3073\u51fa\u3057\u3066\u3082\u3044\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<p><strong><a href=\"https:\/\/github.com\/BlueSonic\/XamarinForms_NativeCallWebApp\" target=\"_blank\">\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u306f\u3053\u3061\u3089\uff08GitHub\uff09<\/a><\/strong><\/p>\n<h2>\u5bfe\u5fdc\u65b9\u6cd5\u306e\u4e2d\u8eab\u306b\u3064\u3044\u3066<\/h2>\n<p>iOS\u5074\u306f\u81ea\u5206\u81ea\u8eab\u306e\u30a2\u30d7\u30ea\u3092Custum Web Scheme\u3067\u547c\u3073\u51fa\u3059\u3053\u3068\u3067\u3001\u30cd\u30a4\u30c6\u30a3\u30d6\u5074\u306eOpenUrl\u30a4\u30d9\u30f3\u30c8\u304b\u3089URL\u3092\u4f7f\u3063\u305f\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u306e\u5185\u5bb9\u304c\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002<br \/>\nAndroid\u5074\u3067\u540c\u69d8\u306e\u51e6\u7406\u3092\u884c\u304a\u3046\u3068\u3057\u305f\u3068\u3053\u308d\u3001\u30a2\u30af\u30c6\u30a3\u30d6\u72b6\u614b\u3067\u306fCustum Web Scheme\u3067\u30a4\u30d9\u30f3\u30c8\u304c\u4e0a\u304c\u3089\u306a\u3044\u3053\u3068\u304c\u5224\u660e\u3002\u6025\u304d\u3087WebView\u306e\u30a4\u30d9\u30f3\u30c8\u3067\u51e6\u7406\u3092\u63a2\u3057\u307e\u3057\u305f\u304c\u3001WebClient\u306b\u3057\u304b\u8a72\u5f53\u30a4\u30d9\u30f3\u30c8\u306eShouldOverrideUrlLoading\u304c\u306a\u3044\u305f\u3081\u3001\u3053\u306e\u3088\u3046\u306a\u5f62\u3067\u306e\u51e6\u7406\u65b9\u6cd5\u3067\u306e\u5b9f\u88c5\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\n\u4e00\u5fdcCustum Web Scheme\u306e\u5f62\u5f0f\u3067\u3001\u3069\u3061\u3089\u306e\u7aef\u672b\u306b\u3082\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u3092\u6e21\u3059\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u306e\u3067\u3001\u4e2d\u8eab\u306e\u51e6\u7406\u5f62\u614b\u306f\u7570\u306a\u308a\u307e\u3059\u304c\u3001\u3072\u3068\u307e\u305a\u306f\u3053\u308c\u3067\u5341\u5206\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u307e\u305f\u3001Xamarin.Forms.WebView\u3068Android.webkit.WebView\u304c\u540c\u3058\u540d\u524d\u3067\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u3069\u3061\u3089\u306eWebView\u306a\u306e\u304b\u308f\u304b\u3089\u306a\u304f\u306a\u308b\u6642\u304c\u3042\u3063\u3066\u5927\u5909\u3067\u3059\u3002\u4fee\u6b63\u3059\u308b\u5834\u5408\u306f\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\uff08\u4e2d\u8eab\u306e\u30a4\u30d9\u30f3\u30c8\u304c\u5168\u304f\u7570\u306a\u308a\u307e\u3059\u3002\u3068\u3044\u3046\u304b\u3001Xamarin.Forms\u306eWebForm\u304c\u8ca7\u5f31\u3059\u304e\u308b\uff01\uff09<\/p>\n<h2>\u8ab2\u984c<\/h2>\n<p>\u672c\u5f53\u306fHybridWebView\u3092\u3046\u307e\u304f\u4f7f\u3048\u3070\u7c21\u5358\u3060\u3063\u305f\u306e\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001\u3053\u3061\u3089\u306f\u3044\u307e\u306e\u3068\u3053\u308d\u5b8c\u6210\u3057\u3066\u304a\u3089\u305a\u3001\u4e00\u5fdc\u8a66\u3057\u305f\u611f\u3058\u3067\u306fJson\u306a\u3069\u306e\u4f9d\u5b58\u30d1\u30c3\u30b1\u30fc\u30b8\u3082\u5897\u3048\u308b\u3057Xamarin.Forms\u7684\u306b\u306f\u3044\u307e\u3044\u3061\u3060\u3063\u305f\u306e\u3067\u3001\u30b7\u30f3\u30d7\u30eb\u306b\u5185\u90e8\u5b9f\u88c5\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<h2>\u53c2\u8003\u30b5\u30a4\u30c8<\/h2>\n<p><a href=\"http:\/\/furuya02.hatenablog.com\/entry\/2014\/10\/11\/133358\" target=\"_blank\">Xamarin.Forms Facebook\u30a2\u30d7\u30ea\u306e\u4f5c\u6210 \uff08\u8efd\u91cf Facebook.SDK for Xamarin.Forms )<\/a><br \/>\n<a href=\"https:\/\/chomado.com\/programming\/c-sharp\/xamarin-launch-with-url-scheme\/\" target=\"_blank\">\u3010Xamarin .iOS\u3011\u3010C#\u3011\u81ea\u30a2\u30d7\u30ea\u306e URL Scheme \u3067\u8d77\u52d5\u3057\u3066\u5f15\u6570\u3092\u53d7\u3051\u53d6\u308b<br \/>\n<\/a><\/p>\n<p>Search index:<br \/>\n[Xamarin.Forms] Javascript Call C# function<br \/>\n[Xamarin.Forms] Calling C# Method from Javascript<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u56de\u306e\u300eXamarin.Forms\u3067\u30aa\u30d5\u30e9\u30a4\u30f3WEB\u30a2\u30d7\u30ea\u3092\u4f5c\u6210\u3059\u308b\u65b9\u6cd5\u300f\u3067\u306fWeb\u30a2\u30d7\u30ea\u306e\u57fa\u672c\u7684\u306a\u4f5c\u6210\u307e\u3067\u3067\u3057\u305f\u306e\u3067\u3001\u305d\u308c\u3092\u62e1\u5f35\u3059\u308b\u5f62\u3067C#\u5074\u306e\u30b3\u30fc\u30c9\u3092Web\u5074\uff08Javascript\uff09\u304b\u3089\u5b9f\u884c\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002 \u30d7\u30ed [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":851,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15,2],"tags":[18],"class_list":["post-801","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-xamarin","category-program","tag-xamarin"],"_links":{"self":[{"href":"http:\/\/sonic.blue\/it\/wp-json\/wp\/v2\/posts\/801","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/sonic.blue\/it\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/sonic.blue\/it\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/sonic.blue\/it\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/sonic.blue\/it\/wp-json\/wp\/v2\/comments?post=801"}],"version-history":[{"count":35,"href":"http:\/\/sonic.blue\/it\/wp-json\/wp\/v2\/posts\/801\/revisions"}],"predecessor-version":[{"id":868,"href":"http:\/\/sonic.blue\/it\/wp-json\/wp\/v2\/posts\/801\/revisions\/868"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/sonic.blue\/it\/wp-json\/wp\/v2\/media\/851"}],"wp:attachment":[{"href":"http:\/\/sonic.blue\/it\/wp-json\/wp\/v2\/media?parent=801"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/sonic.blue\/it\/wp-json\/wp\/v2\/categories?post=801"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/sonic.blue\/it\/wp-json\/wp\/v2\/tags?post=801"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}