IABTechLab / iabgpp-java

Apache License 2.0
11 stars 12 forks source link

How to set up publisher restrictions in EU TCF V2 Section? #54

Open aagrawal207 opened 1 week ago

aagrawal207 commented 1 week ago

Hi all,

I have been trying to use the following code to set the publisher restrictions in EU TCF V2 and always get Encoding Exception, what am I doing wrong?

List<RangeEntry> publisherRestrictions = consent.getConsentData()
                                                .getGvlSettings()
                                                .getPublisherRestrictions()
                                                .stream()
                                                .map(pr -> new RangeEntry(pr.getPurposeId(),
                                                                    pr.getRestrictionType(),
                                                                    pr.getVendors())).collect(Collectors.toList());
gppModel.setFieldValue(TcfEuV2.NAME, TcfEuV2Field.PUBLISHER_RESTRICTIONS, publisherRestrictions);
aagrawal207 commented 1 week ago

@iabmayank / @chuff Please help here as well.