0

I am trying to create a YouTube client where videos are searched with a keyword. I have properly obtained the YouTube Data API v3 key. I have supplied both the package name and SHA1 release certificate properly. When I set the "Application restriction" to "Android apps" the API does not return any data. Please refer to the red rectangle in picture. But when the "Application restriction" is set to "None" the API is returning data normally. Please refer to the green rectangle. I really need to find a solution to this problem.

enter image description here

I have no idea about the cause of this problem. But I need to set a restriction for this API to be used from Android apps only so that the quota is not wasted. I am looking for a solution to this problem.

Dilazak
  • 139
  • 1
  • 1
  • 11

1 Answers1

0

It sounds like you haven't set the release certificate properly (even though you say you have). One possibility with the problem could be Google Play App signing. If your app is disrtributed on Google Play with Google Play app signing, the certificate won't be the certificate you upload with, as the Play Store re-signs your app. To find your certificate follow the instructions on this page under "Step 4: Register your app signing key with API providers".

To find the certificate of the key Google uses to re-sign your APK for delivery:

  1. Sign in to your Play Console.
  2. Select an app.
  3. On the left menu, click Release management > App signing.
  4. From this page, you can copy the most common fingerprints (MD5, SHA-1 and SHA-256) of your app signing certificate. If the API provider requires a different type of fingerprint, you can also download the original certificate in DER format and run it through the transformation tools that the API provider requires.
Nick Fortescue
  • 13,530
  • 1
  • 31
  • 37