Facebook : Warning: Request without access token missing application ID or client token


Posted on : Fri, 1st May 15 04:11 pm (Updated on : Fri, 1st May 15 04:11 pm) UTC
Author : Code2care
100+ votes

05-01 19:11:11.919 8750-8772/com.code2care.myapp D/GraphRequest﹕ Facebook : Warning: Request without access token missing application ID or client token

If you are getting the above error message in your Android Studio then the reason is that you have not specified the application Id in your AndroidManifest.xml file.

Also check that if you are using FacebookContentProvider to share something then you must provide the app id in com.facebook.app.FacebookContentProviderXXXXXXXXXXXXXXX :

Manifest Snippet : Language : XML
  <provider android:authorities="com.facebook.app.FacebookContentProviderXXXXXXXXXXXXXXX"
            android:name="com.facebook.FacebookContentProvider"
            android:exported="true"/>


Advertisements





Also check that your keyhash is correct, if not generate by calling this function in onCreate() method of your Activity.

File : keyHash Language : Java
private void getFbKeyHash(){
      PackageInfo info;
      try {

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

          for (Signature signature : info.signatures) {
              MessageDigest md;
              md = MessageDigest.getInstance("SHA");
              md.update(signature.toByteArray());
              String hashString = new String(Base64.encode(md.digest(), 0));
              System.out.println("App KeyHash : " + hashString);
          }
      } catch (Exception e) {
          Log.e("exception", e.toString());
      }
  }

Code2care's mission is to share varied knowledge in technical and non-technical areas gathered during day-to-day learnings and development activities so that our visitors can leverage this portal to find solutions to their queries without re-inventing the wheel. Technical posts include Learnings, Tutorials, Video Tutorials, Code Snippets, Tips-n-tricks.

Follow us : Facebook - Twitter - Google +