Sha256: 64a4c12e4d0775e5ee8fb9bbdd2231f69cbc304c4fa299f4e2076e3c0fb506dd

Contents?: true

Size: 1.9 KB

Versions: 193

Compression:

Stored size: 1.9 KB

Contents

module Spaceship
  module Tunes
    class IAPFamilies < TunesBase
      # @return (Spaceship::Tunes::Application) A reference to the application
      attr_accessor :application

      # Create a new Purchase Family
      # a freshly created family has to have atleast one product.
      # the product will be created, and versions/pricing_intervals and so on
      # should be set by subsequent edit.
      # @param name (String) Familyname
      # @param product_id (String) New Product's id
      # @param reference_name (String) Reference name of the new product
      # @param versions (Hash) Localized Familie names
      # @example
      #  versions: {
      #  'de-DE': {
      #    subscription_name: "Subname German",
      #    name: 'App Name German',
      #  },
      #  'da': {
      #    subscription_name: "Subname DA",
      #    name: 'App Name DA',
      #  }
      # }

      def create!(name: nil, product_id: nil, reference_name: nil, versions: {})
        versions_array = []
        versions.each do |language_code, value|
          versions_array << {
                    value: {
                      subscriptionName: { value: value[:subscription_name] },
                      name: { value: value[:name] },
                      localeCode: { value: language_code.to_s }
                    }
          }
        end
        client.create_iap_family(app_id: self.application.apple_id, name: name, product_id: product_id, reference_name: reference_name, versions: versions_array)
      end

      # returns a list of all families
      def all
        r = client.iap_families(app_id: self.application.apple_id)
        return_families = []
        r.each do |family|
          attrs = family
          attrs[:application] = self.application
          loaded_family = Tunes::IAPFamilyList.factory(attrs)
          return_families << loaded_family
        end
        return_families
      end
    end
  end
end

Version data entries

193 entries across 193 versions & 1 rubygems

Version Path
fastlane-2.74.0.beta.20180106010004 spaceship/lib/spaceship/tunes/iap_families.rb
fastlane-2.73.0 spaceship/lib/spaceship/tunes/iap_families.rb
fastlane-2.73.0.beta.20180105010003 spaceship/lib/spaceship/tunes/iap_families.rb
fastlane-2.73.0.beta.20180104010004 spaceship/lib/spaceship/tunes/iap_families.rb
fastlane-2.73.0.beta.20180103010003 spaceship/lib/spaceship/tunes/iap_families.rb
fastlane-2.72.0 spaceship/lib/spaceship/tunes/iap_families.rb
fastlane-2.72.0.beta.20180102010003 spaceship/lib/spaceship/tunes/iap_families.rb
fastlane-2.72.0.beta.20180101010003 spaceship/lib/spaceship/tunes/iap_families.rb
fastlane-2.72.0.beta.20171231010003 spaceship/lib/spaceship/tunes/iap_families.rb
fastlane-2.71.1 spaceship/lib/spaceship/tunes/iap_families.rb
fastlane-2.72.0.beta.20171230010003 spaceship/lib/spaceship/tunes/iap_families.rb
fastlane-2.72.0.beta.20171229010003 spaceship/lib/spaceship/tunes/iap_families.rb
fastlane-2.72.0.beta.20171228010004 spaceship/lib/spaceship/tunes/iap_families.rb
fastlane-2.71.0 spaceship/lib/spaceship/tunes/iap_families.rb
fastlane-2.71.0.beta.20171227010004 spaceship/lib/spaceship/tunes/iap_families.rb
fastlane-2.71.0.beta.20171226010004 spaceship/lib/spaceship/tunes/iap_families.rb
fastlane-2.71.0.beta.20171225010003 spaceship/lib/spaceship/tunes/iap_families.rb
fastlane-2.71.0.beta.20171224010003 spaceship/lib/spaceship/tunes/iap_families.rb
fastlane-2.71.0.beta.20171223010003 spaceship/lib/spaceship/tunes/iap_families.rb
fastlane-2.71.0.beta.20171222010003 spaceship/lib/spaceship/tunes/iap_families.rb