> For the complete documentation index, see [llms.txt](https://docs.antsomi.com/developers-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.antsomi.com/developers-guide/antsomi-service-integrations/media-json/sample-opt-in-events/subscribe-to-onesignal-channel.md).

# Subscribe to OneSignal channel

When a user subscribes to a specific OneSignal channel through your web app, they choose to receive targeted notifications, ensuring they stay informed and engaged.

### Event trigger

* The user agreed to get notifications by OneSignal subscription.
* When the user's subscription state changes to "subscribed".&#x20;
* Get the UserID OneSignal and Check to resend the event every 30 minutes.

```html
<script>
  var url = web_media_template.buildUrlMediaJson(
    "onesignal", 
    "subscribed", 
    ["div_asm_qct_test_json_1"], 
    {
      extra: {
        uid_onesignal: "00119008-b3c8-11ec-ab21-8600940e804b",
        onesignal_time:"2020-12-11 15:30:20",
        identify_time:"2020-12-11 15:30:20",
        identify_event: "OneSignal Subscribed" 
     }
   });
</script>
```
