I am trying to read the user consent choice by following this guide. However, running that code results in this error:
Error Unity Cannot get an ApplicationPreferences instance: java.lang.ClassNotFoundException: com.google.unity.ads.UnityApplicationPreferences
I tried adding this rule to proguard and expected the error to go away, but it still appears.
-keep class com.google.unity.ads.** { *; }
Steps to reproduce:
After the user is done with the consent flow, I run the code mentioned here.
Relevant Code:
// Example value: "1111111111"
string purposeConsents = ApplicationPreferences.GetString("IABTCF_PurposeConsents");
// Purposes are zero-indexed. Index 0 contains information about Purpose 1.
if (!string.IsNullOrEmpty(purposeConsents))
{
char purposeOneString = purposeConsents[0];
bool hasConsentForPurposeOne = purposeOneString == '1';
}
[REQUIRED] Step 1: Describe your environment
[REQUIRED] Step 2: Describe the problem
I am trying to read the user consent choice by following this guide. However, running that code results in this error:
Error Unity Cannot get an ApplicationPreferences instance: java.lang.ClassNotFoundException: com.google.unity.ads.UnityApplicationPreferences
I tried adding this rule to proguard and expected the error to go away, but it still appears.
-keep class com.google.unity.ads.** { *; }
Steps to reproduce:
After the user is done with the consent flow, I run the code mentioned here.
Relevant Code: