Cannot call Google API from my cordova app getting accessNotConfigured

I created a simple cordova (under ionic) app that utilize the Google Client JS API, to query youtube activities.list.

When simulating the app on my browser everything works BUT when running on my device or emulator I get error 403 "Access Not Configured. The API is not enabled for your project, or there is a per-IP or per-Referer restriction configured on your API key and the request does not match these restrictions. Please use the Google Developers Console to update your configuration"

in Google API the you-tube API is enabled and I allowed * as referrer so I expected every request to be approved. When using chrome://inspect, I can see that header "x-origin" is "file://" and I think this is the problem since, if I remove this header and recreate the request it approved.

I am using default setting so all origin are allowed from Cordova and the error is coming from Google.

Apparently to be able to support any origin (referer) you must leave "ACCEPT REQUESTS FROM THESE HTTP REFERERS (WEB SITES)" as EMPTY rather than choosing "*" (which is opposite to what you think)

It's crucial to remember that when running hybrid application on mobile, the origin is null (since its running the site from "file://"