Skip to content

Instantly share code, notes, and snippets.

@wata
Created August 7, 2020 07:27
Show Gist options
  • Save wata/016185cc5ff706d9d40c3467937b3e4f to your computer and use it in GitHub Desktop.
Save wata/016185cc5ff706d9d40c3467937b3e4f to your computer and use it in GitHub Desktop.
Get TestFlight Feedback
lane :testflight_feedback do
fastlane_require 'spaceship'
Spaceship::Tunes.login
Spaceship::Tunes.select_team
app = Spaceship::ConnectAPI::App.find(ENV["TEST_APP_BUNDLE"])
buffer = []
feedbacks = app.get_beta_feedback
feedbacks.each do |feedback|
next unless Date.parse(feedback.timestamp) == Date.today.prev_day
buffer << ""
buffer << "comment: #{feedback.comment}"
buffer << "name: #{feedback.tester.first_name} #{feedback.tester.last_name}"
buffer << "device model: #{feedback.device_model}"
buffer << "os version: #{feedback.os_version}"
buffer << "build: #{feedback.build.version}"
buffer << "timestamp: #{feedback.timestamp}"
feedback.screenshots.each do |screenshot|
# screenshot.image_assets is an array of different resolults of a screenshots
image_asset = screenshot.image_assets.first
buffer << ""
buffer << "\turl: #{image_asset["url"]}"
buffer << "\twidth: #{image_asset["width"]}"
buffer << "\theight: #{image_asset["height"]}"
end
end
if buffer.empty?
slack(
message: "No TestFlight Feedback",
default_payloads: []
)
else
slack(
message: buffer.join("\n"),
success: false,
default_payloads: []
)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment