打开脸书页面到脸书应用程序Ios +离子 [英] Open facebook page into facebook application Ios + ionic

查看:179
本文介绍了打开脸书页面到脸书应用程序Ios +离子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


目标: - 打开Facebook页面网址到Facebook应用程序


我正在使用离子版本1.6 我尝试过

 < a ng -Click = openFb() > 
< img src =img / fb.pngalt =width =autoheight =auto>
< / a>

在控制器文件中我有我的功能。

  $ scope.openFb = function(){
window.open('fb:// page / 1372537532795807',_system);
};

以上搜索很多我发现如果你想打开页面,你必须通过 fb :: // page [page_id] than fb :: // profile / [page_id]



但是当我点击按钮时,甚至没有发现我的设备上打开安装的Facebook应用程序。



期待有一些帮助。 p>

谢谢高级。

解决方案

解决方案:添加URL白名单的方案



只需用编辑器打开您的应用程序的.plist(通常是平台/ ios // - Info.plist),并添加以下代码您所需的方案。

 < key> LSApplicationQueriesSchemes< / key> 
< array>
< string> fb< / string>
< / array>

Apple在iOS 9上更改了canOpenURL方法。在iOS 9和iOS上检查URL方案的应用程序10必须声明这些计划,因为它提交给苹果。文章快速采取iOS 9网址方案更改



参考链接: - https://github.com/ohh2ahh/AppAvailability/issues/22


Goal :- Open facebook page url into facebook application

I am using ionic version 1.6 I have tried

<a ng-click="openFb()">   
    <img src="img/fb.png" alt="" width="auto" height="auto">
</a>

In controller file i have my function below.

$scope.openFb = function() {  
    window.open('fb://page/1372537532795807', "_system");
 };

Above after searching lot i have found that if you wants to open page you have to pass fb:://page[page_id] than fb:://profile/[page_id]

But when i clicks on button nothing happens not even opening installed facebook application on my device.

Looking forward to have some help.

Thank you in advanced.

解决方案

Solution: Add URL Schemes to the Whitelist

Simply open your app's .plist (usually platforms/ios//-Info.plist) with an editor and add the following code with your needed Schemes.

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>fb</string>
</array>

Apple changed the canOpenURL method on iOS 9. Apps which are checking for URL Schemes on iOS 9 and iOS 10 have to declare these Schemes as it is submitted to Apple. The article Quick Take on iOS 9 URL Scheme Changes expains the changes in detail.

Reference link :- https://github.com/ohh2ahh/AppAvailability/issues/22

这篇关于打开脸书页面到脸书应用程序Ios +离子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