react-native-openanything icon indicating copy to clipboard operation
react-native-openanything copied to clipboard

fb://profile/{fbid} does not work.

Open ladybugph opened this issue 6 years ago • 11 comments

Hi. Facebook does not open the desired profile page in Android when using the fbid. However, it does work when using the referrer_profile_id. Using Mark Zuckerberg's official profile page. https://www.facebook.com/photo.php?fbid=10102454385528521&set=a.743613136151.2308566.4&type=3&source=11&referrer_profile_id=4

I had to manually visit the page, copy the link address and get the value of the referrer_profile_id. I can only get the fbid from the graph.api and not the other id.

Thanks.

ladybugph avatar Aug 02 '18 14:08 ladybugph

Did u ensure that you followed the linking scheme permission setting?

On iOS you might run into this issue. The reaon is that you have to explicit add the requesting query schemes into the pinfo.list variable LSApplicationQueriesSchemes.

e.g. for Facebook you would add fb. Please refer to the example list below for the correct query scheme string:

Target Query Scheme
Facebook fb
Instagram instagram
Twitter twitter
LinkedIn linkedin
WhatsApp whatsapp

I just tested it and it works fine in both Simulators (Android and iOS).

flyandi avatar Aug 03 '18 05:08 flyandi

So I believe there might be a confusion.

You would need to use the userId of the Facebook user, in your example above it would be zuck.

flyandi avatar Aug 03 '18 06:08 flyandi

Hi. It does not work. I have created a code almost similar to yours before I came across your plugin. I have a database with user's facebook id when they sign up to our website. None of them work. Like I said before, Linking can open the Facebook App but it does not redirect to the intended profile unless the referrer id is used.

I already tried most combinations for Universal linking. Here are few samples below:

  1. fb://profile=zuck
  2. facebook://profile=zuck
  3. facebook://profile/zuck
  4. fb://profile/10157070662026756
  5. fb://profile=10157070662026756
  6. fb://profile/fbid=10157070662026756
  7. fb://profile/fbid=zuck

Even coverting Marks' fbid to string. const fbID= 10157070662026756; const fbStr = fbID.toString()

Using your scheme: Facebook(fbStr) //opens the FB App but only opens my feeds Facebook('zuck') //opens the FB App but only opens my feeds

But if I used "4", it both works. Facebook(4) //Opens the FB app and navigate to Mark's profile page Facebook('4') //Opens the FB app and navigate to Mark's profile page

I don't have an issue with Linking Permission cause I can open the Facebook app without an error, I just can't make it redirect to the intended profile of the user.

Additional note though, opening a Facebook PAGE works. This will open the app to the Wikipedia's official page. fb://page/33138223345

Here's my snippet. fblink.js.txt

My environment: Windows 10 Android Studio 3.1.2 react-native-cli: 2.0.1 react-native: 0.53.3 NPM: 6.0.0-next.0

Oh by the way, I tried Graph API but I don't see a NODE there for the referral ID.

My facebook app is also updated to the latest version, I don't know if that makes any sense. Thanks. Have a nice day.

ladybugph avatar Aug 03 '18 09:08 ladybugph

Ok let me test it again later see if I can reproduce it.

flyandi avatar Aug 03 '18 20:08 flyandi

Hello again. So I dug a little dipper regarding this issue and found this on StackOverflow. https://stackoverflow.com/questions/4810803/open-facebook-page-from-android-app/16675476

I used this to open the FB profile through my react native app. fb://facewebmodal/f?href=[YOUR_FACEBOOK_PAGE] and it worked! According to the top answer, the newest version of facebook does not accept the fb://profile/id anymore. Which was the case for me.

I hope this will help you too. Maybe we need to check which version of Facebook app is installed in our phone so we can use the proper link, right?

:)

ladybugph avatar Aug 06 '18 18:08 ladybugph

@ladybugph thank you for your helpful comment, it just facebook url instead of facebook page name.

but that does not work on iOS !

moddatherrashed avatar Jun 17 '19 15:06 moddatherrashed

@ladybugph, I am trying fb://facewebmodal/f?href=https://www.facebook.com/FB_ID, but it only works with FB_USER_NAME not FB_ID. The problem is fbsdk Graph API does not give username, it is deprecated, so how to open the facebook page on Android without username?

alpamys-qanybet avatar Jun 23 '19 23:06 alpamys-qanybet

@ladybugph, where do you get those zuck?, as I understood, username is deprecated.

alpamys-qanybet avatar Jun 23 '19 23:06 alpamys-qanybet

@alpamys-qanybet agreed. I am with the same issue. Did you get any solution?

lsantamaria avatar Sep 12 '19 22:09 lsantamaria

for Android: fb://page/[page_id] for iOS: fb://profile/[page_id] - put it directly as a parameter in Linking.openUrl without Linking.canOpenUrl

paveloso avatar Jan 16 '21 12:01 paveloso

thanks, it work for me.

markssiw11 avatar Aug 12 '22 08:08 markssiw11