---
schema_version: "1"
id: 85db2a2844204c1c1e2075b8edc59ed7770d390489d21801d6c0cffa0f62d45d
title: setPayload(payload)
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_Messaging_PushNotification_setPayload.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_Messaging_PushNotification_setPayload.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: e9e662bf0da749507a67a549802d277859a07d8de90750dde28aaf3a421b0abf
description: Sets the payload of the push notification message.
---
# setPayload(payload)

Sets the payload of the push notification message.

## Signature

public void setPayload(Map<String,Object\> payload)

## Parameters

- **payload**:
    
    Type: [Map](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_map.htm#apex_methods_system_map "Contains methods for the Map collection type.")<[String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type."), Object>
    
    The payload, expressed as a map of key-value pairs.
    
    Payload parameters can be different for each mobile OS vendor. For more information on Apple's payload parameters, search for "Apple Push Notification Service" at [https://developer.apple.com/library/mac/documentation/](https://developer.apple.com/library/mac/documentation "HTML (New Window)").
    
    To create the payload for an Apple device, see the [PushNotificationPayload Class](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_classes_push_notification_payload.htm "Contains methods to create the notification message payload for an Apple device.").

## Example

See the [Push Notification Example](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_classes_push_notification.htm#push_notification_example_code).