File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -433,8 +433,8 @@ export namespace OneSignal {
433433 export function addTag ( key : string , value : string ) {
434434 if ( ! isNativeModuleLoaded ( RNOneSignal ) ) return ;
435435
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' ) ;
438438 return ;
439439 }
440440
@@ -464,9 +464,7 @@ export namespace OneSignal {
464464 const convertedTags = tags as { [ key : string ] : any } ;
465465 Object . keys ( tags ) . forEach ( function ( key ) {
466466 // 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 ] ) ;
470468 } ) ;
471469
472470 RNOneSignal . addTags ( tags ) ;
You can’t perform that action at this time.
0 commit comments