Class: Firebase::Admin::Messaging::CriticalSound

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

Overview

Critical alert sound configuration that can be included in an APS

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name: "default", critical: nil, volume: nil) ⇒ CriticalSound

Parameters:

  • name (String) (defaults to: "default")

    The name of a sound file in the app’s main bundle or in the ‘Library/Sounds` folder of teh app’s container directory.

  • critical (Boolean, nil) (defaults to: nil)

    The critical alert flag (optional).

  • volume (Float, nil) (defaults to: nil)

    The volume for the critical alert’s sound (optional). Must be a value between 0.0 (silent) and 1.0 (full volume).



29
30
31
32
33
# File 'lib/firebase/admin/messaging/critical_sound.rb', line 29

def initialize(name: "default", critical: nil, volume: nil)
  self.name = name
  self.critical = critical
  self.volume = volume
end

Instance Attribute Details

#criticalBoolean?

Returns The critical alert flag. Set to ‘true` to enable the critical alert.

Returns:

  • (Boolean, nil)

    The critical alert flag. Set to ‘true` to enable the critical alert.



13
14
15
# File 'lib/firebase/admin/messaging/critical_sound.rb', line 13

def critical
  @critical
end

#nameString

Returns The name of a sound file in the app’s main bundle or in the ‘Library/Sounds` folder of the app’s container directory. Specify the string “default” to play the system sound.

Returns:

  • (String)

    The name of a sound file in the app’s main bundle or in the ‘Library/Sounds` folder of the app’s container directory. Specify the string “default” to play the system sound.



9
10
11
# File 'lib/firebase/admin/messaging/critical_sound.rb', line 9

def name
  @name
end

#volumeFloat?

Returns The volume for the critical alert’s sound. Must be a value between 0.0 (silent) and 1.0 (full volume).

Returns:

  • (Float, nil)

    The volume for the critical alert’s sound. Must be a value between 0.0 (silent) and 1.0 (full volume).



17
18
19
# File 'lib/firebase/admin/messaging/critical_sound.rb', line 17

def volume
  @volume
end