Skip to content

Commit

Permalink
Adds identify_testers to config block
Browse files Browse the repository at this point in the history
This makes it possible to link crashes etc. to testers/devices in TestFlight.
  • Loading branch information
jeroenj authored and Watson1978 committed Mar 26, 2013
1 parent 1dbc71f commit cc8defd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ SDK and be submitted to the TestFlight platform.
app.testflight.api_token = '<insert your API token here>'
app.testflight.team_token = '<insert your team token here>'
app.testflight.notify = true # default is false
app.testflight.identify_testers = true # default is false
end
end
end
Expand Down
8 changes: 7 additions & 1 deletion 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, :app_token, :distribution_lists, :notify
attr_accessor :sdk, :api_token, :team_token, :app_token, :distribution_lists, :notify, :identify_testers

def initialize(config)
@config = config
Expand All @@ -53,6 +53,11 @@ def app_token=(app_token)
create_launcher if team_token
end

def identify_testers=(identify_testers)
@identify_testers = identify_testers
create_launcher
end

def inspect
{:sdk => sdk, :api_token => api_token, :team_token => team_token, :app_token => app_token, :distribution_lists => distribution_lists}.inspect
end
Expand All @@ -66,6 +71,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.setDeviceIdentifier(UIDevice.currentDevice.uniqueIdentifier)' if identify_testers}
TestFlight.takeOff('#{app_token || team_token}')
end)
end
Expand Down

0 comments on commit cc8defd

Please sign in to comment.