CommandersAct / iOSV5

Other
7 stars 2 forks source link

TCConsentAPI.isIABSpecialFeatureAccepted not working #16

Open redamimouni opened 8 months ago

redamimouni commented 8 months ago

Hello,

I'm trying to check which consent has been accepted and I have an issue with TCConsentAPI.isIABSpecialFeatureAccepted that returns always false. I'm already using isIABPurposeAccepted and it works fine.

Any idea about this issue ?

ahakimsaid commented 8 months ago

Hello,

Thank you for reporting the issue. I was able to reproduce the bug on my side. The fix will be deployed in the next release. I hope it's not causing significant inconvenience for you at the moment.

Thank you

redamimouni commented 8 months ago

Hi @ahakimsaid , thanks you for your investigation, do you know when the fix will be released please ? Its a blocking issue in our side.

ahakimsaid commented 8 months ago

Hi @redamimouni, some major changes that we're working on might come in the upcoming release, we need to make sure everything is good before launching this release, so it might take a while.

However, you can in the mean time, use this workaround and directly read the value from the TCUserDefaults, here's an implementation for that :


 func isIABSpecialFeatureAccepted(ID: Int) -> Bool {
        let offsetID = ID + 13000
        let consent = TCUserDefaults.retrieveInfo(fromUserDefaults: "PRIVACY_FEAT_\(offsetID)")
        return consent == "1"
    }
redamimouni commented 8 months ago

Hi @ahakimsaid , perfect, thanks for the workaround, can you please tell me when its released so we can update the workaround ?

ahakimsaid commented 8 months ago

Glad the workaround is working for you. To stay updated on releases, I recommend keeping an eye on the repository. That way, you'll be notified as soon as it's released.

rjourde commented 6 months ago

Hello @ahakimsaid,

I'm experiencing a similar issue but with TCConsentAPI.getAcceptedGoogleVendors(). I accepted all the consents, but the collection of Google vendors is always empty, while the collection returned by TCConsentAPI.getAcceptedVendors() is well-populated with vendor IDs.

Could you please provide a workaround while we wait for a fix to be released?

ahakimsaid commented 6 months ago

Hello @rjourde, Sorry for late reply, I am unable to recreate the bug on my env. Are you seeing the google vendors on your privacy center ? they should have their own section on the vendors screen.

does the TCConsentAPI.getAcceptedVendors() return any values with a acm_ prefix ?

rjourde commented 6 months ago

Hello @ahakimsaid after accepting all the vendors, in the array returned by TCConsentAPI.getAcceptedVendors() I have 462 values and they are all prefixed with PRIVACY_VEN_

Capture d’écran 2024-05-31 à 15 49 00
ahakimsaid commented 6 months ago

Hello @rjourde ,

The vendor we see in the screenshot provided appears to be a custom non-IAB vendor. Any vendor listed in the privacy.json will be handled by the SDK like any other custom vendor, even if the name refers to Google.

It is perfectly normal that you don't have values returned by getAcceptedGoogleVendors(). This method pertains to the Google ACString framework. If you want to implement it, please refer to the appropriate documentation : https://github.com/CommandersAct/iOSV5/tree/master/TCIAB#google-atp-listjson

If you eventually decide to add the ACString, you may also wanna update your privacy.json with a google_vendors filter.

rjourde commented 6 months ago

Hello @ahakimsaid,

Ok I understand. So is there a reliable way to identify that the vendor Google Advertising Products has been accepted ?

I have some kind of a workaround. I'm calling TCConsentAPI.getAllAcceptedConsent() and I check that the following IDs exist in the array: PRIVACY_VEN_2509 and PRIVACY_VEN_2510

ahakimsaid commented 6 months ago

You shoold look this Google Advertising Products vendor id inside your privacy json. Then you should have something like the following format in your array : PRIVACY_VEN_XX . Where XX is the id found in your privacy.json.