如何检查Facebook是否安装了Android [英] How to check if Facebook is installed Android

查看:999
本文介绍了如何检查Facebook是否安装了Android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在修改我的应用程序,以便在没有安装Facebook应用程序(SSO需要)的情况下尝试发布用户。这是我使用的代码:

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?

推荐答案

com.facebook.android是Facebook SDK的包名称。 Facebook应用程序是com.facebook.katana。

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

这篇关于如何检查Facebook是否安装了Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