Showing posts with label google. Show all posts
Showing posts with label google. Show all posts

Wednesday, August 31, 2022

Google Family Link Android Device isn't ready

 When setting up Family Link for my kid, the setup keep failing and just showing very unhelpful error message "Something went wrong ..". Since the phone doesn't has family link installed yet, I try to login with my account first and installed Family Link app.

Opening the app, on my kid's account status, I can see it shows "Device isn't ready for ...". I removed my account (since family link account can't share device) and try to add my kid's account again. This time the setup went through!

So if you're facing similar issue and doesn't has Family Link app installed on the device yet, try to install the app with your own account first, before setting up your kid's account.

Wednesday, March 28, 2018

PHP with docker

A friend asking about a PHP library and I decided to test whether that library is working. But I don't have PHP environment setup (we're Python shop btw). But thanks to docker, that's easy these days.

docker run -it --tty --rm --volume $PWD:/app --user $(id -u):$(id -g) composer require google/apiclient:^2.0

Then we just need to create the script to run, still in the same directory:-

include_once __DIR__ . '/vendor/autoload.php';

$GCSE_API_KEY = "nqwkoigrhe893utnih_gibberish_q2ihrgu9qjnr";
$GCSE_SEARCH_ENGINE_ID = "937592689593725455:msi299dkne4de";

$client = new Google_Client();
$client->setApplicationName("My_App");
$client->setDeveloperKey($GCSE_API_KEY);
$service = new Google_Service_Customsearch($client);
$optParams = array("cx"=>self::GCSE_SEARCH_ENGINE_ID);    
$results = $service->cse->listCse("lol cats", $optParams);

And we can run that script again using docker:-

docker run -it --rm --volume $PWD:/app -w /app php:5.5-cli php cse.php

Links:-

https://stackoverflow.com/questions/41592249/how-to-use-php-client-for-google-custom-search-engine
https://hub.docker.com/r/library/php/
https://hub.docker.com/r/library/composer/