private IEnumerator WaitNetworkCoroutine()
    {
        if (!viewId.Equals("HomeView") && !viewId.Equals("PrivacyPolicyView") && !CmpLocalizationMapper.IsCurrentCampaignPmInitialized())
        {
            while (!CmpLocalizationMapper.IsCurrentCampaignPmInitialized())
            {
                yield return(new WaitForEndOfFrame());
            }
        }
        while (!CmpLocalizationMapper.IsInitialized)
        {
            yield return(new WaitForEndOfFrame());
        }

        if (!CmpLocalizationMapper.IsConsented || CmpLocalizationMapper.IsPmReadyForResurface)
        {
            SetBgColor();
            MapLocalization();
            MapPostponedLocalization();
            FillPostponedData();
            if (scrollController is CmpHomeScrollController home &&
                CmpLocalizationMapper.shortCategories != null &&
                CmpLocalizationMapper.shortCategories.Count > 0)
            {
                home.FillShortCategories(CmpLocalizationMapper.shortCategories);
            }
        }
        else
        {
            CmpPopupDestroyer.DestroyAllPopups();
        }
    }
Example #2
0
    private static void OnConsentSuccessCallback(string json)
    {
        var consent = JsonSerializer.Deserialize <PostConsentResponse>(json);

        SaveContext.SaveLocalState(consent.localState);
        CmpPopupDestroyer.DestroyAllPopups();
        switch (CmpCampaignPopupQueue.CurrentCampaignToShow())
        {
        case 0:
            gdprUserConsent = consent.userConsent;
            SaveContext.SaveGdprUserConsent(gdprUserConsent);
            gdprUserConsent.uuid = consent.uuid;
            isGdprConsented      = true;
            CmpCampaignPopupQueue.DequeueCampaignId();
            break;

        case 2:
            ccpaUserConsent = consent.userConsent;
            SaveContext.SaveCcpaUserConsent(ccpaUserConsent);
            ccpaUserConsent.uuid = consent.uuid;
            isCcpaConsented      = true;
            CmpCampaignPopupQueue.DequeueCampaignId();
            break;
        }
        if (CmpCampaignPopupQueue.IsCampaignAvailable)
        {
            InstantiateOnCanvas(homePrefab);
        }
        else
        {
            CmpPopupDestroyer.DestroyAllHelperGO();
        }
    }
Example #3
0
 private static void OnExceptionCallback(Exception ex)
 {
     UnityEngine.Debug.LogError("All popups will be destroyed!!!");
     CmpPopupDestroyer.DestroyAllPopups();
     cmpException = ex;
     CmpCampaignPopupQueue.DequeueCampaignId();
     if (CmpCampaignPopupQueue.IsCampaignAvailable)
     {
         InstantiateOnCanvas(homePrefab);
     }
 }
Example #4
0
        public static void Dispose()
        {
#if UNITY_ANDROID && !UNITY_EDITOR
            if (Application.platform == RuntimePlatform.Android)
            {
                ConsentWrapperAndroid.Instance.Dispose();
            }
#elif UNITY_IOS && !UNITY_EDITOR_OSX
            if (Application.platform == RuntimePlatform.IPhonePlayer)
            {
                ConsentWrapperIOS.Instance.Dispose();
            }
#else
            CmpPopupDestroyer.DestroyAllPopups();
            CmpPopupDestroyer.DestroyAllHelperGO(true);
#endif
        }