Giter Club home page Giter Club logo

app_store_connect's Introduction

App Store Connect for Ruby

CI/CD

A Ruby interface to the App Store Connect API

Installation

Add this line to your application's Gemfile:

gem 'app_store_connect'

And then execute:

$ bundle

Or install it yourself as:

$ gem install app_store_connect

Usage

AppStoreConnect.config = {
  issuer_id: 'issuer_id',
  key_id: 'key_id',
  private_key: File.read(File.new("/Path/AuthKey.p8"))
}

app_store_connect = AppStoreConnect::Client.new

app_store_connect.apps 
app_store_connect.app(id: '1234')
app_store_connect.builds(id: '1234')

Create Bundle ID

app_store_connect.create_bundle_id(
  name: 'Example', 
  identifier: 'com.kyledecot.Example', 
  platform: 'IOS'
) 

Sales Reports

app_store_connect.sales_reports(
  filter: {
    report_type: 'SALES',
    report_sub_type: 'SUMMARY',
    frequency: 'DAILY',
    vendor_number: '123456'
  }
)

Fetch All Devices

devices = app_store_connect.devices
puts JSON.pretty_generate(devices)

Register a New Device

created_device = app_store_connect.create_device(
    name: 'name',
    platform: 'IOS',
    udid: 'udid'
  )

puts JSON.pretty_generate(created_device)

Update an App Store Version

app_store_connect.update_app_store_version(
  id: '<app-store-version-id>', 
  version_string: '1.0'
)

Link a Build to an App Store Version

app_store_connect.update_app_store_version_build(
  id: '<app-store-version-id>', 
  build_id: '<build-id>'
)

Create a Review Submission Item

app_store_connect.create_review_submission_item(
  relationships: {
    reviewSubmission: {
      data: {
        id: '<review-submission-id>', 
        type: 'reviewSubmissions'
      }
    },
    appStoreVersion: {
      data: {
        id: '<app-store-version-id>', 
        type: 'appStoreVersions'
      }
    }
  }
)

Create In-App Purchase Price Schedule

app_store_connect.create_in_app_purchase_price_schedule(
  relationships: {
    manual_prices: {
      data: [
        {
          type: 'inAppPurchasePrices',
          id: '${price1}'
        }
      ]
    },
    in_app_purchase: {
      data: {
        type: 'inAppPurchases',
        id: '<in-app-purchase-id>'
      }
    }
  }, 
  included: [
    {
      type: 'inAppPurchasePrices',
      id: '${price1}',
      attributes: {
        startDate: nil
      },
      relationships: {
        inAppPurchaseV2: {
          data: {
            type: 'inAppPurchases',
            id: '<in-app-purchase-id>'
          }
        },
        inAppPurchasePricePoint: {
          data: {
            type: 'inAppPurchasePricePoints',
            id: '<price-point-id>'
          }
        }
      }
    }
  ]
)

Add or remove access for a Beta Group to a Build

app_store_connect.add_build_beta_groups(
  id: '<build-id>', 
  data: [{id: '<beta-group-id>'}]
)

app_store_connect.delete_build_beta_groups(
  id: '<build-id>', 
  data: [{id: '<beta-group-id>'}]
)

FAQ

How to understand the devices, sales_reports, create_bundle_id keyword seen in the demo?

It's function key from schema.json file.

How to understand () in the demo, and when should use it? eg: create_bundle_id(), sales_reports()

() is mean: you have mapped to http_body_type in file schema.json

How to set this content in ()

http_body_type have a value type. Based on this value, we can find the definition of the relevant configuration in the source code of ruby.

How to include related resources?

app_store_connect.in_app_purchase(id: 123, include: 'appStoreReviewScreenshot,pricePoints')

How to filter fields?

app_store_connect.in_app_purchase(id: 123, fields: 'name,productId')

Development

