Problem description: I am using Youtube Data API to fetch some videos using the API key in a Flutter app. I have used this code to fetch my data:
const FETCH_LINK =
"$BASE_URL?part=$PART&playlistId=$PLAYLIST_ID&key=$API_KEY&maxResults=$MAX_RESULTS";
var response = await http.get(Uri.parse(FETCH_LINK));
When I set the Applications restrictions to "None" in Credentials tab in GCP console of the project I'm getting my Data perfectly
Now when I try to restrict the data to only Android apps Its showing this error:
{error: {code: 403, message: Requests from this Android client application <empty> are blocked., errors: [{message: Requests from this Android client application <empty> are blocked., domain: global, reason: forbidden}], status: PERMISSION_DENIED, details: [{@type: type.googleapis.com/google.rpc.ErrorInfo, reason: API_KEY_ANDROID_APP_BLOCKED, domain: googleapis.com, metadata: {service: youtube.googleapis.com, consumer:
What I have already checked: I have added Debug and Release certificates and android package name correctly in the credentials tab.
What could be the possible error here? Is there anything I need to pass as headers in my request?
This is the endpoint I'm trying to fetch
https://youtube.googleapis.com/youtube/v3/playlistItems