Class: Firebase::Admin::Messaging::APSAlert

Inherits:
Object
  • Object
show all
Defined in:
lib/firebase/admin/messaging/aps_alert.rb

Overview

An alert that can be included in an APS.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title: nil, subtitle: nil, body: nil, loc_key: nil, loc_args: nil, title_loc_key: nil, title_loc_args: nil, subtitle_loc_key: nil, subtitle_loc_args: nil, action_loc_key: nil, launch_image: nil, custom_data: nil) ⇒ APSAlert

Parameters:

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

    Title of the alert (optional). If specified, overrides the title set via Notification.

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

    Subtitle of the alert (optional).

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

    Body of the alert (optional). If specified, overrides the body set via Notification.

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

    Key of the body string in the app’s string resources to use to localize the body text (optional).

  • loc_args (Array<String>, nil) (defaults to: nil)

    List of resource keys that will be used in place of the format specifiers in #loc_key (optional).

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

    Key of the title string in the app’s string resources to use to localize the title text (optional).

  • title_loc_args (Array<String>, nil) (defaults to: nil)

    List of resource keys that will be used in place of the format specifiers in #title_loc_key (optional).

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

    Key of the subtitle string in the app’s string resources to use to localize the subtitle text (optional).

  • subtitle_loc_args (Array<String>, nil) (defaults to: nil)

    List of resource keys that will be used in place of the format specifiers in #subtitle_loc_key (optional).

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

    Key of the text in the app’s string resources to use to localize the action button text (optional).

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

    Image for the notification action (optional).

  • custom_data (Hash, nil) (defaults to: nil)

    A Hash of custom key-value pairs to be included in the Firebase::Admin::Messaging::APSAlert (optional).



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/firebase/admin/messaging/aps_alert.rb', line 80

def initialize(
  title: nil,
  subtitle: nil,
  body: nil,
  loc_key: nil,
  loc_args: nil,
  title_loc_key: nil,
  title_loc_args: nil,
  subtitle_loc_key: nil,
  subtitle_loc_args: nil,
  action_loc_key: nil,
  launch_image: nil,
  custom_data: nil
)
  self.title = title
  self.subtitle = subtitle
  self.body = body
  self.loc_key = loc_key
  self.loc_args = loc_args
  self.title_loc_key = title_loc_key
  self.title_loc_args = title_loc_args
  self.subtitle_loc_key = subtitle_loc_key
  self.subtitle_loc_args = subtitle_loc_args
  self.action_loc_key = action_loc_key
  self.launch_image = launch_image
  self.custom_data = custom_data
end

Instance Attribute Details

#action_loc_keyString?

Returns Key of the text in the app’s string resources to use to localize the action button text.

Returns:

  • (String, nil)

    Key of the text in the app’s string resources to use to localize the action button text.



44
45
46
# File 'lib/firebase/admin/messaging/aps_alert.rb', line 44

def action_loc_key
  @action_loc_key
end

#bodyString?

Returns Body of the alert. If specified, overrides the body set via Notification.

Returns:

  • (String, nil)

    Body of the alert. If specified, overrides the body set via Notification.



16
17
18
# File 'lib/firebase/admin/messaging/aps_alert.rb', line 16

def body
  @body
end

#custom_dataHash?

Returns A Hash of custom key-value pairs to be included in the Firebase::Admin::Messaging::APSAlert.

Returns:



52
53
54
# File 'lib/firebase/admin/messaging/aps_alert.rb', line 52

def custom_data
  @custom_data
end

#launch_imageString?

Returns Image for the notification action.

Returns:

  • (String, nil)

    Image for the notification action.



48
49
50
# File 'lib/firebase/admin/messaging/aps_alert.rb', line 48

def launch_image
  @launch_image
end

#loc_argsArray<String>?

Returns A list of resource keys that will be used in place of the format specifiers in #loc_key.

Returns:

  • (Array<String>, nil)

    A list of resource keys that will be used in place of the format specifiers in #loc_key.



24
25
26
# File 'lib/firebase/admin/messaging/aps_alert.rb', line 24

def loc_args
  @loc_args
end

#loc_keyString?

Returns Key of the body string in the app’s string resources to use to localize the body text.

Returns:

  • (String, nil)

    Key of the body string in the app’s string resources to use to localize the body text.



20
21
22
# File 'lib/firebase/admin/messaging/aps_alert.rb', line 20

def loc_key
  @loc_key
end

#subtitleString?

Returns Subtitle of the alert.

Returns:

  • (String, nil)

    Subtitle of the alert.



12
13
14
# File 'lib/firebase/admin/messaging/aps_alert.rb', line 12

def subtitle
  @subtitle
end

#subtitle_loc_argsArray<String>?

Returns A list of resource keys that will be used in place of the format specifiers in #subtitle_loc_key.

Returns:

  • (Array<String>, nil)

    A list of resource keys that will be used in place of the format specifiers in #subtitle_loc_key.



40
41
42
# File 'lib/firebase/admin/messaging/aps_alert.rb', line 40

def subtitle_loc_args
  @subtitle_loc_args
end

#subtitle_loc_keyString?

Returns Key of the subtitle string in the app’s string resources to use to localize the subtitle text.

Returns:

  • (String, nil)

    Key of the subtitle string in the app’s string resources to use to localize the subtitle text.



36
37
38
# File 'lib/firebase/admin/messaging/aps_alert.rb', line 36

def subtitle_loc_key
  @subtitle_loc_key
end

#titleString?

Returns Title of the alert. If specified, overrides the title set via Notification.

Returns:

  • (String, nil)

    Title of the alert. If specified, overrides the title set via Notification.



8
9
10
# File 'lib/firebase/admin/messaging/aps_alert.rb', line 8

def title
  @title
end

#title_loc_argsArray<String>?

Returns A list of resource keys that will be used in place of the format specifiers in #title_loc_key.

Returns:

  • (Array<String>, nil)

    A list of resource keys that will be used in place of the format specifiers in #title_loc_key.



32
33
34
# File 'lib/firebase/admin/messaging/aps_alert.rb', line 32

def title_loc_args
  @title_loc_args
end

#title_loc_keyString?

Returns Key of the title string in the app’s string resources to use to localize the title text.

Returns:

  • (String, nil)

    Key of the title string in the app’s string resources to use to localize the title text.



28
29
30
# File 'lib/firebase/admin/messaging/aps_alert.rb', line 28

def title_loc_key
  @title_loc_key
end