Onesignal push notification configuration in wordpress step by step:
Push notifications became the more popular feature from blogs to ecommerce platforms. We could able to find lot of push notification plugins for wordpress. But onesignal is great among them because of its simplicity in configuration and the free pricing.
They still offer premium support, but I don’t think it is needed because unlimited devices, unlimited notifications etc., comes in the free version itself.
Two things need to be done to configure the push notifications in wordpress:
- Signup in onesignal and do some basic configurations like platform selection (chrome, Mozilla or android etc.,)
- Install one signal plugin and configure it.
1.Signup in onesignal and do some basic configurations like platform selection (chrome, Mozilla or android etc.,)
Open https://onesignal.com and Login (sign up is free only).
After the successful login,
Click create a new app and give some name (eg: Javadomain)
Now Click the Javadomain and navigate to App settings.
Give site url and the site icon[Your notification icon must be 80 pixels × 80 pixels large] and click save.
If your site is https then ensure the checkbox “My site is not fully HTTPS” is unchecked.
So far, we have completed selecting the platform for push notification (here we enabled push notification only for windows and chrome), If you want to configure it for android, ios, safari just click configure and finish it. For safari and ios you may need to import some certificates.
Things to Note:
In the APP settings you will be able to find a tab “Keys & IDs” click and note down
Onesignal App ID & REST API key.
2.Install one signal plugin and configure it.
In the Account settings we need to configure the keys & IDs we noted down from onesignal portal.
App ID: Paste Onesignal App ID which you copied from onesignal.com (refer things to note section above)
REST API Key: Rest API Key which you copied from onesignal.com(refer things to note section above)
OneSignal Subdomain: we need to create some subdomain (eg: javadomain) then push notification will be delivered from javadomain.onesignal.com.
Mention only javadomain [not javadomain.onesignal.com]
If you want only your own domain url (eg:ngdeveloper.com instead of javadomain.onesignal.com) then your site must be upgraded to https.
Safari Web ID: not needed at this point, because we enabled only chrome and Mozilla notifications in onesignal app settings.
After entering the above details click save. You have done setting up push notifications in wordpress. Onesignal also provide few options for some customizations, you can check and enable if you need anything.
How to test push notification?
Refresh the page and click the bell icon to subscribe for push notifications.
Since I did not give any default icon, icon did not come in the notifications. But you can mention it in onesignal.com app settings.
Now go to posts and click edit for any posts, in the post edit or new post screen right side above to the post/update one checkbox enabled.
Now I am in some different tabs of the browser but notification came like this,
Hope you got clear idea on how to setup one signal pushnotification in wordpress.
If you are using any other plugin/way for push notification in your blog, please comment below to try it once!
883 total views, 1 views today