阅读更多

http://www.verydemo.com/demo_c131_i27055.html

Conflict between Android SDK and Facebook for Android app

 

 

Q:

I have an app that uses the Facebook Android SDK. All works well (Facebook login, Like functionality) until I installed the Facebook for Android 3rd party application.

Without the 3rd party app, I get the WebView when choosing to login to Facebook. But with the Facebook app installed, user gets directed to the FB app for login (I believe it launches the activity for that app).

Is there a way to prevent my app from using the 3rd party app for anything Facebook related that I do on my app, and only use the WebView from the SDK for login?

Thanks in advance.

A:

Alrighty, read through the source code of Facebook SDK and reviewed the authorize method, and found my answer.

Found out that it's not a conflict but that's just how the way it works. The Facebook SDK prefers Single Sign-On, where available which means it will definitely use the Facebook for Android app for Login.

In the purposes of answering the question (how to prevent app from using 3rd party app), this is what I did:

mFacebook.authorize(context,
                
newString[]{"user_photos","friends_photos","publish_stream"},
                
-1, 
                
(DialogListener) dialogListener);

I just added the 3rd parameter which is the activityCode. Facebook SDK checks whether the value is greater than or equal to zero, and use Single Sign-on.

And now I know that the ideal and preferred way is to use the Facebook SSO method.

更多相关文章

  1. android 弹出软盘
  2. 获取Android(安卓)Device的信息
  3. The Saygus VPhone V1 clears FCC, Will this be Verizon’s nex
  4. Porting Android
  5. Porting Android
  6. The Saygus VPhone V1 clears FCC, Will this be Verizon’s nex
  7. ch07 Android(安卓)日期与时间对话框
  8. android facebook authorize 时禁止调用facebook app
  9. 升级android sdk到5.0,创建项目错误解决方法

随机推荐

  1. 把TextView中的文字添加阴影效果及Style
  2. android开发,修改默认界面的背景色
  3. Android ListView xml配置
  4. This Android(安卓)SDK requires Android
  5. 【30篇突击 android】源码统计 十
  6. Android SDK/ADT 历史版本下载地址
  7. android无线调试
  8. Android EditView 获取焦点 不弹出软键盘
  9. 一步一步学习androidNDK编程(hello world
  10. Android应用开发相关下载资源