我创建了一个离子ios应用程序,我添加了许多网址(Facebook,推特,苹果商店)的链接,但它不起作用。
我在allow-navigation config.xml中设置
<allow-navigation href="https://www.facebook.com/diethelpweight" />
<allow-intent href="*" />
<allow-navigation href="*" />
这是我创建链接的方式
<div class="social-share">
<div class="social-share-inner">
<div class="share-img-div"><!-- <img src="img/button/fb.png"> <i class="ion-social-facebook" ng-click=" window.open('https://www.facebook.com/diethelpweight', '_system', 'location=yes');"></i></div>
<div class="share-img-div"><!-- <img src="img/button/twitter.png"> --><i class="ion-social-googleplus" ng-click="openBrowser('https://plus.google.com/u/3/+Weightlossdiethelp101')"></i></div>
<div class="share-img-div"><!-- <img src="img/button/g+.png"> --><i class="ion-social-twitter" ng-click="openBrowser('https://twitter.com/DietHelpWeight')"></i></div>
<div class="share-img-div"><!-- <img src="img/button/pinterest.png"> --><i class="ion-social-pinterest" ng-click="openBrowser('http://www.pinterest.com/diethelpweightl')"></i></div>
<div class="share-img-div"><!-- <img src="img/button/youtube.png"> --><i class="ion-social-instagram" ng-click="openBrowser('http://instagram.com/weightloss_diethelp')"></i></div>
</div>
</div>
但它不起作用,在此先感谢。
答案 0 :(得分:0)
我认为ios不接受这些行;
<allow-intent href="*" />
<allow-navigation href="*" />
您应该单独编写每个域名,例如
<allow-navigation href="http://www.facebook.com/*" />
<allow-navigation href="https://www.facebook.com/*" />
<allow-navigation href="https://m.facebook.com/*" />
<allow-navigation href="https://embed.spotify.com/*" />
<allow-navigation href="https://open.spotify.com/*" />
如果您的openBrowser函数检查是否安装了本机应用程序,您应该在info.plist文件中告诉它,就像这些行jus一样,因为更改了ios规则以检查是否已安装。
<key>LSApplicationQueriesSchemes</key>
<array>
<string>twitter</string>
<string>fb</string>
<string>youtube</string>
<string>instagram</string>
</array>