Register or Unregister Tag Push (SetTag/DeleteTag)
[Player Network SDK & MSDK] The game can set tags for users, such as gender, age, education, hobbies, etc. The SDK also has preset default tags, and push notifications can be targeted according to different tags.
Sending tag push messages is the same as sending push messages; the only difference is that when adding a push message, the audience scope must be set to personalized push.
When setting tags, note that ** tags must not contain spaces**.
Supported Platforms
- Unity
- Unreal Engine
Android, iOS platform.Android, iOS platform.Function Definition
- Unity
- Unreal Engine
// Register tag
void SetTag(string channel, string tag);
// Unregister tag
public static void DeleteTag(string channel, string tag);
// Register tag
static void SetTag(const std::string &channel, const std::string &tag);
// Unregister tag
static void DeleteTag(const std::string &channel, const std::string &tag);
Input Parameters
- Unity
- Unreal Engine
| Parameters | Type | Description |
|---|---|---|
| channel | string | Channel definition e.g., "Firebase" |
| tag | string | Tag Cannot be null or contain spaces |
| Parameters | Type | Description |
|---|---|---|
| channel | std::string | Channel definition e.g., "Firebase" |
| tag | std::string | Tag Cannot be null or contain spaces |
Callback Handling
The callback handling interface is GUAPushBaseResultObserver.The callback data structure is GUABaseResult.
- Unity
- Unreal Engine
The callback event is PushBaseResultEvents. The callback IDs are GUA_PUSH_SET_TAG and GUA_PUSH_DELETE_TAG.
The callback event is OnPushOptNotify. The callback IDs are kMethodIDPushSetTag, kMethodIDPushDeleteTag.
Code Example
- Unity
- Unreal Engine
// Register tag
UnionAdapterAPI.GetPushService().SetTag("Firebase", "tag");
// Unregister tag
UnionAdapterAPI.GetPushService().DeleteTag("Firebase", "Tag");
// Register tag
GUA_NAMESPACE::GUAPushService::SetTag("Firebase", "tag");
// Unregister tag
GUA_NAMESPACE::GUAPushService::DeleteTag("Firebase", "Tag");