react-native-openanything
react-native-openanything copied to clipboard
fb://profile/{fbid} does not work.
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.
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 |
---|---|
fb | |
I just tested it and it works fine in both Simulators (Android and iOS).
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
.
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:
- fb://profile=zuck
- facebook://profile=zuck
- facebook://profile/zuck
- fb://profile/10157070662026756
- fb://profile=10157070662026756
- fb://profile/fbid=10157070662026756
- 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.
Ok let me test it again later see if I can reproduce it.
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 thank you for your helpful comment, it just facebook url instead of facebook page name.
but that does not work on iOS !
@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?
@ladybugph, where do you get those zuck
?, as I understood, username
is deprecated.
@alpamys-qanybet agreed. I am with the same issue. Did you get any solution?
for Android: fb://page/[page_id] for iOS: fb://profile/[page_id] - put it directly as a parameter in Linking.openUrl without Linking.canOpenUrl
thanks, it work for me.