Warning: Sessionless Request needs token but missi

2020-05-24 19:44发布

Using the FB SDK for Android sometimes it throws me error in Logcat.

Anyone knows the reason? My app is running and approved (Not on google play). I'm also using the hash thing and have my main activity and package name listed on the FB app page.

6条回答
等我变得足够好
2楼-- · 2020-05-24 20:25

https://stackoverflow.com/a/4851484/3552317, is a solution that works for some peaple (and duplicate question) and this worked for me:

This worked for me:

       <string name="app_id">999999999999999</string>
        <meta-data
        android:name="com.facebook.sdk.ApplicationId"
        android:value="@string/app_id" />
查看更多
欢心
3楼-- · 2020-05-24 20:29

I think the facebook account that you use to share, hasn't a role in your facebook app. Go to your app developer facebook console and check Roles. Or set status and review to ON but I think it's not the good solution if your app isn't available on Google Play or App Store

查看更多
狗以群分
4楼-- · 2020-05-24 20:35

You got this error log because your session is expired, and you need call login again, it'll automatic login with user-authorized account and wouldn't promt user to accept the app's pubic permissions.

查看更多
霸刀☆藐视天下
5楼-- · 2020-05-24 20:36

You are getting this error because you have might not declare your application id in manifest.xml or you have not properly registered your application on "developers.facebook.com"

查看更多
手持菜刀,她持情操
6楼-- · 2020-05-24 20:41

You should check your Hash Key in Settings at https://developers.facebook.com Try the code below to check and add correct hashkey. It work for me!!!

private void getSHAFingerPrint(){
      PackageInfo info;
      try {

          info = getPackageManager().getPackageInfo(
                  "your.package", PackageManager.GET_SIGNATURES);

          for (Signature signature : info.signatures) {
              MessageDigest md;
              md = MessageDigest.getInstance("SHA");
              md.update(signature.toByteArray());
              String something = new String(Base64.encode(md.digest(), 0));
              Log.e("Hash key", something);
              System.out.println("Hash key" + something);
          }

      } catch (NameNotFoundException e1) {
          Log.e("name not found", e1.toString());
      } catch (NoSuchAlgorithmException e) {
          Log.e("no such an algorithm", e.toString());
      } catch (Exception e) {
          Log.e("exception", e.toString());
      }
  }
查看更多
啃猪蹄的小仙女
7楼-- · 2020-05-24 20:47

I know this is an question but I just solved my issue by going to https://developers.facebook.com/apps/[yourappid]/settings/ and disabling the option Deep Linking.

Hope this helps someone :).

查看更多
登录 后发表回答