Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #671 from OneSignal/add-getTags
Browse files Browse the repository at this point in the history
Add public getTags() method that returns tags from the local user
jinliu9508 committed Feb 27, 2024
2 parents 19a3acf + e915fab commit fb59306
Showing 18 changed files with 294 additions and 186 deletions.
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
"versionDefines": [
{
"name": "com.onesignal.unity.core",
"expression": "5.0.0",
"expression": "5.0.5",
"define": "ONE_SIGNAL_INSTALLED"
}
],
4 changes: 4 additions & 0 deletions OneSignalExample/Assets/OneSignal/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -16,6 +16,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Updated included iOS SDK to [5.0.4](https://github.com/OneSignal/OneSignal-iOS-SDK/releases/tag/5.0.4)

## [5.0.5]
### Changed
- Add public get tags method
- Updated included Android SDK to [5.0.5](https://github.com/OneSignal/OneSignal-Android-SDK/releases/tag/5.0.5)
- Updated included iOS SDK to [5.0.5](https://github.com/OneSignal/OneSignal-iOS-SDK/releases/tag/5.0.5)
### Fixed
- Included meta files in OneSignalConfig.androidlib to prevent asset from being ignored
- Package download url in the "Sync example code bundle package" step from the OneSignal SDK Setup
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
"versionDefines": [
{
"name": "com.onesignal.unity.core",
"expression": "5.0.0",
"expression": "5.0.5",
"define": "ONE_SIGNAL_INSTALLED"
}
],
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@
"versionDefines": [
{
"name": "com.onesignal.unity.core",
"expression": "5.0.0",
"expression": "5.0.5",
"define": "ONE_SIGNAL_INSTALLED"
}
],
Original file line number Diff line number Diff line change
@@ -371,6 +371,16 @@ public void AddTag() {
public void RemoveTag() {
_log($"Removing tag for key <b>{tagKey}</b>");
OneSignal.User.RemoveTag(tagKey);

}

public void GetTags() {
Dictionary<string, string> dict = OneSignal.User.GetTags();
string dictionaryString = "{";
foreach(KeyValuePair <string, string> keyValues in dict) {
dictionaryString += keyValues.Key + " : " + keyValues.Value + ", ";
}
_log($"Get all user tags " + dictionaryString.TrimEnd(',', ' ') + "}");
}

/*
Loading

0 comments on commit fb59306

Please sign in to comment.