lib/spaceship/portal/provisioning_profile.rb in spaceship-0.25.1 vs lib/spaceship/portal/provisioning_profile.rb in spaceship-0.26.0
- old
+ new
@@ -191,12 +191,13 @@
# only work for development profiles
# @param devices (Array) (optional): An array of Device objects that should be used in this profile.
# It is recommend to not pass devices as spaceship will automatically add all devices for AdHoc
# and Development profiles and add none for AppStore and Enterprise Profiles
# @param mac (Bool) (optional): Pass true if you're making a Mac provisioning profile
+ # @param sub_platform (String) Used to create tvOS profiles at the moment. Value should equal 'tvOS' or nil.
# @return (ProvisioningProfile): The profile that was just created
- def create!(name: nil, bundle_id: nil, certificate: nil, devices: [], mac: false)
+ def create!(name: nil, bundle_id: nil, certificate: nil, devices: [], mac: false, sub_platform: nil)
raise "Missing required parameter 'bundle_id'" if bundle_id.to_s.empty?
raise "Missing required parameter 'certificate'. e.g. use `Spaceship::Certificate::Production.all.first`" if certificate.to_s.empty?
app = Spaceship::App.find(bundle_id, mac: mac)
raise "Could not find app with bundle id '#{bundle_id}'" unless app
@@ -215,22 +216,25 @@
if devices.nil? or devices.count == 0
if self == Development or self == AdHoc
# For Development and AdHoc we usually want all compatible devices by default
if mac
devices = Spaceship::Device.all_macs
+ elsif sub_platform == 'tvOS'
+ devices = Spaceship::Device.all_apple_tvs
else
- devices = Spaceship::Device.all_for_profile_type(self.type)
+ devices = Spaceship::Device.all_ios_profile_devices
end
end
end
profile = client.with_retry do
client.create_provisioning_profile!(name,
self.type,
app.app_id,
certificate_parameter,
devices.map(&:id),
- mac: mac)
+ mac: mac,
+ sub_platform: sub_platform)
end
self.new(profile)
end