Skip to content

ibm-bluemix-push-notifications/HelloPush-PWA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HelloPush PWA Sample

This Progressive web application which shows how to use IBM cloud push notifications service.

Supported platforms

  • Android

Limitations

We dont support push notifications in iOS PWA due to the limitations in safari service workers

Requirements

Create and Configure push notification service

Create a push notification service in IBM Cloud and configure the Web push.

Configure the PWA app

  • In the example app, go the the public -> Scripts -> app.js folder and add values for the following ,
  var initParams = {
    "appGUID": "xxx-xxxx-xxxx-xxx",
    "appRegion": "us-south",
    "clientSecret": "xxx-xx-xxxx-xxx-xx",
    "applicationServerKey": "xx-xxxx-xxxxx-xxx-xxx-xxx"
}

Push your website to the IBM Cloud

  • Connect and log in to IBM Cloud
 $ ibmcloud api https://cloud.ibm.com
  • From the directory root folder deploy your app into IBM Cloud,
 $ ibmcloud app push ibmcloudpushpwaapp

After successful deploy , you will be able to see your website running in https://ibmcloudpushpwaapp.mybluemix.net.

Use PWA app in browsers

  • Try push notification in Chrome and Firefox.

Use the PWA app in Android

  • Open the https://ibmcloudpushpwaapp.mybluemix.net in Android chrome and from the menu options select Add to home screen option. This will add the PWA app to your Android home screen.

  • Open the app from home screen and register for push notifications.

  • Send push notifications from IBM Cloud push notifications console.

Samples & videos

======================= Copyright 2020 IBM Corp.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.