Help me with OneSignal Web Push & Javascript

StoneDB

Registered Member
Joined
Nov 20, 2016
Messages
55
Reaction score
29
Hi all,

Someone can help me with OneSignal WebPush ?

I explain, currently i use this javascript code on my website:


HTML:
<script src="https://cdn.onesignal.com/sdks/OneSignalSDK.js" async=""></script>
<script>
  var OneSignal = window.OneSignal || [];
  OneSignal.push(function() {
    OneSignal.init({
      appId: "myappid",
      autoRegister: false,
      notifyButton: {
        enable: false,
      },
    });
  });
</script>

And notification permission message are show like this:

326a605-Slidedown-DesktopMobile.jpg


But i don't want custom message for permission, i want native browser permission, like this:

2017-10-18-05-45-38-20e1d7.png


Can you modify my javascript code please ? I understand nothing with Javacript.

Documentation can be found here: https://documentation.onesignal.com/docs/web-push-custom-code-examples

Thanks in advance :)
 
Have you tried this?

Code:
https://stackoverflow.com/a/13328513/1437261

If you can't code Javascript, try posting in the HAF section. Someone might do it for you for the right price ;)
 
Thanks for ur replie. But no need To code anything. Just understand OneSignal documentation :)
 
Thanks for ur replie. But no need To code anything. Just understand OneSignal documentation :)
If you see the code you posted, all you are doing is pushing your setting to the OneSignal variable and the rest is handled by the script you have embedded over there ( cdn.onesignal.com/sdks/OneSignalSDK.js ). So, you might like to contact their customer support for this, instead of posting here :)

Btw, again.. the code you posted does nothing except for pushing your settings to an array (and instantiating the application by calling init method).
 
Back
Top