Class: AWSCDK::Pinpoint::CfnPushTemplate::APNSPushNotificationTemplateProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
pinpoint/cfn_push_template.rb

Overview

Specifies channel-specific content and settings for a message template that can be used in push notifications that are sent through the APNs (Apple Push Notification service) channel.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(action: nil, body: nil, media_url: nil, sound: nil, title: nil, url: nil) ⇒ APNSPushNotificationTemplateProperty

Returns a new instance of APNSPushNotificationTemplateProperty.

Parameters:

  • action (String, nil) (defaults to: nil)

    The action to occur if a recipient taps a push notification that's based on the message template.

  • body (String, nil) (defaults to: nil)

    The message body to use in push notifications that are based on the message template.

  • media_url (String, nil) (defaults to: nil)

    The URL of an image or video to display in push notifications that are based on the message template.

  • sound (String, nil) (defaults to: nil)

    The key for the sound to play when the recipient receives a push notification that's based on the message template.

  • title (String, nil) (defaults to: nil)

    The title to use in push notifications that are based on the message template.

  • url (String, nil) (defaults to: nil)

    The URL to open in the recipient's default mobile browser, if a recipient taps a push notification that's based on the message template and the value of the Action property is URL .



638
639
640
641
642
643
644
645
646
647
648
649
650
651
# File 'pinpoint/cfn_push_template.rb', line 638

def initialize(action: nil, body: nil, media_url: nil, sound: nil, title: nil, url: nil)
  @action = action
  Jsii::Type.check_type(@action, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "action") unless @action.nil?
  @body = body
  Jsii::Type.check_type(@body, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "body") unless @body.nil?
  @media_url = media_url
  Jsii::Type.check_type(@media_url, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "mediaUrl") unless @media_url.nil?
  @sound = sound
  Jsii::Type.check_type(@sound, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "sound") unless @sound.nil?
  @title = title
  Jsii::Type.check_type(@title, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "title") unless @title.nil?
  @url = url
  Jsii::Type.check_type(@url, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "url") unless @url.nil?
end

Instance Attribute Details

#actionString? (readonly)

The action to occur if a recipient taps a push notification that's based on the message template.

Valid values are:

  • OPEN_APP – Your app opens or it becomes the foreground app if it was sent to the background. This is the default action.
  • DEEP_LINK – Your app opens and displays a designated user interface in the app. This setting uses the deep-linking features of the iOS platform.
  • URL – The default mobile browser on the recipient's device opens and loads the web page at a URL that you specify.


663
664
665
# File 'pinpoint/cfn_push_template.rb', line 663

def action
  @action
end

#bodyString? (readonly)

The message body to use in push notifications that are based on the message template.



668
669
670
# File 'pinpoint/cfn_push_template.rb', line 668

def body
  @body
end

#media_urlString? (readonly)

The URL of an image or video to display in push notifications that are based on the message template.



673
674
675
# File 'pinpoint/cfn_push_template.rb', line 673

def media_url
  @media_url
end

#soundString? (readonly)

The key for the sound to play when the recipient receives a push notification that's based on the message template.

The value for this key is the name of a sound file in your app's main bundle or the Library/Sounds folder in your app's data container. If the sound file can't be found or you specify default for the value, the system plays the default alert sound.



680
681
682
# File 'pinpoint/cfn_push_template.rb', line 680

def sound
  @sound
end

#titleString? (readonly)

The title to use in push notifications that are based on the message template.

This title appears above the notification message on a recipient's device.



687
688
689
# File 'pinpoint/cfn_push_template.rb', line 687

def title
  @title
end

#urlString? (readonly)

The URL to open in the recipient's default mobile browser, if a recipient taps a push notification that's based on the message template and the value of the Action property is URL .



692
693
694
# File 'pinpoint/cfn_push_template.rb', line 692

def url
  @url
end

Class Method Details

.jsii_propertiesObject



694
695
696
697
698
699
700
701
702
703
# File 'pinpoint/cfn_push_template.rb', line 694

def self.jsii_properties
  {
    :action => "action",
    :body => "body",
    :media_url => "mediaUrl",
    :sound => "sound",
    :title => "title",
    :url => "url",
  }
end

Instance Method Details

#to_jsiiObject



705
706
707
708
709
710
711
712
713
714
715
716
# File 'pinpoint/cfn_push_template.rb', line 705

def to_jsii
  result = {}
  result.merge!({
    "action" => @action,
    "body" => @body,
    "mediaUrl" => @media_url,
    "sound" => @sound,
    "title" => @title,
    "url" => @url,
  })
  result.compact
end