class Fastlane::Helper::AwsSns

Public Class Methods

new(access_key, secret_access_key, region, topic_arn) click to toggle source
# File lib/fastlane/plugin/aws_sns_topic/helper/aws_sns_topic_helper.rb, line 20
def initialize(access_key, secret_access_key, region, topic_arn)
  @client = Aws::SNS::Client.new(
    access_key_id: access_key,
    secret_access_key: secret_access_key,
    region: region
  )
  @topic = Aws::SNS::Topic.new(
    arn: topic_arn,
    client: @client
  )
end

Public Instance Methods

publish_message(message, subject) click to toggle source
# File lib/fastlane/plugin/aws_sns_topic/helper/aws_sns_topic_helper.rb, line 32
def publish_message(message, subject)
  @topic.publish({
    message: message,
    subject: subject
  })
rescue => error
  UI.crash!("Send SNS topic message error: #{error.inspect}")
end