Facebook的登录的Andorid中使用不同的设备不同、设备、Facebook、Andorid

2023-09-13 02:15:49 作者:樱埖

我有使用Facebook登录的谷歌的一个问题。我使用的Facebook SDK 3.0.1本。我在三星的Galaxy Y和模拟器运行正常工作。但在三星笔记,INTEX水上和Nexus 5它dosent工作。我试图构建和再次清洗的项目,但仍是问题仍然存在。我附上INTEX水上设备的日志:

I am having a problem with using facebook login for android app. I am using Facebook sdk 3.0.1 for this. I am running on Samsung galaxy y and emulators it works fine. But on samsung note, intex aqua and nexus 5 it dosent work. I tried building and cleaning the project again but still the problem persists. I am attaching the log of the intex aqua device:

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

日志三星注:

log for samsung note:

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
          }

任何帮助将是AP preciable。

Any help would be appreciable.

推荐答案

我的问题是,我已经上传的哈希键,我从code有以下不同。那是,当Facebook的应用程序安装在设备上并没有得到登录用户的会话的原因。因此,我写了这个code,得到了哈希,更新了我的控制台和宇..我得到了登录完美。我张贴这让我的同胞开发商保存我花了解决这个问题一段时间了。

The problem i was the hash key that i have uploaded and that i got from the code below were different. That was the reason that when facebook app was installed on the device it did not get the logged in session of the user. Thus I wrote this code, got the hash, updated on my console and woo.. i got the login perfect. I am posting this so that my fellow developer save some time that i have spent in solving this problem.

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) {
}