iOS Question iAdMob Consent Custom Provider

natesobol

Member
Licensed User
Hi all,

I've been having an issue with the GDPR consent form for iAdMob. Going off of Erel's thread Here, and some google searches it seems it has to do with the limit on 12 ad technology providers, but I thought they removed it. I'm wondering if anyone has an idea as to what's causing it. I have x'd some sensitive data. Many thanks.

Error:
Error: Error Domain=Consent Code=1 "Error: consent form can be used with custom provider selection only." UserInfo={NSLocalizedDescription=Error: consent form can be used with custom provider selection only.}

Consent:
Sub getConsent
    consent.Initialize("consent")
    consent.LogDeviceIdForDebugging
    consent.AddTestDevice("xxxxxxx-144E-45D6-9651-834C645DE093")
    consent.SetDebugGeography(True) 'comment for regular operation
    consent.RequestInfoUpdate(Array("pub-xxxxxxxxxxxxxxxx"))
    Wait For consent_InfoUpdated (Success As Boolean)
    If Success = False Then
       Log($"Error getting consent state: ${LastException}"$)
    End If
    Log($"Consent state: ${consent.ConsentState}"$) '0 - UNKNOWN, 1 - NON_PERSONALIZED, 2 - PERSONALIZED
    Log(consent.IsRequestLocationInEeaOrUnknown)
    ConsentStateAvailable
End Sub

Sub ConsentStateAvailable
    If consent.ConsentState = consent.STATE_UNKNOWN And consent.IsRequestLocationInEeaOrUnknown Then
        consent.ShowConsentForm(B4XPages.GetNativeParent(Me), "https://www.nsobol.com/privacy-policy.html", True, True, True)
        Wait For Consent_FormResult (Success As Boolean, UserPrefersAdFreeOption As Boolean)
        If Success Then
            Log($"Consent form result: ${consent.ConsentState}, AdFree: ${UserPrefersAdFreeOption}"$)
        Else
            Log($"Error: ${LastException}"$)
        End If
    End If
End Sub

b4i.jpg
 
Top