Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connect more than one project id to the Google Play Developer Console

When I try to execute a request for a Google developer API. purchases(). products(). get() I receive a 403 error: projectNotLinked.

The message tells me "The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console."

At this point I can go to the console, unlink a previous project, and link this one, run the code, and the code works.

However, I cannot unlink permanently the previous project: I need to keep them both linked. How do I solve this problem?

I looked around and couldn't find a solution. Tried to call Google, and they told me that they do not support this kind of requests.

Thanks in advance.

like image 695
Pezze Avatar asked Aug 05 '15 13:08

Pezze


People also ask

Can I have multiple Google Play Console accounts?

It is not allowed to have more than 1 AdSense/AdMob account, but it is okay to have more than one Google Play Developer account. You can monetize multiple developer accounts with 1 AdMob account.

How do I create multiple Google Play developer accounts?

Yes you can create multiple google play account on same IP but you will have to pay the $25 developer fee again. the only things you have to remember just use different email id for different accounts , in this case you have to make concern about this if you will make any mistake your all accounts can be in danger.

How many Google Play developer accounts can I have?

You can have multiple developer accounts. If one account get banned Google will try to find all your other accounts and they will be banned too..


2 Answers

To reemphasise @andy's comment: There can only be one single linked API project.

I spend quite some time to find this out. Google's documentation is not helpful here.

If you need access to multiple projects/applications, you have to create multiple service accounts inside of the single linked API project and manages access to apps individually.

like image 172
iltempo Avatar answered Sep 19 '22 00:09

iltempo


Andy's comment is correct, I find the description LINKED PROJECT in the Google Play Developer Console confusing at best.

However, I setup in the Google Developers Console a company project with the appropriate Server Keys and Service accounts. It isn't ideal, but it works. You can then assign permission to the required service account back in the Google Play Developer Console.

You can also setup just one key and service account if that makes it simpler and the use them as shown below in PHP for a server

$service_account_name = '[email protected]';
$key_file_location = somedir/keyfile.p12;

$client = new Google_Client();
$client->setApplicationName("GoogleDevelopersConsoleProjectName");
$service = new Google_Service_AndroidPublisher($client);

$key = file_get_contents($key_file_location);
$cred = new Google_Auth_AssertionCredentials(
    $service_account_name,
    array('https://www.googleapis.com/auth/androidpublisher'),
    $key
);

$client->setAssertionCredentials($cred);

if($client->getAuth()->isAccessTokenExpired()) {
  $client->getAuth()->refreshTokenWithAssertion($cred);
}  

$apiKey = "GoogleDevelopersConsoleServerKey";
$client->setDeveloperKey($apiKey);

$package_name = "com.yourcompany.yourappname1";

Then all you need to do for the other application is change the $package_name.

$package_name = "com.yourcompany.yourappname2";

Then using the Google Service AndroidPublisher to query subscriptions

$service = new Google_Service_AndroidPublisher($client);

$results = $service->purchases_subscriptions->get($package_name,$subscriptionId,$token,array());

You can also start to assign multiple keys, service accounts and other credentials you add other projects in the Google Play Developer Console.

like image 29
Longmang Avatar answered Sep 19 '22 00:09

Longmang