spaceship/lib/spaceship/tunes/tunes_client.rb in fastlane-2.52.0 vs spaceship/lib/spaceship/tunes/tunes_client.rb in fastlane-2.53.0.beta.20170810010003

- old
+ new

@@ -208,11 +208,11 @@ # @param version *DEPRECATED: Use `Spaceship::Tunes::Application.ensure_version!` method instead* # (String): The version number is shown on the App Store and should match the one you used in Xcode. # @param sku (String): A unique ID for your app that is not visible on the App Store. # @param bundle_id (String): The bundle ID must match the one you used in Xcode. It # can't be changed after you submit your first build. - def create_application!(name: nil, primary_language: nil, version: nil, sku: nil, bundle_id: nil, bundle_id_suffix: nil, company_name: nil, platform: nil) + def create_application!(name: nil, primary_language: nil, version: nil, sku: nil, bundle_id: nil, bundle_id_suffix: nil, company_name: nil, platform: nil, itunes_connect_users: nil) puts "The `version` parameter is deprecated. Use `Spaceship::Tunes::Application.ensure_version!` method instead" if version # First, we need to fetch the data from Apple, which we then modify with the user's values primary_language ||= "English" platform ||= "ios" @@ -230,9 +230,14 @@ data['companyName'] = { value: company_name } if company_name data['enabledPlatformsForCreation'] = { value: [platform] } data['initialPlatform'] = platform data['enabledPlatformsForCreation'] = { value: [platform] } + + unless itunes_connect_users.nil? + data['iTunesConnectUsers']['grantedAllUsers'] = false + data['iTunesConnectUsers']['grantedUsers'] = data['iTunesConnectUsers']['availableUsers'].select { |user| itunes_connect_users.include? user['username'] } + end # Now send back the modified hash r = request(:post) do |req| req.url 'ra/apps/create/v2' req.body = data.to_json