Read our documentation
For more in-depth guides on onboarding and setup.
Read Documentation

nativeFunctions.onesignalDeleteTags()

If you would like to remove tags from a user profile in OneSignal you can call the nativeFunctions.onesignalDeleteTags() function.

When a user opts out of notifications for promotional content, for example, you can call the nativeFunctions.onesignalDeleteTags() function, as follows:

<script type="text/javascript">
// Add the event listener
window.addEventListener("message", (event) => {
isAppReady = event;
}, false);

// Log the user in
function removeTag(isAppReady) {
try {
// Check if the native functions are ready to be used
if (isAppReady.data && isAppReady.data == 'nativeFunctionsLoaded') {
nativeFunctions.onesignalDeleteTags("promotions");
}

} catch (ex) {
console.log(ex.message);
}
}
</script>

Note that you can also delete multiple tags at once, using nativeFunctions.onesignalDeleteTags("tag1", "tag2", "tag3")

Thank you! We'll be in touch within 48 hours :)
Oops! Something went wrong while submitting the form.
Preview My App
Preview My App