コード例 #1
0
        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);
                }
            }
        }
コード例 #2
0
        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);
                }
            }
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
            }
        }