File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -434,8 +434,19 @@ class OSButtons extends React.Component<Props> {
434434 const trackEventButton = renderButtonView ( 'Track Event' , ( ) => {
435435 loggingFunction ( 'Tracking event: ' , 'ReactNative' ) ;
436436 const platform = Platform . OS ; // This will be 'ios' or 'android'
437+ OneSignal . User . trackEvent ( `ReactNative-${ platform } -noprops` ) ;
437438 OneSignal . User . trackEvent ( `ReactNative-${ platform } ` , {
438- DEF : '456' ,
439+ someNum : 123 ,
440+ someString : 'abc' ,
441+ someBool : true ,
442+ someObject : {
443+ abc : '123' ,
444+ nested : {
445+ def : '456' ,
446+ } ,
447+ } ,
448+ someArray : [ 1 , 2 , 3 ] ,
449+ someNull : null ,
439450 } ) ;
440451 } ) ;
441452
Original file line number Diff line number Diff line change @@ -613,8 +613,9 @@ export namespace OneSignal {
613613 ) {
614614 if ( ! isNativeModuleLoaded ( RNOneSignal ) ) return ;
615615
616- if ( ! isObjectSerializable ( properties ) ) {
617- return console . error ( 'Properties must be JSON-serializable' ) ;
616+ if ( ! isObjectSerializable ( properties ?? { } ) ) {
617+ console . error ( 'Properties must be JSON-serializable' ) ;
618+ return ;
618619 }
619620
620621 RNOneSignal . trackEvent ( name , properties ) ;
You can’t perform that action at this time.
0 commit comments