Skip to content

Commit 1bdb3c4

Browse files
committed
convert dynamic tag values to strings
1 parent 58451b5 commit 1bdb3c4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/src/user.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class OneSignalUser {
5252
/// specific users and/or personalizing messages. If the tag [key] already
5353
/// exists, it will be replaced with the [value] provided here.
5454
Future<void> addTagWithKey(String key, dynamic value) async {
55-
return await this.addTags({key: value});
55+
return await this.addTags({key: value.toString()});
5656
}
5757

5858
/// Add multiple [tags] for the current user.
@@ -61,6 +61,9 @@ class OneSignalUser {
6161
/// specific users and/or personalizing messages. If the tag key already
6262
/// exists, it will be replaced with the value provided here.
6363
Future<void> addTags(Map<String, dynamic> tags) async {
64+
tags.forEach((key, value) {
65+
tags[key] = value.toString();
66+
});
6467
return await _channel.invokeMethod("OneSignal#addTags", tags);
6568
}
6669

0 commit comments

Comments
 (0)