Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ladybugph opened this issue Aug 2, 2018 · 11 comments
Open

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

ladybugph opened this issue Aug 2, 2018 · 11 comments

Comments

@ladybugph
Copy link

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.

@flyandi
Copy link
Owner

flyandi commented Aug 3, 2018

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
Copy link
Owner

flyandi commented Aug 3, 2018

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.

@ladybugph
Copy link
Author

ladybugph commented Aug 3, 2018

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.

@flyandi
Copy link
Owner

flyandi commented Aug 3, 2018

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

@ladybugph
Copy link
Author

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?

:)

@moddatherrashed
Copy link

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

but that does not work on iOS !

@alpamys-qanybet
Copy link

@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
Copy link

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

@lsantamaria
Copy link

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

@paveloso
Copy link

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

@markssiw11
Copy link

thanks, it work for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants