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?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…