After checking out the repo, run bundle install to install dependencies. Then, run rake spec to run the tests. You can also run rake console for an interactive prompt that will allow you to experiment.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/kyledecot/app_store_connect.

License

The gem is available as open source under the terms of the MIT License.

app_store_connect's People

Contributors

addbrick avatar bejczib avatar coreycarvalho avatar darbyfrey avatar dependabot[bot] avatar gregg-platogo avatar kyledecot avatar pranav-g10 avatar rbbtsn0w avatar rishatshamsutdinov avatar tmarkanov avatar zormandi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

app_store_connect's Issues

Update what's new text

Thanks a lot. This is useful to me.
I am a iOS developer, and my app has a lot of localization, I need to select all languages and fill in the 'what's new' for each update, which bothers me a lot.

Help!

How does use it?

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

/opt/homebrew/lib/ruby/gems/3.1.0/gems/app_store_connect-0.27.0/lib/app_store_connect/client/authorization.rb:18:inread': Could not parse PKey: no start line (OpenSSL::PKey::PKeyError)
from /opt/homebrew/lib/ruby/gems/3.1.0/gems/app_store_connect-0.27.0/lib/app_store_connect/client/authorization.rb:18:in initialize' from /opt/homebrew/lib/ruby/gems/3.1.0/gems/app_store_connect-0.27.0/lib/app_store_connect/client.rb:18:in new'
from /opt/homebrew/lib/ruby/gems/3.1.0/gems/app_store_connect-0.27.0/lib/app_store_connect/client.rb:18:in initialize'

Describe the solution you'd like
A clear and concise description of what you want to happen.

the example has friendly to us?

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Key Not Found :schema

