5

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

Twitter links, for example, work just fine with a regular web twitter link (https://twitter.com/[username]). Facebook on the other hand, do not. I have tried many different variations:

None worked.

What am I doing wrong? Is it even possible with the current version of the Facebook app?

Thanks

yohairosen
  • 1,665
  • 1
  • 18
  • 26

2 Answers2

4

Just use: 'fb://profile'

In my case worked for both Android and iOS:

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

See this answer for further reference on custom url schemes supported by Facebook iPhone app:

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

Community
  • 1
  • 1
sznrbrt
  • 993
  • 2
  • 11
  • 32
  • That scheme only works for your own profile, not for opening any user profile. – Mariano Argañaraz May 17 '17 at 15:40
  • 1
    Definitely used to work, but fb updated the app and the API, although I can't find the new schemes. If you do so, please be so kind to update my answer or leave a comment. – sznrbrt May 17 '17 at 20:22
-1

Try this:

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

I've tested on Safari, it works as expected,

Stephen Rauch
  • 47,830
  • 31
  • 106
  • 135