Class: Fastlane::Helper::VoipPushCertificateHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/fastlane/plugin/voip_push_certificate/helper/voip_push_certificate_helper.rb

Overview

Creates and renews Apple "VoIP Services" push certificates. Apple issues a single VoIP certificate valid for both the sandbox and the production APNs environments, so there is no development/production distinction here.

Constant Summary collapse

CERTIFICATE_LABEL =
"VoIP Services".freeze

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ VoipPushCertificateHelper

Returns a new instance of VoipPushCertificateHelper.



17
18
19
# File 'lib/fastlane/plugin/voip_push_certificate/helper/voip_push_certificate_helper.rb', line 17

def initialize(params)
  @params = params
end

Instance Method Details

#runHash?

Returns paths of the generated files, or nil when the existing certificate is still valid and no new one was created.

Returns:

  • (Hash, nil)

    paths of the generated files, or nil when the existing certificate is still valid and no new one was created.



23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/fastlane/plugin/voip_push_certificate/helper/voip_push_certificate_helper.rb', line 23

def run
  

  existing = existing_certificate
  if existing
    days = remaining_days(existing)
    UI.message("Existing VoIP Services certificate for '#{existing.owner_name}' is valid for #{days.round} more days.")
    return nil if keep_existing?(days)

    revoke!(existing) if @params[:revoke_existing]
  end

  create_certificate
end