Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

App id features #104

Closed
wants to merge 2 commits into from

1 participant

@nik-peev

The JSON containing the appID service state seems to have changed, since the last implementation. THe new code tries to make sense of the new structure of the JSON object. Currently the only service that seems to have the "Configurable" state seems to be the Push Notification, so the code only handles that case. Also I could not simulate the "Unavailable" state, se respectively such state would most probably not be shown correctly if it exists.

nik-peev added some commits
@nik-peev nik-peev Update agent.rb
AppID features states "Enabled/Configurable" determined from the JSON
12756da
@nik-peev nik-peev Properties handled differently 3221baf
@nik-peev nik-peev closed this
@nik-peev nik-peev deleted the nik-peev:App-ID-features branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 9, 2014
  1. @nik-peev

    Update agent.rb

    nik-peev authored
    AppID features states "Enabled/Configurable" determined from the JSON
  2. @nik-peev
This page is out of date. Refresh to see the latest.
View
26 lib/cupertino/provisioning_portal/agent.rb
@@ -271,14 +271,32 @@ def list_app_ids
app_id.development_properties, app_id.distribution_properties = [], []
row['features'].each do |feature, value|
if value == true
- app_id.development_properties << feature
- elsif value.kind_of?(String) && !value.empty?
- app_id.development_properties << "#{feature}: #{value}"
+ if feature == "push"
+ if row['isDevPushEnabled'] == true
+ app_id.development_properties << "push:Enabled"
+ else
+ app_id.development_properties << "push:Configurable"
+ end
+ else
+ app_id.development_properties << "#{feature}:Enabled"
+ end
+ end
+
end
end
row['enabledFeatures'].each do |feature|
- app_id.distribution_properties << feature
+ if feature == "push"
+ if row['isDevPushEnabled'] == true
+ app_id.development_properties << "push:Enabled"
+ else
+ app_id.development_properties << "push:Configurable"
+ end
+ else
+ app_id.development_properties << "#{feature}:Enabled"
+ end
+ end
+
end
app_ids << app_id
View
3  lib/cupertino/provisioning_portal/commands/app_ids.rb
@@ -21,7 +21,8 @@
row = [app_id.bundle_seed_id, app_id.description]
[app_id.development_properties, app_id.distribution_properties].each do |properties|
values = []
- properties.each do |key, value|
+ properties.each do |property|
+ key,value = property.split(":")
color = COLORS_BY_PROPERTY_VALUES[value] || :reset
values << key.sub(/\:$/, "").send(color)
end
Something went wrong with that request. Please try again.