Jump to content

Onesignal notifications


Recommended Posts

I'm trying to implement Onesignal push notifications, I'm told to enter the following code on my site:

<Head>
   <Link rel = "manifest" href = "/ manifest.json">
   <Script src = "https://cdn.onesignal.com/sdks/OneSignalSDK.js" async> </ script>
   <Script>
     Var OneSignal = window.OneSignal || [];
     OneSignal.push (["init", {
       AppId: "YOUR_APP_ID",
       AutoRegister: false,
       NotifyButton: {
         Enable: true / * Set to false to hide * /
       }
     }]);
   </ Script>
</ Head>

Where should I put this code?

If anyone can help me, thanks a lot.

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...
  • 2 months later...

I'm trying to implement Onesignal push notifications, I'm told to enter the following code on my site:

 

<Head>

   <Link rel = "manifest" href = "/ manifest.json">

   <Script src = "https://cdn.onesignal.com/sdks/OneSignalSDK.js" async> </ script>

   <Script>

     Var OneSignal = window.OneSignal || [];

     OneSignal.push (["init", {

       AppId: "YOUR_APP_ID",

       AutoRegister: false,

       NotifyButton: {

         Enable: true / * Set to false to hide * /

       }

     }]);

   </ Script>

</ Head>

 

Where should I put this code?

 

If anyone can help me, thanks a lot.

 

Does anyone know where to put the code?

Edited by viniciuslbb (see edit history)
Link to comment
Share on other sites

Hi,

 

Go to header.tpl

 

Put the code even before </Head> like this:

 

{literal}

   <Link rel = "manifest" href = "/ manifest.json">
   <Script src = "https://cdn.onesigna...OneSignalSDK.js" async> </ script>
   <Script>
     Var OneSignal = window.OneSignal || [];
     OneSignal.push (["init", {
       AppId: "YOUR_APP_ID",
       AutoRegister: false,
       NotifyButton: {
         Enable: true / * Set to false to hide * /
       }
     }]);
   </ Script>

{/literal}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...