deliver/lib/deliver/runner.rb
# If App Store Connect API token, use token.
# If itc_provider was explicitly specified, use it.
# If there are multiple teams, infer the provider from the selected team name.
# If there are fewer than two teams, don't infer the provider.
If App Store Connect API token, use token.
If itc_provider was explicitly specified, use it.
If there are multiple teams, infer the provider from the selected team name.
If there are fewer than two teams, don't infer the provider.
If App Store Connect API token use token . If itc_provider was explicitly specified use it . If there are multiple teams infer the provider from the selected team name . If there are fewer than two teams don ' t infer the provider .
def transporter_for_selected_team
      api_token = Spaceship::ConnectAPI.token
      unless api_token.nil?
        api_token.refresh! if api_token.expired?
        return FastlaneCore::ItunesTransporter.new(nil, nil, false, nil, api_token.text)
      end
      tunes_client = Spaceship::ConnectAPI.client.tunes_client
      generic_transporter = FastlaneCore::ItunesTransporter.new(options[:username], nil, false, options[:itc_provider])
      return generic_transporter unless options[:itc_provider].nil? && tunes_client.teams.count > 1
      begin
        team = tunes_client.teams.find { |t| t['providerId'].to_s == tunes_client.team_id }
        name = team['name']
        provider_id = generic_transporter.provider_ids[name]
        UI.verbose("Inferred provider id #{provider_id} for team #{name}.")
        return FastlaneCore::ItunesTransporter.new(options[:username], nil, false, provider_id)
      rescue => ex
        UI.verbose("Couldn't infer a provider short name for team with id #{tunes_client.team_id} automatically: #{ex}. Proceeding without provider short name.")
        return generic_transporter
      end
    end
def transporter_for_selected_team api_token = Spaceship :: ConnectAPI . token unless api_token . nil? api_token . refresh! if api_token . expired? return FastlaneCore :: ItunesTransporter . new ( nil , nil , false , nil , api_token . text ) end tunes_client = Spaceship :: ConnectAPI . client . tunes_client generic_transporter = FastlaneCore :: ItunesTransporter . new ( options [ :username ] , nil , false , options [ :itc_provider ] ) return generic_transporter unless options [ :itc_provider ] . nil? && tunes_client . teams . count > 1 begin team = tunes_client . teams . find { | t | t [ 'providerId' ] . to_s == tunes_client . team_id } name = team [ 'name' ] provider_id = generic_transporter . provider_ids [ name ] UI . verbose ( "Inferred provider id #{provider_id} for team #{name}." ) return FastlaneCore :: ItunesTransporter . new ( options [ :username ] , nil , false , provider_id ) rescue => ex UI . verbose ( "Couldn't infer a provider short name for team with id #{tunes_client.team_id} automatically: #{ex}. Proceeding without provider short name." ) return generic_transporter end end
If App Store Connect API token, use token.
If App Store Connect API token use token .
# Use JWT auth