Create an in-browser push notification channel
- In the management console
, select the folder you want to create a notification channel in. - From the list of services, select Cloud Notification Service.
- Click Create notifications channel.
- Select the Push notifications in browser tab.
- Optionally, under Logging, enable Write logs.
- In the Folder list, select the folder the log group will reside in.
- In the Log group field, select an existing log group or create a new one.
- Enter a name for your notification channel. The channel name must be unique within Cloud Notification Service.
- Optionally, click
Add description and enter a description for your notification channel. - Click Create.
-
If you do not have the AWS CLI yet, install and configure it.
-
Run this command:
aws sns create-platform-application \ --name <channel_name> \ --platform "WEB" \ --attributes "{}"
Where
--name
is a user-defined name for the notification channel.For more information about the
aws sns create-platform-application
command, see the AWS documentation .
-
If you do not have the AWS SDK for Python (boto3) yet, install and configure it.
-
To create a push notification channel, use the following code:
try: response = client.create_platform_application( Name="<channel_name>", Platform="WEB", Attributes={}, ) print(f'PlatformApplication ARN: {response["PlatformApplicationArn"]}') except botocore.exceptions.ClientError as error: print(f"Error: {error}")
-
If you do not have the AWS SDK for PHP yet, install and configure it.
-
To create a push notification channel, use the following code:
$response = $client->createPlatformApplication( [ 'Name' => '<channel_name>', 'Platform' => 'WEB', 'Attributes' => [], ] ); print('PlatformApplication ARN: ' . $response->get('PlatformApplicationArn'));
-
If you do not have the AWS SDK for JavaScript yet, install and configure it.
-
To create a push notification channel, use the following code:
try { const response = await client.send( new AWS.CreatePlatformApplicationCommand({ Name: "<channel_name>", Platform: "WEB", }), ); console.log("PlatformApplication ARN:", response["PlatformApplicationArn"]); } catch (e) { console.log("Error:", e) }
Use the create HTTP API method for the PlatformApplications resource in Yandex Cloud Notification Service.
Creating a notification channel may take some time. After you create your channel, create an endpoint.