Giter Club home page Giter Club logo

Comments (2)

orrc avatar orrc commented on August 23, 2024

Each time around the loop, you're overwriting the list of APKs you want to assign to the track.

You need to pass in the list of all versionCodes you want to assign to the track once before committing.

from android-play-publisher-api.

sylvestre avatar sylvestre commented on August 23, 2024

Right. My bad. thanks

For others, here is the updated code:

  versions = []
  for apk_file in apk_files:

    try:
      apk_response = service.edits().apks().upload(
        editId=edit_id,
        packageName=package_name,
        media_body=apk_file).execute()
      print 'Version code %d has been uploaded. Filename "%s" edit_id %s' % (apk_response['versionCode'], apk_file, edit_id)

      listing_response = service.edits().apklistings().update(
        editId=edit_id, packageName=package_name, language='en-US',
        apkVersionCode=apk_response['versionCode'],
        body={'recentChanges': 'Apk recent changes in en-US'}).execute()

      print ('Listing for language %s was updated.'
             % listing_response['language'])
      versions.append(apk_response['versionCode'])

    except client.AccessTokenRefreshError:
      print ('The credentials have been revoked or expired, please re-run the '
           'application to re-authorize')

  track_response = service.edits().tracks().update(
      editId=edit_id,
      track=TRACK,
      packageName=package_name,
      body={u'versionCodes': versions}).execute()

  commit_request = service.edits().commit(
    editId=edit_id, packageName=package_name).execute()

Maybe this could be proposed as an example.

from android-play-publisher-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.