Thursday, June 12, 2014

Android: Open Facebook official app from your own app with different intents

Opening Facebook's official android app from your own app is really easy. You just need to create an intent with correct uri and start and activity with that intent. The app will open with the right page, group, picture, video or etc.

Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));
startActivity(intent);

where uri could be any of the following:

fb://root
fb://feed
fb://feed/{userID}
fb://profile
fb://profile/{userID}
fb://page/{id}
fb://group/{id}
fb://place/fw?pid={id}
fb://profile/{#user_id}/wall
fb://profile/{#user_id}/info
fb://profile/{#user_id}/photos
fb://profile/{#user_id}/mutualfriends
fb://profile/{#user_id}/friends
fb://profile/{#user_id}/fans
fb://search
fb://friends
fb://pages
fb://messaging
fb://messaging/{#user_id}
fb://online
fb://requests
fb://events
fb://places
fb://birthdays
fb://notes
fb://places
fb://groups
fb://notifications
fb://albums
fb://album/{%s}?owner={#%s}
fb://video/?href={href}

14 comments:

Marcos Campos said...

hi how to open intent from post in page facebook
example https://www.facebook.com/ZangadoGames/posts/1120441297984067

Agatha Bejan said...

What if someone who clicks on my link doesn't have the FB app on their phone? Currently they are redirected to a blank web page - is there any solution to that?

John Jacob said...

Thanks for Sharing such a good tip.Great job! now i can easily open Facebook Android apps on my phone.You can also Download Android Apps from here:
Free Crack Software |
Windows 10 Pro CD Key Crack Free Download

Software Download said...

Thanks for providing such a useful guide.Its very helpful for all Android user's.
You can also Download Android Apps For Samsung Galaxy click here:
Free Download Software Full Version |
Samsung Smart Camera App Free Download

Abbeygail said...

Thanks for sharing this. It is a very useful guide.
https://www.myoptimind.com/mobile-application-development-services/

Banu said...

Being new to the blogging world I feel like there is still so much to learn. Your tips helped to clarify a few things for me as well as giving..

Mobile App Development Company in Chennai
Android app Development Company in Chennai
ios app development Company in Chennai

HariS Rajput said...

This is such a great resource that you are providing and give it away for free. I love seeing blog that understand the value of providing a quality resource for free.
apk download

john stany said...


You have provided an nice article, Thank you very much for this one. And i hope this will be useful for many people.. and i am waiting for your next post keep on updating these kinds of knowledgeable things...

Android App Development Company

Albert Smith said...

I have found the article to be quite informative and I have increased by programming basic skills. Thanks for sharing the article with us and I am looking forward to reading more articles from this site especially on emerging and current issues on programming and android applications. I will be recommending this site to our writers who offer Thesis Data Analysis Chapter writing services.

john stany said...

You have provided an nice article, Thank you very much for this one. And i hope this will be useful for many people.. and i am waiting for your next post keep on updating these kinds of knowledgeable things...
iOS App Development Company

louis philip said...

These ways are very simple and very much useful, as a beginner level these helped me a lot thanks fore sharing these kinds of useful

and knowledgeable information.
Fitness SMS
Fitness Text
Salon SMS
Salon Text
Investor Relation SMS
Investor Relation Text

Sharon Sandy said...

great and nice blog thanks sharing..I just want to say that all the information you have given here is awesome...Thank you very much for this one.
web design Company
web development Company
web design Company in chennai
web development Company in chennai
web design Company in India
web development Company in India

Harikumar ODMS said...

Nice post
Your post is just outstanding! thanks for such a post,its really going great work.
local seo services in hyderabad

Joseph Sayaff said...

This is great! I will also share vender app it is a productivity tools that is helpful to business people