0% found this document useful (0 votes)
164 views

How To Check If Facebook Is Installed Android - Stack Overflow PDF

The document discusses checking if the Facebook app is installed on an Android device. The question asks about checking the package name to determine if Facebook is installed. The top answer explains that the package name for the Facebook SDK is different than the package name for the actual Facebook app, and provides both package names. A second answer suggests additional package names that could be used but the best approach is to use the Facebook package name. A third response provides code to open the Facebook app store page if it is not installed.

Uploaded by

Shoaib Quraishi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
164 views

How To Check If Facebook Is Installed Android - Stack Overflow PDF

The document discusses checking if the Facebook app is installed on an Android device. The question asks about checking the package name to determine if Facebook is installed. The top answer explains that the package name for the Facebook SDK is different than the package name for the actual Facebook app, and provides both package names. A second answer suggests additional package names that could be used but the best approach is to use the Facebook package name. A third response provides code to open the Facebook app store page if it is not installed.

Uploaded by

Shoaib Quraishi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

sign up

Stack Overflow

log in

Questions Tags Users Badges Unanswered Ask

Read this post in our app!

49

How to check if Facebook is installed Android


android

facebook

package

I am modifying my app to be able to catch if a user tries to publish without having the facebook app installed (required for SSO). Here is the code I am
using:
try{
ApplicationInfo info = getPackageManager().
getApplicationInfo("com.facebook.android", 0 );
return true;
} catch( PackageManager.NameNotFoundException e ){
return false;
}

The problem is, it is always catching an error. According to the question here, I need to request the appropriate permission but I don't know what
permissions I need to request.
Is my problem a permission one or something else?

share

improve this question


easycheese
2,457 6 34 59

3 Answers

71

com.facebook.android is the package name for the Facebook SDK. The Facebook app is com.facebook.katana.

Asked
Jul 15 '11 at 18:01

Order By

Votes

share

improve this answer


Torid
3,369 19 29

Answered
Jul 15 '11 at 18:06

Best Approach is to pick the package name including com.facebook but anyway you may use following packages:
com.facebook.orca
com.facebook.katana
com.example.facebook
com.facebook.android

share

improve this answer


Abe
168 1 1 10

-2

Answered
Feb 9 '15 at 16:54

Intent i = new Intent(android.content.Intent.ACTION_VIEW);


i.setData(Uri.parse("https://play.google.com/store/apps/details?id=com.facebook.katana"));
startActivity(i);

this code worked for me

share

improve this answer


Avinash
22 6

Answered
Dec 9 '14 at 9:57

christiandev
10.5k 7 21 50

Edited
Dec 9 '14 at 10:00

answer not relevant to the question. He was asking something else. AndroidMechanic Dec 16 '15 at 22:01
add a comment

Your Answer

log in
or

Name

Email

By posting your answer, you agree to the privacy policy and terms of service.

Post Your Answer

meta chat tour help blog privacy policy legal contact us full site
Download the Stack Exchange Android app
2016 Stack Exchange, Inc

You might also like