Describe the bug
/gems/app_store_connect-0.16.0/lib/app_store_connect/client/registry.rb:11:in `fetch': [!] key not found: :schema (KeyError)

To Reproduce
Steps to reproduce the behavior:

        AppStoreConnect.config = {
          issuer_id: issuer_id,
          key_id: key_id,
          private_key: api_key
        }
        app_store_connect = AppStoreConnect::Client.new

Expected behavior
Initiailise a new Client object

Screenshots

Desktop (please complete the following information):

  • OS: Mac OS 10.14.5
  • Ruby: 2.6.3

Smartphone (please complete the following information):

Additional context

Next release

Hi @kyledecot!

Since it's been quite some time since the last release, could you please create a new release?
It includes some changes that we'd quite like to use so we'd greatly appreciate it if you could do this :)

Can we remove tracking?

Hi,

This is more of a question rather than a feature request. We've added some more endpoints (phased release management, update build) to our fork of the project but for security compliance reasons we had to remove the dependency on MixPanel (even though we see that its use can be disabled). Would you be interested in merging this change? If yes then I can quickly open a PR for it. If not then that's a bit more complicated. We'd still love to contribute but it's going to be a problem repeating all of our PRs in both projects. ๐Ÿ˜ž

Thanks,
Z

Every request results in an exception

Describe the bug
Followed the README.md

AppStoreConnect.config = {
          issuer_id: ENV["XCC_ISSUER_ID"],
          key_id: ENV["XCC_PRIVATE_KEY_ID"],
          private_key: ENV["XCC_PRIVATE_KEY"]
        }
client = AppStoreConnect::Client.new
pp client.apps

and of course filled in env variables. The call (and every other method I call on client) results in

/Users/Kassi/.asdf/installs/ruby/3.2.2/lib/ruby/3.2.0/net/http/generic_request.rb:17:in `initialize': not an HTTP URI (ArgumentError)

      raise ArgumentError, "not an HTTP URI" unless URI::HTTP === uri_or_path
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	from /Users/Kassi/.asdf/installs/ruby/3.2.2/lib/ruby/3.2.0/net/http/request.rb:38:in `initialize'
	from /Users/Kassi/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/app_store_connect-0.38.0/lib/app_store_connect/request.rb:89:in `new'
	from /Users/Kassi/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/app_store_connect-0.38.0/lib/app_store_connect/request.rb:89:in `request'
	from /Users/Kassi/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/app_store_connect-0.38.0/lib/app_store_connect/request.rb:20:in `block in execute'
	from /Users/Kassi/.asdf/installs/ruby/3.2.2/lib/ruby/3.2.0/net/http.rb:1238:in `start'
	from /Users/Kassi/.asdf/installs/ruby/3.2.2/lib/ruby/3.2.0/net/http.rb:687:in `start'
	from /Users/Kassi/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/app_store_connect-0.38.0/lib/app_store_connect/request.rb:19:in `execute'
	from /Users/Kassi/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/app_store_connect-0.38.0/lib/app_store_connect/base.rb:40:in `call'
	from /Users/Kassi/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/app_store_connect-0.38.0/lib/app_store_connect/base.rb:20:in `method_missing'

Expected behavior
Code should list all apps and not break.

Desktop (please complete the following information):

  • OS: macOS 14.4.1
  • Ruby: 3.2.2
  • Gem version: 0.38.0

Additional context
I tried to debug until generic_request.rb and the uri that is passed is an instance of URI::Generic.
I added the following into generic_request.rb at line 17:

pp uri_or_path
pp uri_or_path === URI::Generic
pp uri_or_path === URI::HTTP
pp uri_or_path === URI::HTTPS

and the result is

#<URI::Generic https://api.appstoreconnect.apple.com/v1/apps?>
false
false
false

which is somehow strange and I wonder how this will ever work.

I appreciate every clue on what's going on here.

Ruby 2.7 compatibility

Hi,

Is your feature request related to a problem? Please describe.

We're just starting to use your gem in our project which still runs on Ruby 2.7. I see that in your last commit you set the required Ruby version to >= 3.1 which obviously won't work for us. Going through the commit (at a quick glance) I think the only feature you're using that requires 3.1 is the hash value omission and not using that would be a very small price to pay for keeping this gem usable to folks on older Ruby versions.

Describe the solution you'd like

Would you be okay with us creating a PR for Ruby 2.7 compatibility?

require 'app_store_connect' failed

Describe the bug
Create a test.rb, only require app_store_connect as below:

require 'app_store_connect'

To Reproduce
Steps to reproduce the behavior:

  1. create test.rb, only include "require 'app_store_connect'"
  2. ruby test.rb
  3. error occur as below:

/Library/Ruby/Gems/2.3.0/gems/app_store_connect-0.14.0/lib/app_store_connect/object/attributes.rb:22:in block (2 levels) in <module:Attributes>': private method define_method' called for #Class:0x00007fe4122c1570 (NoMethodError)
Did you mean? define_singleton_method
redefine_method
from /Library/Ruby/Gems/2.3.0/gems/app_store_connect-0.14.0/lib/app_store_connect/object/attributes.rb:19:in initialize' from /Library/Ruby/Gems/2.3.0/gems/app_store_connect-0.14.0/lib/app_store_connect/object/attributes.rb:19:in new'
from /Library/Ruby/Gems/2.3.0/gems/app_store_connect-0.14.0/lib/app_store_connect/object/attributes.rb:19:in block in <module:Attributes>' from /Library/Ruby/Gems/2.3.0/gems/activesupport-4.2.10/lib/active_support/concern.rb:120:in class_eval'
from /Library/Ruby/Gems/2.3.0/gems/activesupport-4.2.10/lib/active_support/concern.rb:120:in append_features' from /Library/Ruby/Gems/2.3.0/gems/app_store_connect-0.14.0/lib/app_store_connect/object/data.rb:14:in include'
from /Library/Ruby/Gems/2.3.0/gems/app_store_connect-0.14.0/lib/app_store_connect/object/data.rb:14:in block (2 levels) in <module:Data>' from /Library/Ruby/Gems/2.3.0/gems/app_store_connect-0.14.0/lib/app_store_connect/object/data.rb:13:in initialize'
from /Library/Ruby/Gems/2.3.0/gems/app_store_connect-0.14.0/lib/app_store_connect/object/data.rb:13:in new' from /Library/Ruby/Gems/2.3.0/gems/app_store_connect-0.14.0/lib/app_store_connect/object/data.rb:13:in block in module:Data'
from /Library/Ruby/Gems/2.3.0/gems/activesupport-4.2.10/lib/active_support/concern.rb:120:in class_eval' from /Library/Ruby/Gems/2.3.0/gems/activesupport-4.2.10/lib/active_support/concern.rb:120:in append_features'
from /Library/Ruby/Gems/2.3.0/gems/app_store_connect-0.14.0/lib/app_store_connect/create_request.rb:6:in include' from /Library/Ruby/Gems/2.3.0/gems/app_store_connect-0.14.0/lib/app_store_connect/create_request.rb:6:in inherited'
from /Library/Ruby/Gems/2.3.0/gems/app_store_connect-0.14.0/lib/app_store_connect/bundle_id_create_request.rb:6:in <module:AppStoreConnect>' from /Library/Ruby/Gems/2.3.0/gems/app_store_connect-0.14.0/lib/app_store_connect/bundle_id_create_request.rb:5:in <top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require'
from /Library/Ruby/Gems/2.3.0/gems/app_store_connect-0.14.0/lib/app_store_connect.rb:10:in <top (required)>' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in rescue in require' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:39:in require'
from test.rb:2:in `

