Note: Chrome notifications currently require https websites this may change if Chrome implements encryption of the push payload. Chrome notifications will not work with self-signed certificates (https/ssl). You must have an SSL certificate signed by a trusted Authority.
If your site is http it is still possible to send web push notifications to your users on Chrome mobile and desktop with xtremepush. However the notifications must be sent from a https property. A suitable property can be auto created in the xtremepush platform.
To send Chrome Notifications you will also need:
- A credential called the FCM/GCM API Key and your project number from your google developer console
- If your site is http a suitable https sub domain
- If you are self hosting on a https domain
- A JSON manifest file in your website directory
Details on these prerequisites are found below:
FCM/GCM API Key
To send Push Notifications on Chrome you need to have a Cloud Messaging API Key generated in your google developer or firebase account. This credential is the same type as the API key you generate to send push to Android apps. Details on how to generate these required credentials here:
- FCM API Key
- GCM API Key (if you have an existing Google Project from pre Sept 2016 you may have a GCM API Key)
Once you have located your Firebase Cloud Messaging credentials log into your XtremePush dashboard on xtremepush.com. Go to your project home and navigate to Applications and on the right-hand side click the "Settings" link next to the relevant website. Paste your Sender ID into the FCM/GCM Project Number (Sender ID) field and either the Server Key or the Firebase Cloud Messaging Token into the API Key field and click save.
HTTP/HTTPS - Hosted/Self Hosted Domain
Depending on wether your site is HTTP or HTTPS you will set the remaining configs in the settings section of your website (Applications > Website X - Settings) a little differently.
If your site is http, not https you will not be doing the steps after this section (Manifest File and Service-Worker). You can instead select no for "using self hosted https domain" underneath where you added your GCM sender ID and name your webpu.sh sub domain.
Click save and you are done on the websites settings page for Chrome. For more details on how web push works with a hosted domain you can read Chrome support for http. Now return to the integration guide, and choose the next browser you need to add, or proceed with deploying the SDK - continue integration.
Self Hosted Domain
If your domain is HTTPS and you want to request notifications from your own domain you will need to host two files on the same origin as you site. Details on this will be back in the main integration guide. In this case set "Use self hosted domain" to yes and "HTTP" support to no.
If your site is https but you would like to avoid adding additional files to your site for example if you want to do the full deployment with Google Tag Manager, you can use a hosted domain for a HTTPS site as well. In this case set "Use self hosted domain" to no and "HTTP" support to no.
Once you have set your configs Click save and you are done on the website settings page for Chrome. Now return to the integration guide, and choose the next browser you need to add, or proceed with deploying the SDK - continue integration.