apphud / ApphudSDK-Unity

Apphud Unity SDK
MIT License
2 stars 1 forks source link

Add AppsFlyer attribution not working #3

Open shamruk opened 2 weeks ago

shamruk commented 2 weeks ago

I'm calling ApphudSDK.AddAttribution(ApphudAttributionProvider.appsFlyer, null, AppsFlyer.getAppsFlyerId());

I'm getting the following error during this line call Error during JSON deserialization: The data couldn’t be read because it isn’t in the correct

By the way, there is a check while serialization data != null ? JsonConvert.SerializeObject(data) but something is wrong later.

In documentation the data seems to be optional. If it is not true: should I pass this:

    class ... IAppsFlyerConversionData {

        public void onConversionDataSuccess(string conversionData) {
            var data = AppsFlyer.CallbackStringToDictionary(conversionData);
            ApphudSDK.AddAttribution(ApphudAttributionProvider.appsFlyer, data, AppsFlyer.getAppsFlyerId());
        }

        public void onConversionDataFail(string error) {
            var data = new Dictionary<string, object> {
                ["error"] = error,
            };
            ApphudSDK.AddAttribution(ApphudAttributionProvider.appsFlyer, data, AppsFlyer.getAppsFlyerId());
        }

This is some combination of AppsFlyer docs and Apphud swift examples

shamruk commented 1 week ago

It works fine now when I'm sending data. I'm leaving the issue open because in comments to code and documentation, the data is described as optional, and null is causing an error.