Skip to content

Commit

Permalink
added support for app_token on Testflight SDK 1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenfonseca committed Jan 28, 2013
1 parent 0139082 commit af4dc30
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/motion/project/testflight.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
end

class TestFlightConfig
attr_accessor :sdk, :api_token, :team_token, :distribution_lists, :notify
attr_accessor :sdk, :api_token, :team_token, :app_token, :distribution_lists, :notify

def initialize(config)
@config = config
Expand All @@ -48,8 +48,13 @@ def team_token=(team_token)
create_launcher
end

def app_token=(app_token)
@app_token = app_token
create_launcher if team_token
end

def inspect
{:sdk => sdk, :api_token => api_token, :team_token => team_token, :distribution_lists => distribution_lists}.inspect
{:sdk => sdk, :api_token => api_token, :team_token => team_token, :app_token => app_token, :distribution_lists => distribution_lists}.inspect
end

private
Expand All @@ -61,7 +66,7 @@ def create_launcher
if Object.const_defined?('TestFlight') and !UIDevice.currentDevice.model.include?('Simulator')
NSNotificationCenter.defaultCenter.addObserverForName(UIApplicationDidBecomeActiveNotification, object:nil, queue:nil, usingBlock:lambda do |notification|
TestFlight.takeOff('#{team_token}')
TestFlight.takeOff('#{app_token || team_token}')
end)
end
EOF
Expand Down

0 comments on commit af4dc30

Please sign in to comment.