'

require 'app_store_connect' is not working

Describe the bug
When I'm getting a exception when I try to require

To Reproduce
Run the follow:
require 'app_store_connect'

Expected behavior

irb(main):008:0> require "app_store_connect"
Traceback (most recent call last):
       16: from /Users/jonatasteixeira/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/app_store_connect-0.20.0/lib/app_store_connect/client.rb:3:in `<top (required)>'
       15: from /Users/jonatasteixeira/.rbenv/versions/2.7.1/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
       14: from /Users/jonatasteixeira/.rbenv/versions/2.7.1/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
       13: from /Users/jonatasteixeira/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activesupport-4.2.11.1/lib/active_support/all.rb:3:in `<top (required)>'
       12: from /Users/jonatasteixeira/.rbenv/versions/2.7.1/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
       11: from /Users/jonatasteixeira/.rbenv/versions/2.7.1/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
       10: from /Users/jonatasteixeira/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activesupport-4.2.11.1/lib/active_support/core_ext.rb:1:in `<top (required)>'
        9: from /Users/jonatasteixeira/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activesupport-4.2.11.1/lib/active_support/core_ext.rb:1:in `each'
        8: from /Users/jonatasteixeira/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activesupport-4.2.11.1/lib/active_support/core_ext.rb:2:in `block in <top (required)>'
        7: from /Users/jonatasteixeira/.rbenv/versions/2.7.1/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
        6: from /Users/jonatasteixeira/.rbenv/versions/2.7.1/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
        5: from /Users/jonatasteixeira/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activesupport-4.2.11.1/lib/active_support/core_ext/object.rb:3:in `<top (required)>'
        4: from /Users/jonatasteixeira/.rbenv/versions/2.7.1/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
        3: from /Users/jonatasteixeira/.rbenv/versions/2.7.1/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
        2: from /Users/jonatasteixeira/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activesupport-4.2.11.1/lib/active_support/core_ext/object/duplicable.rb:106:in `<top (required)>'
        1: from /Users/jonatasteixeira/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activesupport-4.2.11.1/lib/active_support/core_ext/object/duplicable.rb:111:in `<class:BigDecimal>'
NoMethodError (undefined method `new' for BigDecimal:Class)

Environment (please complete the following information):

  • OS: MacOS 10.14.6
  • Ruby 2.7.1
  • Rbenv 1.1.2

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.