Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

187
Views
How to add Tag to OneSignal using Android Web View app?

I have a web view app with OneSignal integrated into it. All I'm trying to do is add tags to that user when clicked on a button in OneSignal using the below code :

<button onclick="buttonclicked()" >some</button>

<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://cdn.onesignal.com/sdks/OneSignalSDK.js" async=""></script>
<script>
  window.OneSignal = window.OneSignal || [];
  OneSignal.push(function() {
    OneSignal.init({
      appId: "xxxxx",
    });
  });
  
  
function buttonclicked() {
    console.log("click");
    OneSignal.push(function() {
     OneSignal.sendTags({sub_url:window.location.href, topic:'tags'}).then(function(tagsSent) {
         console.log("tagssent:" + JSON.stringify(tagsSent));
     });
    });
}
</script>

I followed exactly the same procedure as in the documentation

Not sure what went wrong, when I trigger the function through the app, the data is not being posted to OneSignal's tags field.

Any help is greatly appreciated.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!