void OnCustomConsentGDPRCallback(string jsonSPGDPRConsent) { CmpDebugUtil.Log("OnCustomConsentGDPRCallback IOS_CALLBACK_RECEIVED: " + jsonSPGDPRConsent); GdprConsent unwrapped = null; try { unwrapped = JsonUnwrapper.UnwrapGdprConsent(jsonSPGDPRConsent); } catch (Exception ex) { Debug.LogError( "Something went wrong while parsing the json data; null will be returned. \n Exception message: " + ex.Message); } finally { if (unwrapped == null) { onCustomConsentsGDPRSuccessAction?.Invoke(null); } else { customGdprConsent = unwrapped; onCustomConsentsGDPRSuccessAction?.Invoke(unwrapped); } } }
void transferCustomConsentToUnity(string spConsentsJson) { CmpDebugUtil.Log("transferCustomConsentToUnitySide c#-side custom consent ->" + spConsentsJson.ToString()); SpCustomConsentAndroid parsed = null; try { parsed = JsonUnwrapper.UnwrapSpCustomConsentAndroid(spConsentsJson); } catch (Exception ex) { Debug.LogError("Something went wrong while parsing the json data; null will be returned. \n Exception message: " + ex.Message); } finally { if (parsed == null) { callback?.Invoke(null); } else { var spGdpr = JsonUnwrapper.UnwrapSpGdprConsentAndroid(parsed.gdpr); customGdprConsent = spGdpr.consents; callback?.Invoke(customGdprConsent); } } }
void onConsentReady(string spConsents) { CmpDebugUtil.Log("I've reached the C# onConsentReady with json string: " + spConsents); SpConsents consents = JsonUnwrapper.UnwrapSpConsentsAndroid(spConsents); _spConsents = consents; ConsentMessenger.Broadcast <IOnConsentReady>(consents); }
void OnConsentReady(string message) { CmpDebugUtil.Log("OnConsentReady IOS_CALLBACK_RECEIVED: " + message); SpConsents spConsents = null; try { spConsents = JsonUnwrapper.UnwrapSpConsents(message); } catch (Exception ex) { Debug.LogError( "Something went wrong while parsing the json data; null will be returned. \n Exception message: " + ex.Message); } finally { _spConsents = spConsents; ConsentMessenger.Broadcast <IOnConsentReady>(spConsents); } }