Skip to content

Commit

Permalink
Merge pull request HipByte#15 from rubenfonseca/master
Browse files Browse the repository at this point in the history
add support for app_token on SDK >= 1.2
  • Loading branch information
Watson1978 committed Mar 17, 2013
2 parents 0139082 + 01dcb6f commit 1dbc71f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
9 changes: 9 additions & 0 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ SDK and be submitted to the TestFlight platform.

You can retrieve the values for +api_token+ and +team_token+ in your TestFlight account page.

If you're using Testflight 1.2 or above, you should also add the app_token.

# ...
app.testflight do
# ...

app.testflight.app_token = '<insert your APP token here>'
end

4. (Optional) You can also set up distribution lists, if needed.

Motion::Project::App.setup do |app|
Expand Down
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 1dbc71f

Please sign in to comment.