Exemplo n.º 1
0
            // Method must be lowercase to match Android method signature.
            public void onFinishedEventTrackingFailed(AndroidJavaObject eventFailureData)
            {
                if (callback == null)
                {
                    return;
                }

                if (eventFailureData == null)
                {
                    return;
                }

                AdjustEventFailure adjustEventFailure = new AdjustEventFailure();

                adjustEventFailure.Adid       = eventFailureData.Get <string>(AdjustUtils.KeyAdid);
                adjustEventFailure.Message    = eventFailureData.Get <string>(AdjustUtils.KeyMessage);
                adjustEventFailure.WillRetry  = eventFailureData.Get <bool>(AdjustUtils.KeyWillRetry);
                adjustEventFailure.Timestamp  = eventFailureData.Get <string>(AdjustUtils.KeyTimestamp);
                adjustEventFailure.EventToken = eventFailureData.Get <string>(AdjustUtils.KeyEventToken);

                try
                {
                    AndroidJavaObject ajoJsonResponse    = eventFailureData.Get <AndroidJavaObject>(AdjustUtils.KeyJsonResponse);
                    string            jsonResponseString = ajoJsonResponse.Call <string>("toString");
                    adjustEventFailure.BuildJsonResponseFromString(jsonResponseString);
                }
                catch (Exception)
                {
                    // JSON response reading failed.
                }

                callback(adjustEventFailure);
            }
Exemplo n.º 2
0
            // Method must be lowercase to match Android method signature.
            public void onFinishedEventTrackingFailed(AndroidJavaObject eventFailureData)
            {
                if (callback == null)
                {
                    return;
                }
                if (eventFailureData == null)
                {
                    return;
                }

                AdjustEventFailure adjustEventFailure = new AdjustEventFailure();

                adjustEventFailure.Adid = eventFailureData.Get <string>(AdjustUtils.KeyAdid) == "" ?
                                          null : eventFailureData.Get <string>(AdjustUtils.KeyAdid);
                adjustEventFailure.Message = eventFailureData.Get <string>(AdjustUtils.KeyMessage) == "" ?
                                             null : eventFailureData.Get <string>(AdjustUtils.KeyMessage);
                adjustEventFailure.WillRetry = eventFailureData.Get <bool>(AdjustUtils.KeyWillRetry);
                adjustEventFailure.Timestamp = eventFailureData.Get <string>(AdjustUtils.KeyTimestamp) == "" ?
                                               null : eventFailureData.Get <string>(AdjustUtils.KeyTimestamp);
                adjustEventFailure.EventToken = eventFailureData.Get <string>(AdjustUtils.KeyEventToken) == "" ?
                                                null : eventFailureData.Get <string>(AdjustUtils.KeyEventToken);
                adjustEventFailure.CallbackId = eventFailureData.Get <string>(AdjustUtils.KeyCallbackId) == "" ?
                                                null : eventFailureData.Get <string>(AdjustUtils.KeyCallbackId);

                try
                {
                    AndroidJavaObject ajoJsonResponse    = eventFailureData.Get <AndroidJavaObject>(AdjustUtils.KeyJsonResponse);
                    string            jsonResponseString = ajoJsonResponse.Call <string>("toString");
                    adjustEventFailure.BuildJsonResponseFromString(jsonResponseString);
                }
                catch (Exception)
                {
                    // JSON response reading failed.
                    // Native Android SDK should send empty JSON object if none available as of v4.12.5.
                    // Native Android SDK added special logic to send Unity friendly values as of v4.15.0.
                }

                callback(adjustEventFailure);
            }
Exemplo n.º 3
0
 public void onFinishedEventTrackingFailed(AndroidJavaObject eventFailureData)
 {
     if (callback != null && eventFailureData != null)
     {
         AdjustEventFailure adjustEventFailure = new AdjustEventFailure();
         adjustEventFailure.Adid       = ((!(eventFailureData.Get <string>(AdjustUtils.KeyAdid) == string.Empty)) ? eventFailureData.Get <string>(AdjustUtils.KeyAdid) : null);
         adjustEventFailure.Message    = ((!(eventFailureData.Get <string>(AdjustUtils.KeyMessage) == string.Empty)) ? eventFailureData.Get <string>(AdjustUtils.KeyMessage) : null);
         adjustEventFailure.WillRetry  = eventFailureData.Get <bool>(AdjustUtils.KeyWillRetry);
         adjustEventFailure.Timestamp  = ((!(eventFailureData.Get <string>(AdjustUtils.KeyTimestamp) == string.Empty)) ? eventFailureData.Get <string>(AdjustUtils.KeyTimestamp) : null);
         adjustEventFailure.EventToken = ((!(eventFailureData.Get <string>(AdjustUtils.KeyEventToken) == string.Empty)) ? eventFailureData.Get <string>(AdjustUtils.KeyEventToken) : null);
         adjustEventFailure.CallbackId = ((!(eventFailureData.Get <string>(AdjustUtils.KeyCallbackId) == string.Empty)) ? eventFailureData.Get <string>(AdjustUtils.KeyCallbackId) : null);
         try
         {
             AndroidJavaObject androidJavaObject  = eventFailureData.Get <AndroidJavaObject>(AdjustUtils.KeyJsonResponse);
             string            jsonResponseString = androidJavaObject.Call <string>("toString", new object[0]);
             adjustEventFailure.BuildJsonResponseFromString(jsonResponseString);
         }
         catch (Exception)
         {
         }
         callback(adjustEventFailure);
     }
 }