Class: Firebase::Admin::Messaging::APNSPayload

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

Overview

Represents the payload of an APNs message.

Mainly consists of the ‘aps` dictionary. But may also contain other arbitrary custom keys.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(aps:, data: nil) ⇒ APNSPayload

Initializes a payload.

Parameters:

  • aps (APS)

    An Firebase::Admin::Messaging::APS instance to be included in the payload.

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

    Arbitrary keyword arguments to be included as custom fields in the payload.



21
22
23
24
# File 'lib/firebase/admin/messaging/apns_payload.rb', line 21

def initialize(aps:, data: nil)
  @aps = aps
  @data = data
end

Instance Attribute Details

#apsAPS

Returns The aps instance to be included in the payload.

Returns:

  • (APS)

    The aps instance to be included in the payload.



10
11
12
# File 'lib/firebase/admin/messaging/apns_payload.rb', line 10

def aps
  @aps
end

#dataHash

Returns Custom fields to include in the payload.

Returns:

  • (Hash)

    Custom fields to include in the payload.



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

def data
  @data
end