This Progressive web application which shows how to use IBM cloud push notifications service.
- Android
We dont support push notifications in iOS PWA due to the limitations in safari service workers
- IBM Cloud Push notifications Instance - Follow this Docs
- Any Code Editor
Create a push notification service in IBM Cloud and configure the Web push.
- 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"
}
- Add the Web Push SDK inside the public folder.
- 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
.
- Try push notification in Chrome and Firefox.
-
Open the
https://ibmcloudpushpwaapp.mybluemix.net
in Android chrome and from the menu options selectAdd 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.
-
Please visit for samples - Github Sample
-
Video Tutorials Available here - Bluemix Push Notifications
======================= 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.