编程语言
首页 > 编程语言> > java – Facebook用不同的设备登录android

java – Facebook用不同的设备登录android

作者:互联网

我在使用facebook登录Android应用程序时遇到问题.我正在使用Facebook sdk 3.0.1.我在三星galaxy y和模拟器上运行它工作正常.但是在三星注意到,intex aqua和nexus 5它不起作用.我尝试再次构建和清理项目,但问题仍然存在.我附加了intex aqua设备的日志:

08-09 11:01:56.850: W/com.facebook.Session(11390): Should not pass a read permission (offline_access) to a request for publish or manage authorization
08-09 11:01:56.850: W/com.facebook.Session(11390): Should not pass a read permission (email) to a request for publish or manage authorization
08-09 11:01:56.851: W/com.facebook.Session(11390): Should not pass a read permission (user_photos) to a request for publish or manage authorization
08-09 11:01:56.851: W/com.facebook.Session(11390): Should not pass a read permission (photo_upload) to a request for publish or manage authorization
08-09 11:01:56.851: W/com.facebook.Session(11390): Should not pass a read permission (read_stream) to a request for publish or manage authorization
08-09 11:02:32.603: W/Insideeee(11494): Insideeee
08-09 11:02:32.651: D/JpgDecHal(11494): JpgDecHal::JpgDecHal
08-09 11:02:32.651: D/JpgDecHal(11494): JpgDecHal::~JpgDecHal
08-09 11:02:32.652: D/JpgDecHal(11494): JpgDecHal::JpgDecHal
08-09 11:02:32.652: D/JpgDecHal(11494): JpgDecHal::start -> config jpeg path
08-09 11:02:32.652: D/JpgDecHal(11494): Decoder Src Addr:0x4501f008, width/height:[264, 65]           
08-09 11:02:32.652: D/JpgDecHal(11494): Decoder Dst Addr:0x45030000, width/height:[264, 65], format:3
08-09 11:02:32.653: D/JpgDecHal(11494): Decoder Dither:0, RangeDecode:0 [1868771184 1882089569 1702440557 1818456179]
08-09 11:02:32.654: D/JpgDecHal(11494): jpeg decoder result:0
08-09 11:02:32.655: D/JpgDecHal(11494): JpgDecHal::~JpgDecHal
08-09 11:02:32.682: D/JpgDecHal(11494): JpgDecHal::JpgDecHal
08-09 11:02:32.682: D/JpgDecHal(11494): JpgDecHal::~JpgDecHal
08-09 11:02:32.683: D/JpgDecHal(11494): JpgDecHal::JpgDecHal
08-09 11:02:32.683: D/JpgDecHal(11494): JpgDecHal::start -> config jpeg path
08-09 11:02:32.683: D/JpgDecHal(11494): Decoder Src Addr:0x4501f008, width/height:[144, 80]           
08-09 11:02:32.683: D/JpgDecHal(11494): Decoder Dst Addr:0x45032000, width/height:[144, 80], format:3
08-09 11:02:32.683: D/JpgDecHal(11494): Decoder Dither:0, RangeDecode:0 [0 0 0 0]
08-09 11:02:32.686: D/JpgDecHal(11494): jpeg decoder result:0
08-09 11:02:32.686: D/JpgDecHal(11494): JpgDecHal::~JpgDecHal

记录三星注:

08-09 11:20:31.225: W/isSessionValid(14609): isSessionValidfalse
08-09 11:20:31.225: W/Button Clicked(14609): Button Clickedd
08-09 11:20:31.230: W/com.facebook.Session(14609): Should not pass a read permission (offline_access) to a request for publish or manage authorization
08-09 11:20:31.230: W/com.facebook.Session(14609): Should not pass a read permission (email) to a request for publish or manage authorization
08-09 11:20:31.230: W/com.facebook.Session(14609): Should not pass a read permission (user_photos) to a request for publish or manage authorization
08-09 11:20:31.230: W/com.facebook.Session(14609): Should not pass a read permission (photo_upload) to a request for publish or manage authorization
08-09 11:20:31.230: W/com.facebook.Session(14609): Should not pass a read permission (read_stream) to a request for publish or manage authorization
08-09 11:20:31.365: D/SensorManager(14609): unregisterListener:: Trklfufi 9 budiwrd5mrfo5WirfulblrwuFmfulTrklfufi$KfukwiFmfulTrklfufiRvht@,*f.,-+8
08-09 11:20:31.365: D/Sensors(14609): Remain listener = Sending .. normal delay 200ms
08-09 11:20:31.365: I/Sensors(14609): sendDelay --- 200000000
08-09 11:20:31.365: D/SensorManager(14609): JNI - sendDelay
08-09 11:20:31.370: I/SensorManager(14609): Set normal delay = true
08-09 11:20:41.315: D/SensorManager(14609): registerListener :: handle = 0  name= K3DH Acceleration Sensor delay= 200000 Trklfufi 9 budiwrd5mrfo5WirfulblrwuFmfulTrklfufi$KfukwiFmfulTrklfufiRvht@,*f.,-+8

编辑:

Session session = Session.getActiveSession();
if(session.isOpened())
          {
              //some code
          }
          else
          {
              //some code
          }

任何帮助都会很明显.

解决方法:

问题我是我上传的哈希密钥,我从下面的代码得到的是不同的.这就是为什么当Facebook应用程序安装在设备上时它没有得到用户的登录会话.因此,我编写了这段代码,得到了哈希,在我的控制台上更新并且喔..我的登录完美了.我发布这个,以便我的开发人员节省一些时间,我已经花了解决这个问题.

try {
PackageInfo info = getPackageManager().getPackageInfo(
      "com.facebook.samples.loginhowto", PackageManager.GET_SIGNATURES);
for (Signature signature : info.signatures){
       MessageDigest md = MessageDigest.getInstance("SHA");
       md.update(signature.toByteArray());
       Log.d("KeyHash:", Base64.encodeToString(md.digest(), Base64.DEFAULT));
}
} catch (NameNotFoundException e) {
} catch (NoSuchAlgorithmException e) {
}

标签:android,java,facebook,facebook-login,login
来源: https://codeday.me/bug/20190929/1831295.html