In Cordoba / Ion, How do I open a link to a Facebook profile in my native application?

I am trying to open a user profile in the native Facebook application on ios if it is installed. The application is built on Cordova / Ionic, and I use the ngCordova inAppBrowser plugin.

Twitter links, for example, work great with regular links to web twitter ( https://twitter.com/[username] ). Facebook, on the other hand, is not. I tried many different options:

Does not work.

What am I doing wrong? Is this possible with the current version of the Facebook application?

thanks

+5
source share
2 answers

Just use: 'fb: // profile'

In my case, it worked for both Android and iOS:

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

See this answer for further help on custom URL patterns supported by the Facebook iPhone app:

What are all the custom URL patterns supported by the iPhone Facebook app?

+4
source

Try the following:

 fb://profile?id=[username|user_id] 

I tested Safari, it works as expected,

-1
source

Source: https://habr.com/ru/post/1244226/


All Articles