You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using Unity SDK i cannot find the related repository so sorry for posting here.
Choice SDK Version is 2.0.0
Below is the implementation of Choice SDK class.
using System;
using System.Collections;
using UnityEngine;
public class InMobiController : MonoBehaviour
{
public GameEvent OnPlayerConsent;
public GameEvent OnCMPDidErrorEvent;
private const string pCode = "mycodewithout p- ";
public static InMobiController instance = null;
private bool isConsent = false;
private void Awake()
{
if (instance == null)
{
instance = this;
SubEvents();
ChoiceCMP.ChoiceLogLevel = ChoiceCMP.LogLevel.Debug;
DontDestroyOnLoad(gameObject);
}
else
{
Destroy(this);
}
}
private void Start()
{
StartCoroutine(DelayedStartChoice());
}
private IEnumerator DelayedStartChoice()
{
yield return new WaitForSeconds(1f);
Debug.Log("Is ChoiceCMP ready to start? Logging SDK state before StartChoice");
ChoiceCMP.StartChoice(pCode);
Debug.Log($"After Start Choice P-Code {pCode}");
}
public void ForceDisplayUI()
{
ChoiceCMP.ForceDisplayUI();
}
public void ShowCCPA()
{
ChoiceCMP.ShowCCPA();
}
private void SubEvents() {
ChoiceCMPManager.CMPDidLoadEvent += delegate (PingResult pingResult)
{
// Fired when the SDK has finished loading
Debug.Log($"CMPDidLoadEvent");
};
ChoiceCMPManager.CMPDidErrorEvent += delegate (string error)
{
// Fired when SDK fails to load
Debug.Log($"CMPDidErrorEvent {error}");
OnCMPDidErrorEvent.Raise(this,error);
StartCoroutine(DelayedStartChoice());
};
ChoiceCMPManager.CMPDidShowEvent += delegate (PingResult pingResult)
{
// Fired when popup is shown
Debug.Log("CMPDidShowEvent");
};
ChoiceCMPManager.CMPDidReceiveAdditionalConsentEvent += delegate (ACData acData)
{
// Fired when on receiving the Additional Consent
Debug.Log($"CMPDidReceiveAdditionalConsentEvent {acData.acString}");
if (!isConsent) {
isConsent = true;
OnPlayerConsent.Raise(this, null);
}
};
ChoiceCMPManager.CMPDidReceiveCCPAConsentEvent += delegate (string ccpaConsent)
{
// Fired when on receiving the CCPA Consent
Debug.Log($"CMPDidReceiveCCPAConsentEvent {ccpaConsent}");
if (!isConsent)
{
isConsent = true;
OnPlayerConsent.Raise(this, null);
}
//OnPlayerConsent.Raise(this, null);
};
ChoiceCMPManager.CMPDidShowEvent += delegate (PingResult result) {
Debug.Log($"Api Version: {result.apiVersion}\n Loaded:{result.cmpLoaded}\n Status: {result.cmpStatus}\n Display Status: {result.displayStatus}\n ToString:{result.ToString()}");
};
ChoiceCMPManager.CMPUserDidMoveToOtherState += delegate {
Debug.Log("User Did Move To Other State");
};
ChoiceCMPManager.CMPDidReceiveNonIABVendorConsentEvent += delegate (NonIABData nonIABData)
{
// Fired when on receiving the NON IAB Vendor Consent
if (!isConsent)
{
isConsent = true;
OnPlayerConsent.Raise(this, null);
}
//OnPlayerConsent.Raise(this, null);
Debug.Log($"CMPDidReceiveNonIABVendorConsentEvent {nonIABData.gdprApplies}");
};
}
}
Below are the Unity Logs from Choice SDK
2024/10/15 11:41:58.381 23366 23448 Info Unity [InMobiCMP-Unity] [StartChoice] Choice initialization started
2024/10/15 11:41:58.390 23366 23448 Info Unity [InMobiCMP-Unity] [StartChoice] Choice initialized successfully.
I added a button for testing purposes to trigger the ForceDisplayUI() method. When i clicked it. The below errror logged in the console.
2024/10/15 11:46:20.018 23366 23448 Info Unity [InMobiCMP-Unity] [EmitCMPDidErrorEvent] Choice failed to load, error: SDK must be initialized first by calling startChoice method
Can anyone help. We cannot show the consent dialog.
And also the .gradle file outliened as the documentation
The text was updated successfully, but these errors were encountered:
ctykaya
changed the title
The consent dialog does not appear event if the first launch of the app.
The consent dialog does not appear even if the first launch of the app.
Oct 15, 2024
We are using Unity SDK i cannot find the related repository so sorry for posting here.
Choice SDK Version is 2.0.0
Below is the implementation of Choice SDK class.
Below are the Unity Logs from Choice SDK
I added a button for testing purposes to trigger the ForceDisplayUI() method. When i clicked it. The below errror logged in the console.
Can anyone help. We cannot show the consent dialog.
And also the .gradle file outliened as the documentation
The text was updated successfully, but these errors were encountered: