Chrome - FCM/GCM API Key, Manifest File and Service-Worker

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
    • A Serviceworker Javascript 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 your API key has been created copy it and log in to your XtremePush dashboard on xtremepush.com. Go to your app home and navigate to Settings > Certs & Keys on the right hand side select the Chrome radio button and paste the API key into GCM Key form field. Also add the Sender ID you saved earlier (also known as your Project Number) and click save.

 

 

HTTP/HTTPS - Hosted/Self Hosted Domain 

Depending on wether your site is HTTP or HTTPS you will set the remaining configs on the Certs & Keys page a little differently.

 

HTTP Site

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 Certs & Keys 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.

 

HTTPS

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.

 

Hosted Domain

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 Certs & Keys 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.

Have more questions? Submit a request

0 Comments

Article is closed for comments.