File tree 1 file changed +3
-5
lines changed
1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -433,8 +433,8 @@ export namespace OneSignal {
433
433
export function addTag ( key : string , value : string ) {
434
434
if ( ! isNativeModuleLoaded ( RNOneSignal ) ) return ;
435
435
436
- if ( ! key || ! value ) {
437
- console . error ( 'OneSignal: sendTag : must include a key and a value' ) ;
436
+ if ( ! key || value === undefined || value === null ) {
437
+ console . error ( 'OneSignal: addTag : must include a key and a value' ) ;
438
438
return ;
439
439
}
440
440
@@ -464,9 +464,7 @@ export namespace OneSignal {
464
464
const convertedTags = tags as { [ key : string ] : any } ;
465
465
Object . keys ( tags ) . forEach ( function ( key ) {
466
466
// forces values to be string types
467
- if ( typeof convertedTags [ key ] !== 'string' ) {
468
- convertedTags [ key ] = JSON . stringify ( convertedTags [ key ] ) ;
469
- }
467
+ convertedTags [ key ] = String ( convertedTags [ key ] ) ;
470
468
} ) ;
471
469
472
470
RNOneSignal . addTags ( tags ) ;
You can’t perform that action at this time.
0 commit comments