This repository has been archived by the owner on Nov 19, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/KrauseFx/deliver
- Loading branch information
Showing
5 changed files
with
152 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
require 'open-uri' | ||
|
||
module Deliver | ||
# For all the information reading (e.g. version number) | ||
class ItunesConnect < FastlaneCore::ItunesConnect | ||
ALL_INFORMATION_URL = "https://itunesconnect.apple.com/WebObjects/iTunesConnect.woa/ra/apps/version/" | ||
|
||
# This method will download information for a given app | ||
# @param app (Deliver::App) the app you want this information from | ||
# @raise [ItunesConnectGeneralError] General error while executing | ||
# this action | ||
# @raise [ItunesConnectLoginError] Login data is wrong | ||
def get_app_information(app) | ||
begin | ||
verify_app(app) | ||
|
||
url = ALL_INFORMATION_URL + app.apple_id.to_s | ||
|
||
# Turn off/on the async mode of jQuery | ||
evaluate_script("jQuery.ajaxSetup({async:false});") | ||
response = evaluate_script("$.get('#{url}').responseText") | ||
evaluate_script("jQuery.ajaxSetup({async:true});") | ||
|
||
raise "Could not fetch data for app" unless response | ||
|
||
data = JSON.parse(response) | ||
|
||
return data['data'] | ||
rescue Exception => ex | ||
error_occured(ex) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters