阅读更多

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. Porting Android
  2. The Saygus VPhone V1 clears FCC, Will this be Verizon’s nex
  3. ch07 Android(安卓)日期与时间对话框
  4. android 自定义基于组件的注册用户对话框
  5. android中.classpath和.project作用
  6. 【IOS和Android】Cocos2d-x 集成微信分享功能
  7. 有板有眼:Google如何利用Moto的专利来帮助Android开发商?
  8. 【更新】Google 与微软开始口水战
  9. Android从零撸美团(四) - 美团首页布局解析及实现 - Banner+自定

随机推荐

  1. 使用android隐藏api实现亮度调节的方法
  2. [原]零基础学习SDL开发之在Android使用SD
  3. android全格式多媒体播放器(一:ffmpeg移植)
  4. Android面试题(六)--重要
  5. Android的activity的title设定内容
  6. Android异步加载图像小结(含线程池,缓存方
  7. [置顶] 电源管理之android内核suspend to
  8. Android 文件操作心得体会
  9. Android fragment使用
  10. android: Android Notification