Help Save Code2care! 😢

I've lost 99% of my revenue to AdBlockers & AI. Your support could be the lifeline that keeps this passion project alive!

Buy Code2care a Coffee QR Code

Scan to Buy Me A Coffee and help me continue coding for you!

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


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 :
provider android:authorities="com.facebook.app.FacebookContentProviderXXXXXXXXXXXXXXX"
            android:name="com.facebook.FacebookContentProvider"
            android:exported="true"/>

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

File : KeyHash.java Snippet
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());
      }
  }
Author Info:

Rakesh (He/Him) has a Masters Degree in Computer Science with over 15+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail: rakesh@code2care.org

Copyright Code2care © 2024 | Privacy Policy | About Us | Contact Us | Search