// Method must be lowercase to match Android method signature. public void onFinishedSessionTrackingSucceeded(AndroidJavaObject sessionSuccessData) { if (callback == null) { return; } if (sessionSuccessData == null) { return; } AdjustSessionSuccess adjustSessionSuccess = new AdjustSessionSuccess(); adjustSessionSuccess.Adid = sessionSuccessData.Get <string>(AdjustUtils.KeyAdid) == "" ? null : sessionSuccessData.Get <string>(AdjustUtils.KeyAdid); adjustSessionSuccess.Message = sessionSuccessData.Get <string>(AdjustUtils.KeyMessage) == "" ? null : sessionSuccessData.Get <string>(AdjustUtils.KeyMessage); adjustSessionSuccess.Timestamp = sessionSuccessData.Get <string>(AdjustUtils.KeyTimestamp) == "" ? null : sessionSuccessData.Get <string>(AdjustUtils.KeyTimestamp); try { AndroidJavaObject ajoJsonResponse = sessionSuccessData.Get <AndroidJavaObject>(AdjustUtils.KeyJsonResponse); string jsonResponseString = ajoJsonResponse.Call <string>("toString"); adjustSessionSuccess.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(adjustSessionSuccess); }
// Method must be lowercase to match Android method signature. public void onFinishedSessionTrackingSucceeded(AndroidJavaObject sessionSuccessData) { if (callback == null) { return; } if (sessionSuccessData == null) { return; } AdjustSessionSuccess adjustSessionSuccess = new AdjustSessionSuccess(); adjustSessionSuccess.Adid = sessionSuccessData.Get <string>(AdjustUtils.KeyAdid); adjustSessionSuccess.Message = sessionSuccessData.Get <string>(AdjustUtils.KeyMessage); adjustSessionSuccess.Timestamp = sessionSuccessData.Get <string>(AdjustUtils.KeyTimestamp); try { AndroidJavaObject ajoJsonResponse = sessionSuccessData.Get <AndroidJavaObject>(AdjustUtils.KeyJsonResponse); string jsonResponseString = ajoJsonResponse.Call <string>("toString"); adjustSessionSuccess.BuildJsonResponseFromString(jsonResponseString); } catch (Exception) { // JSON response reading failed. } callback(adjustSessionSuccess); }
public void onFinishedSessionTrackingSucceeded(AndroidJavaObject sessionSuccessData) { if (callback != null && sessionSuccessData != null) { AdjustSessionSuccess adjustSessionSuccess = new AdjustSessionSuccess(); adjustSessionSuccess.Adid = ((!(sessionSuccessData.Get <string>(AdjustUtils.KeyAdid) == string.Empty)) ? sessionSuccessData.Get <string>(AdjustUtils.KeyAdid) : null); adjustSessionSuccess.Message = ((!(sessionSuccessData.Get <string>(AdjustUtils.KeyMessage) == string.Empty)) ? sessionSuccessData.Get <string>(AdjustUtils.KeyMessage) : null); adjustSessionSuccess.Timestamp = ((!(sessionSuccessData.Get <string>(AdjustUtils.KeyTimestamp) == string.Empty)) ? sessionSuccessData.Get <string>(AdjustUtils.KeyTimestamp) : null); try { AndroidJavaObject androidJavaObject = sessionSuccessData.Get <AndroidJavaObject>(AdjustUtils.KeyJsonResponse); string jsonResponseString = androidJavaObject.Call <string>("toString", new object[0]); adjustSessionSuccess.BuildJsonResponseFromString(jsonResponseString); } catch (Exception) { } callback(adjustSessionSuccess); } }