I want to test OneSignal push notifications on localhost before I deploy my app to a remote server.
I followed the instructions provided by the documentation. When I enter http://localhost
as the site url I get an error message that says:
localhost is already taken. Please enter a different name.
Is there a way to use OneSignal on localhost ?
Install Your SDK Copy the alpha numeric code that OneSignal generates called Your App ID in the image below. On Thunkable, open the Push Notifications dialog and paste this ID into the Android App ID field. Click the Live Test button. Once the app is on your phone, go back to One Signal.
It allows you to have a small group of test users on both Android and iOS to send your test notification out to without bugging the other users of your app. Using Notification Groups allows you to test more targeted notifications.
Besides configuring OneSignal via dashboard, your OneSignal.init
in your browser call must have the allowLocalhostAsSecureOrigin
option:
OneSignal.init({
allowLocalhostAsSecureOrigin: true,
...
})
More at https://documentation.onesignal.com/docs/web-push-setup-faq#section-how-do-i-test-my-site-on-a-local-environment
read in this doc https://documentation.onesignal.com/docs/web-push-setup-faq#section-how-do-i-test-my-site-on-a-local-environment- and localhost must run in port 8000
It should be https://localhost
not http://localhost
. OneSignal treats localhost
as secure connections.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With