@@ -369,15 +369,24 @@ private void Config()
369369 _testLibrary . AddInfoToSend ( "cost_amount" , attribution . CostAmount . ToString ( ) ) ;
370370 _testLibrary . AddInfoToSend ( "cost_currency" , attribution . CostCurrency ) ;
371371 _testLibrary . AddInfoToSend ( "fb_install_referrer" , attribution . FbInstallReferrer ) ;
372- var updatedJsonResponse = new Dictionary < string , object > ( attribution . JsonResponse ) ;
373372#if UNITY_IOS
374- updatedJsonResponse . Remove ( "fb_install_referrer" ) ;
375- if ( updatedJsonResponse . TryGetValue ( "cost_amount" , out var costAmount ) && costAmount is IConvertible )
373+ var updatedJsonResponse = new Dictionary < string , object > ( ) ;
374+ if ( attribution . JsonResponse != null )
376375 {
377- updatedJsonResponse [ "cost_amount" ] = string . Format ( "{0:0.00}" , System . Convert . ToDouble ( costAmount ) ) ;
376+ updatedJsonResponse = new Dictionary < string , object > ( attribution . JsonResponse ) ;
377+ updatedJsonResponse . Remove ( "fb_install_referrer" ) ;
378+ if ( updatedJsonResponse . TryGetValue ( "cost_amount" , out var costAmount ) && costAmount is IConvertible )
379+ {
380+ updatedJsonResponse [ "cost_amount" ] = string . Format ( "{0:0.00}" , System . Convert . ToDouble ( costAmount ) ) ;
381+ }
378382 }
379- #endif
380383 _testLibrary . AddInfoToSend ( "json_response" , JsonConvert . SerializeObject ( updatedJsonResponse ) ) ;
384+ #else
385+ if ( attribution . JsonResponse != null )
386+ {
387+ _testLibrary . AddInfoToSend ( "json_response" , attribution . GetJsonResponseAsString ( ) ) ;
388+ }
389+ #endif
381390 _testLibrary . SendInfoToServer ( localExtraPath ) ;
382391 } ) ;
383392 }
@@ -969,15 +978,24 @@ private void AttributionGetter()
969978 _testLibrary . AddInfoToSend ( "cost_amount" , attribution . CostAmount . ToString ( ) ) ;
970979 _testLibrary . AddInfoToSend ( "cost_currency" , attribution . CostCurrency ) ;
971980 _testLibrary . AddInfoToSend ( "fb_install_referrer" , attribution . FbInstallReferrer ) ;
972- var updatedJsonResponse = new Dictionary < string , object > ( attribution . JsonResponse ) ;
973981#if UNITY_IOS
974- updatedJsonResponse . Remove ( "fb_install_referrer" ) ;
975- if ( updatedJsonResponse . TryGetValue ( "cost_amount" , out var costAmount ) && costAmount is IConvertible )
982+ var updatedJsonResponse = new Dictionary < string , object > ( ) ;
983+ if ( attribution . JsonResponse != null )
984+ {
985+ updatedJsonResponse = new Dictionary < string , object > ( attribution . JsonResponse ) ;
986+ updatedJsonResponse . Remove ( "fb_install_referrer" ) ;
987+ if ( updatedJsonResponse . TryGetValue ( "cost_amount" , out var costAmount ) && costAmount is IConvertible )
988+ {
989+ updatedJsonResponse [ "cost_amount" ] = string . Format ( "{0:0.00}" , System . Convert . ToDouble ( costAmount ) ) ;
990+ }
991+ }
992+ _testLibrary . AddInfoToSend ( "json_response" , JsonConvert . SerializeObject ( updatedJsonResponse ) ) ;
993+ #else
994+ if ( attribution . JsonResponse != null )
976995 {
977- updatedJsonResponse [ "cost_amount" ] = string . Format ( "{0:0.00} ", System . Convert . ToDouble ( costAmount ) ) ;
996+ _testLibrary . AddInfoToSend ( "json_response ", attribution . GetJsonResponseAsString ( ) ) ;
978997 }
979998#endif
980- _testLibrary . AddInfoToSend ( "json_response" , JsonConvert . SerializeObject ( updatedJsonResponse ) ) ;
981999 _testLibrary . SendInfoToServer ( localExtraPath ) ;
9821000 } ) ;
9831001 }
0 commit comments