YouTubeAndroidPlayerApi library play YouTube videos without a real GCP Api key - youtube-iframe-api

I am using the YouTubeAndroidPlayerApi library a youtube video playback in application.
Specification-Version: 1.2.2
gradle dependency:
implementation files('libs/YouTubeAndroidPlayerApi.jar')
I noticed the strange behavior of the library. The documentation says that need to Use the API key created in the GCP Console. But during testing it turned out that the video is played without a real key.
Below is an example test:
Test 1. I'm using the wrong or random API key:
val API_KEY = "QWERTYUIDFGHJKL" // wrong or random API key
YouTubePlayerSupportFragment.newInstance().initialize(API_KEY, object : YouTubePlayer.OnInitializedListener {...})
Surprisingly video video is played with this api_key.
Test 2. I use empty string instead of API key:
val API_KEY = "" // empty API key
YouTubePlayerSupportFragment.newInstance().initialize(API_KEY, object : YouTubePlayer.OnInitializedListener {...})
Video is playing in my app with this code
Can you please tell me why the video plays without a real GCP Api key?
Thanks!

Related

Puppeteer name resolution error on Firebase Cloud Functions

I have created a brand new free tier project, cloned Puppeteer Firebase Functions demo repository and only changed the default project name in .firebaserc file.
When I run the simple test or version functions I get the correct result. When I open the .com/screenshot page without any parameter I get correct ("Please provide a URL...") response.
But when I try any url, i.e. .com/screenshot?url=https://en.wikipedia.org/wiki/Google I get Error: net::ERR_NAME_RESOLUTION_FAILED at https://en.wikipedia.org/wiki/Google thrown in response.
I tried looking for any name resolution errors related to Puppeteer but I could not find anything. Could this be a problem of using free tier?
The free Spark payment plan restricts all outgoing connections except those API endpoints that are fully controlled by Google. As a result, I expect that puppeteer would not be able to make any outgoing connections to external web sites.

getting this error even after putting different keys in facial recognition door sample

even after entering the key I have been subscribed to a standard plan of the face api service but getting this error constantly.! Tried changing the end points and creating s0 tier API to but getting same error .
The project is old, and does not allow for specifying the API endpoint. I've made a fix in a fork and a pull request to the main project. Cognitive Service API keys are valid in only one region (i.e. you cannot use a westeurope key in westus, etc.)

NotificationHub Push Notification returns : The Token obtained from the Token Provider is wrong

I have Wp8.1 Silverlight app that receives push notification (WNS) from Mobileservice (the old azure service).
I therefore wanted to update to the new service because of the new features. I have now created/upgraded a new server to use App Service - Mobile App. And tested push notification with the sample app from azure (everything works).
Going back to my app WP8.1 -> Adding the new package Microsoft.Azure.Mobile.Client through NuGet (2.0.1), there is the issue that the Microsoft.WindowsAzure.Mobile.Ext does not contain the 'GetPush' extension. It seems like it is missing it? looking to the WP8 version, it only registers to MPNS, and I need WNS. So I do not know if any other assembly could be used.
Can I add another assembly reference?
Update
The following code lets me register the device on the server, and I can see the device register correctly. where the channelUri and the installationInformation are retrieved by the client and send to the server.
Installation ins = new Installation();
ins.Platform = NotificationPlatform.Wns;
ins.PushChannel = uTagAndChan.ChannelUri;
ins.Tags = uTagAndChan.Tags;
ins.InstallationId = uTagAndChan.installationInformation;
await hubClient.CreateOrUpdateInstallationAsync(ins);
Sending a test toast-notification to the registered tags, results in the following error :
The Token obtained from the Token Provider is wrong
Searching on this issue I found Windows Store App Push Notifications via Azure Service Bus. Which the proposed solution says to register to the notification hub directly from the app, I would rather not have the app to have directly access to the hub. But is this the only way? (mind you the answer was not accepted, but I will try it all though it is not a desired solution)
Update
Registering for notifications via client (WP8.1 Silverligt), makes a registration to MPNS, which I do not want.
The snippet on the server registers a WNS, the two registrations can be seen here:
The URI retrieval is done using
var channel = await Windows.Networking.PushNotifications.PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync();
which in the description states it returns a WNS. This seems to infer that the registration I am doing on the server (code snippet in the top) is correct and the registration on the client is faulty.
But the registration on the image seems wrong. Shouldn't the PNS Identifier be different for the two registrations? also expiration date seems wrong ?
How to mend this since the GetPush() (which was available in the sample registered the client correctly for notifications) does not exist in the NuGet package?
Update
I read one place that deleting and recreating the NotificationHub could help. I will try this today. Even IF it works, it would be more desirable to have the solution, and to know if the registrations are done correctly?
Temporary solution:
Deltede, recreated, inserted Package SID and Secret. And it works again (strange)!
Still interested in the underlying issue!
Deleted and recreated the service, setting all the same settings made it work again.
I had same issue with my UWP. But in my case I had issue with self signed certificate.
When I set the AppxPackageSigningEnabled property to True (in .csproj) then notifications stopped working and I got "The token obtained from the Token Provider is wrong" (Test send from Azure Portal).
The certificate must have same issuer as Publisher in Identity element in .appxmanifest file.

REQUEST_DENIED when using Google Maps AutoComplete

I am unable to use Google Maps AutoComplete. I have read all the articles about this problem, and I still get REQUEST_DENIED:
The following services are turned ON:
Google Maps API v3
Places API
Prediction API
Simple API Access:
API key: **
Referers: Any referer allowed
Activated on: (A few days ago)
Activated by: ** – you
I have even activated my credit card (don't know if that makes a difference for traffic under the quota):
The following happens (tested both from a browser and command line cURL):
https://maps.googleapis.com/maps/api/place/autocomplete/json?input=New&types=(cities)&key=$apikey
{
"predictions" : [],
"status" : "REQUEST_DENIED"
}
How do I make this work?
From the documentation
Required parameters
input — The text string on which to search. The Place service will return candidate matches based on this string and order results based on their perceived relevance.
sensor — Indicates whether or not the Place request came from a device using a location sensor (e.g. a GPS) to determine the location sent in this request. This value must be either true or false.
key — Your application's API key. This key identifies your application for purposes of quota management. Visit the APIs Console to select an API Project and obtain your key. Maps API for Business customers must use the API project created for them as part of their Places for Business purchase.
I don't see "sensor" in your example request.

Does addSideDatabase not work with Google Maps Engine Lite? Why no callbacks?

Exploring the addSideDatabase method in Google Code Playground (http://code.google.com/apis/ajax/playground/#adding_a_side_database), I tried to replace the URL with one for my Google Maps Engine Lite map (https://mapsengine.google.com/map/edit?mid=zaet3r0aK3bg.kEC1j3RZYDKw). It didn't work. Is Google Maps Engine Lite not supported? I can't find anything either way in the docs. Furthermore, why are neither the sideDatabaseSuccess nor sideDatabaseFail callbacks invoked?
I don't know for sure if Google Maps Engine Lite is supported, I think it possibly is as that has partly replaced the Google Earth Builder platform which did allow for such connections.
In any case usually to use any professional/enterprise functions you must make sure to pass your client ID when loading the actual Earth API. e.g.
var params = {"other_params":"client=CLIENTID&sensor=false"};
google.load("earth", "1", params);
See: https://developers.google.com/earth/documentation/#sidedatabase
Also note that if your map is private you'll need to provide authentication credentials along when you connect.

Resources