void OnErrorCallback(string jsonError) { CmpDebugUtil.LogError("OnErrorCallback IOS_CALLBACK_RECEIVED: " + jsonError); Exception ex = new Exception(jsonError); ConsentMessenger.Broadcast <IOnConsentError>(ex); }
void OnConsentAction(string message) { CmpDebugUtil.Log("OnConsentAction IOS_CALLBACK_RECEIVED: " + message); CONSENT_ACTION_TYPE actionType = (CONSENT_ACTION_TYPE)Convert.ToInt32(message); ConsentMessenger.Broadcast <IOnConsentAction>(actionType); }
void onAction(AndroidJavaObject view, AndroidJavaObject actionType) { CONSENT_ACTION_TYPE unwrappedType = (CONSENT_ACTION_TYPE)actionType.Call <int>("getCode"); CmpDebugUtil.Log("I've reached the C# onAction: " + unwrappedType); ConsentMessenger.Broadcast <IOnConsentAction>(unwrappedType); }
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); }
public static void BroadcastOnConsentUIReadyIfNeeded() { if (CmpHomeScrollController.isShown) { ConsentMessenger.Broadcast <IOnConsentUIReady>(); CmpHomeScrollController.isShown = false; } }
void onError(AndroidJavaObject rawThrowableObject) { CmpDebugUtil.Log("I've reached the C# onError : " + rawThrowableObject.ToString()); Exception exception = CmpJavaToUnityUtils.ConvertThrowableToError(rawThrowableObject); CmpDebugUtil.Log("Exception converted successfully : " + exception.ToString()); ConsentMessenger.Broadcast <IOnConsentError>(exception); }
public static void BroadcastIOnConsentActionIfNeeded() { if (CmpLocalizationMapper.lastActionCode.HasValue) { ConsentMessenger.Broadcast <IOnConsentAction>(CmpLocalizationMapper.lastActionCode); CmpLocalizationMapper.lastActionCode = null; } }
public static void BroadcastIOnConsentErrorIfNeeded() { if (CmpLocalizationMapper.cmpException != null) { ConsentMessenger.Broadcast <IOnConsentError>(CmpLocalizationMapper.cmpException); CmpLocalizationMapper.cmpException = null; } }
public static void BroadcastIOnConsentUIFinishedIfNeeded() { if (CmpHomeScrollController.isDestroyed) { ConsentMessenger.Broadcast <IOnConsentUIFinished>(); CmpHomeScrollController.isDestroyed = false; } }
private void OnDestroy() { ConsentMessenger.RemoveListener <IOnConsentUIReady>(this.gameObject); ConsentMessenger.RemoveListener <IOnConsentAction>(this.gameObject); ConsentMessenger.RemoveListener <IOnConsentError>(this.gameObject); ConsentMessenger.RemoveListener <IOnConsentUIFinished>(this.gameObject); ConsentMessenger.RemoveListener <IOnConsentReady>(this.gameObject); }
void Awake() { ConsentMessenger.AddListener <IOnConsentUIReady>(this.gameObject); ConsentMessenger.AddListener <IOnConsentAction>(this.gameObject); ConsentMessenger.AddListener <IOnConsentError>(this.gameObject); ConsentMessenger.AddListener <IOnConsentUIFinished>(this.gameObject); ConsentMessenger.AddListener <IOnConsentReady>(this.gameObject); }
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); } }
public static void BroadcastIOnConsentReadyIfNeeded() { if (!CmpCampaignPopupQueue.IsCampaignAvailable && (CmpLocalizationMapper.IsGdprConsented || CmpLocalizationMapper.IsCcpaConsented) && (CmpLocalizationMapper.ccpaUserConsent != null || CmpLocalizationMapper.gdprUserConsent != null)) { SpGdprConsent gdpr = null; SpCcpaConsent ccpa = null; if (CmpLocalizationMapper.IsGdprConsented && CmpLocalizationMapper.gdprUserConsent != null && CmpLocalizationMapper.gdprUserConsent.grants != null) { var gdprConsent = new GdprConsent(); gdprConsent.euconsent = CmpLocalizationMapper.gdprUserConsent.euconsent; gdprConsent.TCData = CmpLocalizationMapper.gdprUserConsent.TCData; gdprConsent.uuid = CmpLocalizationMapper.gdprUserConsent.uuid; gdprConsent.grants = new Dictionary <string, SpVendorGrant>(); foreach (var kv in CmpLocalizationMapper.gdprUserConsent.grants) { gdprConsent.grants[kv.Key] = new SpVendorGrant(kv.Value.purposeGrants); } gdpr = new SpGdprConsent(gdprConsent); CmpLocalizationMapper.gdprUserConsent = null; } if (CmpLocalizationMapper.IsCcpaConsented && CmpLocalizationMapper.ccpaUserConsent != null) { CcpaConsent ccpaConsent = new CcpaConsent(uuid: CmpLocalizationMapper.ccpaUserConsent.uuid, status: CmpLocalizationMapper.ccpaUserConsent.status, uspstring: CmpLocalizationMapper.ccpaUserConsent.uspstring, rejectedVendors: CmpLocalizationMapper.ccpaUserConsent.rejectedVendors, rejectedCategories: CmpLocalizationMapper.ccpaUserConsent.rejectedCategories); ccpa = new SpCcpaConsent(ccpaConsent); CmpLocalizationMapper.ccpaUserConsent = null; } ConsentMessenger.Broadcast <IOnConsentReady>(new SpConsents(gdpr, ccpa)); } }
void OnConsentUIFinished(string message) { CmpDebugUtil.Log("OnConsentUIFinished IOS_CALLBACK_RECEIVED: " + message); ConsentMessenger.Broadcast <IOnConsentUIFinished>(); }
/** * It is invoked when the WebView has been already loaded with all the consent Info */ void onUIReady(AndroidJavaObject view) { CmpDebugUtil.Log("I've reached the C# onUIReady"); ConsentWrapperAndroid.Instance.CallShowView(view); ConsentMessenger.Broadcast <IOnConsentUIReady>(); }
void OnConsentUIReady(string message) { CmpDebugUtil.Log("OnConsentUIReady IOS_CALLBACK_RECEIVED: " + message); ConsentMessenger.Broadcast <IOnConsentUIReady>(message); }
/** * It is invoked when the interaction with WebView is done, consent sent and we are ready to close the WebView */ void onUIFinished(AndroidJavaObject view) { CmpDebugUtil.Log("I've reached the C# onUIFinished"); ConsentWrapperAndroid.Instance.CallRemoveView(view); ConsentMessenger.Broadcast <IOnConsentUIFinished>(); }