Yes — you can clear a tag value from the SDK, which returns the tag to the unset (NOTSET) state for that device. The way to do it is to send null for the tag, not an empty string.
The NOTSET state means the tag has no value for that particular device. Sending an empty string ("") does not restore it — the tag stays "set" and simply holds an empty value, so segments built on NOTSET will still exclude the device.
Android — use TagsBundle.Builder.remove(), which sends null for the tag:
TagsBundle tags = new TagsBundle.Builder()
.remove("YourTagName")
.build();
Pushwoosh.getInstance().setTags(tags);
iOS (SDK 7.0+ uses the Pushwoosh.configure accessor) — pass a null value:
Pushwoosh.configure.setTags(["YourTagName": NSNull()])
Under the hood both call the Device API /setTags method, whose tags parameter accepts null to remove a value:
{
"request": {
"application": "XXXXX-XXXXX",
"hwid": "DEVICE_HWID",
"tags": { "YourTagName": null }
}
}
Use an empty string only when you deliberately want an "empty value" that you can filter on; use null/remove() when you want the tag to be unset again.
Comments
0 comments
Please sign in to leave a comment.