- Polymer Tutorial
- Polymer - Home
- Polymer - Overview
- Polymer - Installation
- Polymer - Elements
- Polymer - Custom Elements
- Polymer - Shadow DOM and Styling
- Polymer - Events
- Polymer - Data System
Polymer - Platinum Push Messaging
It is used to define the received push message using the <platinum-push-messaging> element and can be placed anywhere, but needs to be used only once in a page.
You can use this element in your application, by running the following command to install it in your project directory.
bower install --save PolymerElements/platinum-push-messaging
The push messaging subscription is available only in Google Chrome, which requires Google Cloud Messaging configuration and Chrome uses the gcm_sender_id field, present in the manifest file to link the page.
The notification message can be displayed in three ways −
Using the first way, you can fetch the notification message by specifying a URL.
<platinum-push-messaging message-url = "message_notification.json"> </platinum-push-messaging>
Using the second way, you can send the notification message in the body from your server.
Using the third way, you can specify the attributes manually on the element.
<platinum-push-messaging title = "Message Application" message = "Your application data is updated in the background" icon-url = "icon.png" click-url = "message_notification.html"> </platinum-push-messaging>
You can send the push messages to the browser, if you are using the Google Cloud Messaging service. Follow the instructions given in this link, to send the messages between the server and client applications.
Kickstart Your Career
Get certified by completing the courseGet Started