From 861557fb3ce52f29099f0b24e8585f5f918cf497 Mon Sep 17 00:00:00 2001 From: "snow.wu" Date: Thu, 27 Oct 2022 15:40:17 +0800 Subject: [PATCH 1/5] Update README.md fix #119 this case --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index af9f3f2..d667922 100644 --- a/README.md +++ b/README.md @@ -23,9 +23,9 @@ Or install it yourself as: ```ruby AppStoreConnect.config = { - issuer_id: issuer_id, - key_id: key_id, - private_key: private_key + issuer_id: 'issuer_id', + key_id: 'key_id', + private_key: File.read(File.new("/Path/AuthKey_.p8")) } app_store_connect = AppStoreConnect::Client.new From 44beef20cf4aa4653adc68791f58afa925bec46b Mon Sep 17 00:00:00 2001 From: "snow.wu" Date: Thu, 27 Oct 2022 16:28:38 +0800 Subject: [PATCH 2/5] Update README.md add fetch all devices demo --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index d667922..7acce02 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,15 @@ app_store_connect.sales_reports( ) ``` +### Fetch All Devices + +```ruby + +fetchAllDevices = app_store_connect.devices +puts JSON.pretty_generate(fetchAllDevice) + +``` + ## 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. From 945eefe824722751bec2ecbc5ac053a63aa5791e Mon Sep 17 00:00:00 2001 From: "snow.wu" Date: Thu, 27 Oct 2022 17:11:08 +0800 Subject: [PATCH 3/5] Update README.md Add Q&A support --- README.md | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7acce02..1184fe6 100644 --- a/README.md +++ b/README.md @@ -7,21 +7,25 @@ A Ruby interface to the [App Store Connect API](https://developer.apple.com/app- Add this line to your application's Gemfile: -```ruby +```Ruby gem 'app_store_connect' ``` And then execute: - $ bundle +```Bash +$ bundle +``` Or install it yourself as: - $ gem install app_store_connect +```Bash +$ gem install app_store_connect +``` ## Usage -```ruby +```ruby AppStoreConnect.config = { issuer_id: 'issuer_id', key_id: 'key_id', @@ -67,6 +71,20 @@ puts JSON.pretty_generate(fetchAllDevice) ``` +## Q&A + +### 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? + +`{}` 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. + ## 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. From b0f30081c68bba00d8dc7884663748aa5fb1a89e Mon Sep 17 00:00:00 2001 From: "snow.wu" Date: Thu, 27 Oct 2022 17:11:44 +0800 Subject: [PATCH 4/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1184fe6..b4890af 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ $ gem install app_store_connect AppStoreConnect.config = { issuer_id: 'issuer_id', key_id: 'key_id', - private_key: File.read(File.new("/Path/AuthKey_.p8")) + private_key: File.read(File.new("/Path/AuthKey.p8")) } app_store_connect = AppStoreConnect::Client.new From bd89c2f0b1ad53ee1f83027fc77177a843dcf4ca Mon Sep 17 00:00:00 2001 From: "snow.wu" Date: Thu, 27 Oct 2022 19:22:22 +0800 Subject: [PATCH 5/5] Update README.md --- README.md | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b4890af..d66c847 100644 --- a/README.md +++ b/README.md @@ -71,17 +71,30 @@ puts JSON.pretty_generate(fetchAllDevice) ``` +### Register a New Device + +```ruby +result = app_store_connect.create_device( + name: 'name', + platform: 'IOS', + udid: 'udid' + ) + +puts JSON.pretty_generate(result) +``` + + ## Q&A ### 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? +### 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` +`()` is mean: you have mapped to `http_body_type` in file `schema.json` -### How to set this content in `{}` +### 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.