Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[spaceship] get app info categories easier #16741

Merged
merged 1 commit into from
Jul 3, 2020

Conversation

joshdholtz
Copy link
Member

Motivation and Context

Fixes #16649 (comment) mentioned by @squallstar

Description

  • Adds relationships for all categories on app info
  • Adds essential includes when fetching app info to also get categories

Testing Steps

lane :test do
  require 'pp'
  require 'spaceship'

  Spaceship::Tunes.login(email)
  Spaceship::Tunes.select_team(team_name: team_name)

  # Gets app
  app = Spaceship::ConnectAPI::App.find(bundle_id)

  # Gets app info and includes relationships to all categories
  app_info = app.fetch_edit_app_info

  puts "PRIMARY"
  pp app_info.primary_category
  puts "\nPRIMARY SUB 1"
  pp app_info.primary_subcategory_one
  puts "\nPRIMARY SUB 2"
  pp app_info.primary_subcategory_one
  puts "\SECONDARY"
  pp app_info.secondary_category
  puts "\SECONDARY SUB 1"
  pp app_info.secondary_subcategory_one
  puts "\SECONDARY SUB 2"
  pp app_info.secondary_subcategory_one
end

@squallstar
Copy link

@joshdholtz what about primary_locale_code, available_primary_locale_codes and languages? These were available in the previous version of the library.

@joshdholtz
Copy link
Member Author

I will look after lunch 🙂

@joshdholtz
Copy link
Member Author

joshdholtz commented Jul 3, 2020

@squallstar

lane :test do
  require 'pp'
  require 'spaceship'

  Spaceship::Tunes.login(email)
  Spaceship::Tunes.select_team(team_name: team_name)

  app = Spaceship::ConnectAPI::App.find(bundle_id)
  app_info = app.fetch_edit_app_info

  # App
  puts "\nPRIMARY LOCALE"
  puts app.primary_locale

  # App Info
  puts "\nPRIMARY CATEGORY"
  pp app_info.primary_category
  puts "\nPRIMARY SUBCATEGORY 1"
  pp app_info.primary_subcategory_one
  puts "\nPRIMARY SUBCATEGORY 2"
  pp app_info.primary_subcategory_one
  puts "\SECONDARY CATEGORY"
  pp app_info.secondary_category
  puts "\SECONDARY SUBCATEGORY 1"
  pp app_info.secondary_subcategory_one
  puts "\SECONDARY SUBCATEGORY 2"
  pp app_info.secondary_subcategory_one

  # App Info Localizations
  puts "\nApp Info Localizations"
  app_info_localizations = app_info.get_app_info_localizations
  app_info_localizations.each do |app_info_localization|
    puts "\t#{app_info_localization.locale}"
  end

  # App Store Version
  puts "\Live Version Localizations"
  live_version = app.get_live_app_store_version
  if live_version
    # Version localizations
    version_localizations = live_version.get_app_store_version_localizations
    version_localizations.each do |version_localization|
      puts "\t#{version_localization.locale}"
    end
  else
    puts "No verson in live"
  end

  # App Store Version
  puts "\nEdit Version Localizations"
  edit_version = app.get_edit_app_store_version
  if edit_version
    # Version localizations
    version_localizations = edit_version.get_app_store_version_localizations
    version_localizations.each do |version_localization|
      puts "\t#{version_localization.locale}"
    end
  else
    puts "No verson in edit"
  end

@joshdholtz
Copy link
Member Author

I will docs next week explain all of this

@joshdholtz joshdholtz merged commit a6e8133 into master Jul 3, 2020
@joshdholtz joshdholtz deleted the joshdholtz-spaceship-get-categories-easier branch July 3, 2020 18:05
@fastlane-bot
Copy link

Hey @joshdholtz 👋

Thank you for your contribution to fastlane and congrats on getting this pull request merged 🎉
The code change now lives in the master branch, however it wasn't released to RubyGems yet.
We usually ship about once a week, and your PR will be included in the next one.

Please let us know if this change requires an immediate release by adding a comment here 👍
We'll notify you once we shipped a new release with your changes 🚀

Copy link

@fastlane-bot fastlane-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congratulations! 🎉 This was released as part of fastlane 2.150.2 🚀

minuscorp pushed a commit to minuscorp/fastlane that referenced this pull request Jul 18, 2020
@fastlane fastlane locked and limited conversation to collaborators Sep 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Produce fails to create app on AppStoreConnect with error Bundle ID already used
4 participants