Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
Yandex Cloud Notification Service
    • Overview
    • Getting started with mobile push notifications
    • Getting started with in-browser push notifications
    • Getting started with SMS
    • All guides
      • Creating a push notification channel
      • Updating a push notification channel
      • Deleting a push notification channel
      • Creating an endpoint
      • Updating an endpoint
      • Deleting an endpoint
      • Sending a push notification
    • Configuring logging
    • Overview
    • Mobile push notifications
    • In-browser push notifications
    • SMS
    • Quotas and limits
    • All tools
    • AWS CLI
    • AWS SDK for C++
    • AWS SDK for Go
    • AWS SDK for Java
    • AWS SDK for JavaScript
    • AWS SDK for Kotlin
    • AWS SDK for .NET
    • AWS SDK for PHP
    • AWS SDK for Python (boto3)
  • Pricing policy
  • Monitoring metrics
  • Logs Cloud Logging
  • Release notes
  1. Step-by-step operations
  2. Mobile push notifications
  3. Sending a push notification

Sending a push notification

Written by
Yandex Cloud
Updated at April 17, 2025
Management console
AWS CLI
AWS SDK for Python
AWS SDK for PHP
API
  1. In the management console, go to the folder containing your endpoint.
  2. From the list of services, select Cloud Notification Service.
  3. Select a push notification channel.
  4. Navigate to the Endpoints tab.
  5. Select the endpoint you need.
  6. Select a notification format under Send messages: Text or JSON.
  7. Enter notification text or a JSON object with notification data.
  8. Click Send.

Each sent notification is assigned a unique ID. To save it, click Copy ID.

You can send a new notification immediately or resend the previous one.

If you do not have the AWS CLI yet, install and configure it.

Explicit notifications (Bright Push)

To send an explicit notification, run this command:

  • Apple iOS (APNs)

    aws sns publish \
      --target-arn "<endpoint_ARN>" \
      --message-structure json \
      --message '{"default": "<notification_text>", "APNS": "{ \"aps\": { \"alert\": \"<notification_text>\"} }" }'
    
  • Google Android (FCM)

    aws sns publish \
      --target-arn "<endpoint_ARN>" \
      --message-structure json \
      --message '{"default": "<notification_text>", "GCM": "{ \"notification\": { \"body\": \"<notification_text>\"} }" }'
    

Where:

  • --target-arn: Mobile endpoint ID (ARN)
  • --message-structure: Message format
  • --message: Message

Silent notifications (Silent Push)

To send a silent notification, run this command:

aws sns publish \
  --target-arn <endpoint_ARN> \
  --message-structure json \
  --message '{"data": { "key": "value" } }'

Where:

  • --target-arn: Mobile endpoint ID (ARN)
  • --message-structure: Message format
  • --message: Message

If you do not have the AWS SDK for Python (boto3) yet, install and configure it.

Explicit notifications (Bright Push)

To send an explicit notification, use this code:

  • Apple iOS (APNs)

    response = client.publish(
        TargetArn="<endpoint_ID>",
        Message=json.dumps({
            "default": "<notification_text>",
            "APNS": json.dumps({
                "aps": {
                    "alert": "<notification_text>"
                }
            })
        }),
        MessageStructure="json"
    )
    print ("Message id:", response["MessageId"])
    
  • Google Android (FCM)

    response = client.publish(
        TargetArn="<endpoint_ID>",
        Message=json.dumps({
            "default": "<notification_text>",
            "GCM": json.dumps({
                "notification": {
                    "body": "<notification_text>"
                }
            })
        }),
        MessageStructure="json"
    )
    print ("Message id:", response["MessageId"])
    
  • RuStore Android

    response = client.publish(
        TargetArn="<endpoint_ID>",
        Message=json.dumps({
            "default": "<default_notification_text>",
            "RUSTORE": json.dumps({
                "notification": {
                    "title": "<notification_title>",
                    "body": "<notification_text>",
                }
            })
        }),
        MessageStructure="json"
    )
    message_id = response["MessageId"]
    print(f"Message id is: {message_id}")
    

Where:

  • TargetArn: Mobile endpoint ID (ARN).
  • MessageStructure: Message format.
  • Message: Message.

Silent notifications (Silent Push)

To send a silent notification, use this code:

response = client.publish(
    TargetArn="<endpoint ARN>",
    Message='{"data": { "key": "value" } }')
print ("Message id:", response["MessageId"])

Where:

  • TargetArn: Mobile endpoint ID (ARN)
  • Message: Message

If you do not have the AWS SDK for PHP yet, install and configure it.

Explicit notifications (Bright Push)

To send an explicit notification, use this code:

  • Apple iOS (APNs)

    $response = $client->publish(
      [
          'TargetArn' => '<endpoint_ID>',
          'Message' => json_encode([
              'default' => '<notification_text>',
              'APNS' => json_encode([
                  'aps' => [
                      'alert' => '<notification_text>',
                  ],
              ])
          ]),
          'MessageStructure' => 'json',
      ]
    );
    
    print($response->get('MessageId'));
    
  • Google Android (FCM)

    $response = $client->publish(
      [
          'TargetArn' => '<endpoint_ID>',
          'Message' => json_encode([
              'default' => '<notification_text>',
              'GCM' => json_encode([
                  'notification' => [
                      'title' => '<notification_title>',
                      'body' => '<notification_text>',
                  ],
              ])
          ]),
          'MessageStructure' => 'json',
      ]
    );
    
    print($response->get('MessageId'));
    

Where:

  • TargetArn: Mobile endpoint ID (ARN).
  • MessageStructure: Message format.
  • Message: Message.

Silent notifications (Silent Push)

To send a silent notification, use this code:

  • Google Android (FCM)

    $response = $client->publish(
      [
          'TargetArn' => '<endpoint_ID>',
          'Message' => json_encode([
              'default' => '<notification_text>',
              'GCM' => json_encode([
                  'data' => ['<key>' => '<value>'],
              ])
          ]),
          'MessageStructure' => 'json',
      ]
    );
    
    print($response->get('MessageId'));
    

    Where:

    • TargetArn: Mobile endpoint ID (ARN).
    • MessageStructure: Message format.
    • Message: Message.

Use the HTTP API publish method for the Yandex Cloud Notification Service Publish resource.

Was the article helpful?

Previous
Deleting an endpoint
Next
Creating a channel
Yandex project
© 2025 Yandex.Cloud LLC