desi Joe
desi Joe

Reputation: 373

how to upload apk with Google play custom app API

I am trying to upload a custom app to play store. I am stuck with how to get the account Id that I need to pass to the create method.

the documentation says that I need to call the following api but, I am not sure how to make the call and get service account.

https://play.google.com/apps/publish/delegatePrivateApp?service_account=serviceAccountEmail&continueUrl=callbackUrl

I appreciate any help, thanks.

Google Play Doc and Java Doc

Here is my code so far:

        GoogleCredential credential = GoogleCredential.fromStream(new FileInputStream("/Users/mie/Downloads/Google-Play-Android-Developer-9b6977dc98fc.json"))
            .createScoped(Collections.singleton(PlaycustomappScopes.ANDROIDPUBLISHER));

    Playcustomapp app = new Playcustomapp.Builder(httpTransport, JSON_FACTORY, credential).setApplicationName(APPLICATION_NAME).build();
    app.accounts().customApps().create(...);

Upvotes: 2

Views: 1356

Answers (1)

A.Queue
A.Queue

Reputation: 1572

You probably were referring to this documentation. It says that you have to create a service account manually and that it has to belong to a Cloud Project. Here are the steps:

  1. Open the Google API Console. Login if prompted.

  2. From the projects list, choose the project that you selected or created when enabling the API.

  3. From the main menu, select IAM & Admin > Service accounts > Create service account.

  4. Enter a name for your service account and select Furnish a new private key. Then click Create.

Once you followed this steps the service account email will look like this: [email protected]. You should put it into the URL you mentioned along with the URL the visitor should be redirected to after. Like this:

https://play.google.com/apps/publish/delegatePrivateApp?service_account=service-account-name@project-id.iam.gserviceaccount.com&continueUrl=https://www.example.com

I also advise to review the documentation once again.

Upvotes: 2

Related Questions