###前提・実現したいこと
monacaでカスタムURLスキームを実施したいのですが、Androidでは問題ないのですが、iPhone(10.3)では、アプリが開くものの、handleOpenURLイベントが呼ばれずに困っています。ネットの情報も古いものが多く、iOS10での対応状況なども不透明なのですが、どなたかご存知の方、アドバイスをいただけますでしょうか。
利用プラグインCustom-URL-scheme : https://github.com/EddyVerbruggen/Custom-URL-scheme
###該当のソースコード
HTML
1<meta http-equiv="Content-Security-Policy" content="default-src * appliname: data; style-src * 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'"> 2 3 <script> 4 function handleOpenURL(url) { 5 setTimeout(function() { 6 alert(url); 7 }, 1); 8 } 9 </script> 10
xml
1<!--config.xml--> 2<widget xmlns="http://www.w3.org/ns/widgets" id="net.onenavi.app.ac7" version="1.0.0"> 3 <content src="index.html"/> 4 <allow-navigation href="*"/> 5 <allow-intent href="itms:*"/> 6 <allow-intent href="appliname:*"/> 7 <feature name="HandleOpenUrl"> 8 <param name="ios-package" value="CDVHandleOpenURL" /> 9 <param name="onload" value="true" /> 10 </feature> 11 <feature name="Custom URL scheme"> 12 <param name="id" value="cordova-plugin-customurlscheme" /> 13 <param name="url" value="https://github.com/EddyVerbruggen/Custom-URL-scheme.git" /> 14 <variable name="URL_SCHEME" value="ackonenavi" /> 15 </feature> 16 <gap:plugin name="cordova-plugin-customurlscheme" source="npm"> 17 <param name="URL_SCHEME" value="ackonenavi" /> 18 </gap:plugin> 19 <platform name="ios"> 20 <config-file platform="ios" target="*-Info.plist" parent="UISupportedInterfaceOrientations"> 21 <array> 22 <string>UIInterfaceOrientationPortrait</string> 23 </array> 24 </config-file>
###試したこと
iPhone Safariから、下記のようなURLスキーマへのリンクを用意したHTMLを開いて、遷移。
<a href="appliname://?test=xx">テスト</a>
アプリには遷移するが、handleOpenURL()は呼ばれない。
以下のサイトの情報を頼りに、config.xmlに書き足したりしていますが、解決には至ってません。
https://tajiblo.blogspot.jp/2016/08/apache-cordovaioscustome-url.html
尚、実機確認は、実機でのリリースビルド(アドホック)で、iPhoneにインストールしています。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。