Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android opening facebook app on a specific post

I am working on an application that fetches posts from user stream (from stream table) and displays them.
streams post_id fields are returned in the format of: {uid}_{postid}, e.g.:

100001147753406_320951738012113

How can I open facebook application to show such post?

in web browser this can be done with the url: www.facebook.com/uid/posts/postid, and according to searches this should be accomplished by setting Intent's uri to:

fb://post/{postid}?owner={uid}

However, this does not always work from intent.

What is the correct way to do this?

like image 427
Oren Avatar asked Feb 19 '13 07:02

Oren


People also ask

How can I open Facebook programmatically in Android?

To opening facebook app on specified profile page, you can do this: String facebookId = "fb://page/<Facebook Page ID>"; startActivity(new Intent(Intent. ACTION_VIEW, Uri.

How do I open Facebook in App instead of browser Android?

It's a joy to use, and unlike wired VR headsets, it's a device you can basically pick up and play without much fuss or setup. Open Facebook, tap Menu, then App Settings, and make sure the "Links open externally" switch is off.

How do I link to a specific Facebook post?

1 – Tap the three dots in the top-right corner of the post. 2 – Tap Copy link. 3 – Now you can paste the copied URL into a new Facebook post, a comment on another post, a blog post, or an instant message or email. There you go.


1 Answers

After messing around with the different options, this simple format finally worked for me:

fb://post/{postid}

Where the post id is the entire {x_id}_{y_id} string, e.g.:

fb://post/100001147753406_320951738012113
like image 100
orgar Avatar answered Oct 27 '22 00:10

orgar