Skip to content

Commit 8bcfdde

Browse files
rgomezpjkasten2
authored andcommitted
Fixed bug where sending tag value 'false' removes the tag
1 parent d55dd3f commit 8bcfdde

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,12 +236,22 @@ export default class OneSignal {
236236
static sendTag(key, value) {
237237
if (!checkIfInitialized()) return;
238238

239+
if (typeof value !== "string") {
240+
value = JSON.stringify(value);
241+
}
242+
239243
RNOneSignal.sendTag(key, value);
240244
}
241245

242246
static sendTags(tags) {
243247
if (!checkIfInitialized()) return;
244248

249+
Object.keys(tags).forEach((key)=>{
250+
if (typeof tags[key] !== "string"){
251+
tags[key] = JSON.stringify(tags[key]);
252+
}
253+
})
254+
245255
RNOneSignal.sendTags(tags || {});
246256
}
247257

0 commit comments

Comments
 (0)