class Spaceship::Tunes::AppSubmission

Represents a submission for review of an App Store Connect Application This class handles the submission of all review information and documents

Attributes

add_id_info_limits_tracking[RW]

@deprecated Setted automatically by add_id_info_uses_idfa usage @return (Boolean) Ad ID Info - Limits ads tracking DEPRECATED: Use add_id_info_uses_idfa instead.

add_id_info_serves_ads[RW]

@return (Boolean) Ad ID Info - Serves ads

add_id_info_tracks_action[RW]

@return (Boolean) Ad ID Info - Tracks actions

add_id_info_tracks_install[RW]

@return (Boolean) Ad ID Info - Tracks installs

add_id_info_uses_idfa[RW]

@return (Boolean) Ad ID Info - Uses idfa

application[RW]

@return (Spaceship::Tunes::Application) A reference to the application

this submission is for
content_rights_contains_third_party_content[RW]

@return (Boolean) Content Rights - Contains third party content

content_rights_has_rights[RW]

@return (Boolean) Content Rights - Has rights of content

export_compliance_app_type[RW]

@return (String) Export Compliance - App type

export_compliance_available_on_french_store[RW]

@return (Boolean) Export Compliance - Available on French Store

export_compliance_ccat_file[RW]

@return (Not Yet Implemented) Export Compliance - CCAT File

export_compliance_compliance_required[RW]

@return (Boolean) Export Compliance - Compliance Required

export_compliance_contains_proprietary_cryptography[RW]

@return (Boolean) Export Compliance - Contains proprietary cryptography

export_compliance_contains_third_party_cryptography[RW]

@return (Boolean) Export Compliance - Contains third-party cryptography

export_compliance_encryption_updated[RW]

@return (Boolean) Export Compliance - Encryption Updated

export_compliance_is_exempt[RW]

@return (Boolean) Export Compliance - Is exempt

export_compliance_platform[RW]

@return (String) Export Compliance - Platform

export_compliance_uses_encryption[RW]

@return (Boolean) Export Compliance - Uses encryption

platform[RW]

@return (String) The platform of the device. This is usually “ios” @example

"appletvos"
submitted_for_review[RW]

@return (Boolean) Submitted for Review

version[RW]

@return (AppVersion) The version to use for this submission

Private Class Methods

create(application, version, platform: nil) click to toggle source

@param application (Spaceship::Tunes::Application) The app this submission is for

# File spaceship/lib/spaceship/tunes/app_submission.rb, line 123
def create(application, version, platform: nil)
  attrs = client.prepare_app_submissions(application.apple_id, application.edit_version(platform: platform).version_id)
  attrs[:application] = application
  attrs[:version] = version
  attrs[:platform] = platform

  return self.factory(attrs)
end
factory(attrs) click to toggle source

Create a new object based on a hash. This is used to create a new object based on the server response.

# File spaceship/lib/spaceship/tunes/app_submission.rb, line 105
def factory(attrs)
  # fill content rights section if iTC returns nil
  if attrs["contentRights"].nil?
    attrs["contentRights"] = {
      "containsThirdPartyContent" => {
        "value" => nil
      },
      "hasRights" => {
        "value" => nil
      }
    }
  end

  obj = self.new(attrs)
  return obj
end

Private Instance Methods

complete!() click to toggle source

Save and complete the app submission

# File spaceship/lib/spaceship/tunes/app_submission.rb, line 134
def complete!
  raw_data_clone = raw_data.dup
  if self.content_rights_has_rights.nil? || self.content_rights_contains_third_party_content.nil?
    raw_data_clone.set(["contentRights"], nil)
  end
  raw_data_clone.delete(:version)
  raw_data_clone.delete(:application)

  # Check whether the application makes use of IDFA or not
  # and automatically set the mandatory limitsTracking value in the request JSON accordingly.
  if !self.add_id_info_uses_idfa.nil? && self.add_id_info_uses_idfa == true
    # Application uses IDFA, before sending for submission limitsTracking key in the request JSON must be set to true (agreement).
    raw_data_clone.set(
      ["adIdInfo", "limitsTracking", "value"],
      true
    )
  end

  client.send_app_submission(application.apple_id, application.edit_version(platform: platform).version_id, raw_data_clone)
  @submitted_for_review = true
end
setup() click to toggle source
# File spaceship/lib/spaceship/tunes/app_submission.rb, line 156
def setup
  @submitted_for_review = false
end