OneSignal Push Notification

OneSignal is used to send push notifications to users. To add OneSignal Push notifications, follow the given steps.

1. Creating one signal app

Login or Signup in https://onesignal.com/

1.After logging in click on Add a new app.

2. Then add you app name and click create

3. After that select platform and hit next:

If you are building your app for android select Google Android or select Apple iOS if you want to build your app for iOS.

4. After that you need to add Google Server API Key.

5. To obtain Google Server API Key, Visit the Firebase Console and sign in with your Google account.

6. Press "CREATE NEW PROJECT" or select an existing one below.

7. Enter a project name and press "CREATE PROJECT".

8. Getting your Firebase Cloud Messaging token and Sender ID

9. Copy server key And sender Id And Add it in OneSignal app and click next

Select your target SDK PhoneGap, Cordova, ionic and hit next:

10. After that Copy App ID

and add App id And Sender id (googleProjectId) in src/providers/service/config.ts file.

oneSignalAppId: any = '28195d62-44f6-4934-a7f0-1551g200eb20';
googleProjectId: any = '575406234046';

googleProjectId is Sender ID

11. You need to build and run your app on mobile at-least once to complete OneSignal registration . Then go back to OneSignal and click Check Subscribed User and Done.

Sending Push Notifications to your App

For Sending Push Notifications, you need to install OneSignal Push notification plugin and configure according to OneSignal official documents. https://wordpress.org/plugins/onesignal-free-web-push-notifications/

Add APP id and Rest API Key, which you have created before.

Go Push Notification menu and send notifications. You can send a notification to email id, pin code, city, state etc

You can send a notification when a new product is added in WooCommerce. One signal will automatically send notification on product publish

Last updated