Open facebook page into facebook application Ios + ionic

旧街凉风 提交于 2020-01-13 14:08:10

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/45458995/open-facebook-page-into-facebook-application-ios-ionic

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!