@@ -369,12 +369,16 @@ private void Config()
369
369
_testLibrary . AddInfoToSend ( "cost_amount" , attribution . CostAmount . ToString ( ) ) ;
370
370
_testLibrary . AddInfoToSend ( "cost_currency" , attribution . CostCurrency ) ;
371
371
_testLibrary . AddInfoToSend ( "fb_install_referrer" , attribution . FbInstallReferrer ) ;
372
- var updatedJsonResponse = new Dictionary < string , object > ( attribution . JsonResponse ) ;
373
372
#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 )
376
375
{
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
+ }
378
382
}
379
383
_testLibrary . AddInfoToSend ( "json_response" , JsonConvert . SerializeObject ( updatedJsonResponse ) ) ;
380
384
#else
@@ -974,12 +978,16 @@ private void AttributionGetter()
974
978
_testLibrary . AddInfoToSend ( "cost_amount" , attribution . CostAmount . ToString ( ) ) ;
975
979
_testLibrary . AddInfoToSend ( "cost_currency" , attribution . CostCurrency ) ;
976
980
_testLibrary . AddInfoToSend ( "fb_install_referrer" , attribution . FbInstallReferrer ) ;
977
- var updatedJsonResponse = new Dictionary < string , object > ( attribution . JsonResponse ) ;
978
981
#if UNITY_IOS
979
- updatedJsonResponse . Remove ( "fb_install_referrer" ) ;
980
- if ( updatedJsonResponse . TryGetValue ( "cost_amount" , out var costAmount ) && costAmount is IConvertible )
982
+ var updatedJsonResponse = new Dictionary < string , object > ( ) ;
983
+ if ( attribution . JsonResponse != null )
981
984
{
982
- updatedJsonResponse [ "cost_amount" ] = string . Format ( "{0:0.00}" , System . Convert . ToDouble ( costAmount ) ) ;
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
+ }
983
991
}
984
992
_testLibrary . AddInfoToSend ( "json_response" , JsonConvert . SerializeObject ( updatedJsonResponse ) ) ;
985
993
#else
0 commit comments