yandexmobile / metrica-plugin-unity

Unity plugin for Yandex AppMetrica SDK
38 stars 18 forks source link

ios crash on ReportRevenue #36

Closed boris-741 closed 3 years ago

boris-741 commented 3 years ago

ios crash on ReportRevenue ` 2021-02-19 14:24:36.633641+0300 tribe[3610:1071331] Uncaught exception: NSInvalidArgumentException: *** -[_NSPlaceholderData initWithBase64EncodedString:options:]: nil string argument ( 0 CoreFoundation 0x000000019f0b39ec F3021642-E3C0-33F8-9911-DD303A6056D0 + 1157612 1 libobjc.A.dylib 0x00000001b3439b54 objc_exception_throw + 56 2 Foundation 0x00000001a02cb354 712A564E-5058-3EAC-AF3A-43BBD43D0D7E + 549716 3 tribe 0x0000000104a702a0 ymm_revenueFromDictionary + 812 4 tribe 0x0000000104a7039c ymm_reportRevenueJSON + 96 5 tribe 0x0000000105bcbf44 YandexAppMetricaIOS_ReportRevenue_mA3265F111F102C7262894692A421BA9FD26FBEBE + 84

`

GLinnik21 commented 3 years ago

Hi. Thank you for reporting this crash! Could you please provide the version of the SDK and how frequently this crash reproduces?

boris-741 commented 3 years ago

it's my fault i used the old code this code works on Android but does not work in iOS

IYandexAppMetrica metrica = AppMetrica.Instance; YandexAppMetricaRevenue data = new YandexAppMetricaRevenue(purchase_value, purchase_currency); YandexAppMetricaReceipt recipient = new YandexAppMetricaReceipt(); recipient.TransactionID = (string)param[AnalyticParam.purchase_transaction_id]; data.Receipt = recipient; data.ProductID = purchase_product_id; data.Quantity = 1; metrica.ReportRevenue(data)