SetTag/DeleteTag
[Player Network SDK & MSDK] Games can set different tags for users, such as gender, age, education background, hobbies, and so on. Player Network SDK provides a set of default tags for games to push specified notifications to the target audience.
Sending tagged notifications is the same as sending regular notifications. Games only need to select a tag to send the push notifications to the tagged audience.
Tag format: Tags cannot contain space.
Supported Platform
- Unity
- Unreal Engine
Android, iOS
platform.Android, iOS
platform.Function Definition
- Unity
- Unreal Engine
// Set tag
void SetTag(string channel, string tag);
// Delet tag
public static void DeleteTag(string channel, string tag);
// Set tag
static void SetTag(const std::string &channel, const std::string &tag);
// Delet tag
static void DeleteTag(const std::string &channel, const std::string &tag);
Input Parameters
- Unity
- Unreal Engine
Parameter | Type | Description |
---|---|---|
channel | string | The specified channel to push notifications. Example: "Firebase"" |
tag | string | Tag Cannot be null or contain spaces. |
Parameter | Type | Description |
---|---|---|
channel | std::string | The specified channel to push notifications. Example: "Firebase" |
tag | std::string | Tag Cannot be null or contain spaces. |
Callback Processing
The callback processing API is GUAPushBaseResultObserver. The callback data structure is GUABaseResult.
- Unity
- Unreal Engine
The callback event is PushBaseResultEvents.
The callback methodID is GUA_PUSH_SET_TAG
,GUA_PUSH_DELETE_TAG
.
The callback event is OnPushOptNotify.
The callback methodID is kMethodIDPushSetTag
,kMethodIDPushDeleteTag
.
Code Sample
- Unity
- Unreal Engine
// Set tag
UnionAdapterAPI.GetPushService().SetTag("Firebase", "tag");
// Delet tag
UnionAdapterAPI.GetPushService().DeleteTag("Firebase", "Tag");
// Set tag
GUA_NAMESPACE::GUAPushService::SetTag("Firebase", "tag");
// Delet tag
GUA_NAMESPACE::GUAPushService::DeleteTag("Firebase", "Tag");