diff --git a/Verve/AppLovinMediationVerveAdapter.podspec b/Verve/AppLovinMediationVerveAdapter.podspec index 5b878c2cfa..51b82ba859 100644 --- a/Verve/AppLovinMediationVerveAdapter.podspec +++ b/Verve/AppLovinMediationVerveAdapter.podspec @@ -2,7 +2,7 @@ Pod::Spec.new do |s| s.authors = 'AppLovin Corporation' s.name = 'AppLovinMediationVerveAdapter' -s.version = '2.18.1.0' +s.version = '2.18.1.1' s.platform = :ios, '10.0' s.summary = 'Verve adapter used for mediation with the AppLovin MAX SDK' s.homepage = "https://github.com/CocoaPods/Specs/search?o=desc&q=#{s.name}&s=indexed" diff --git a/Verve/CHANGELOG.md b/Verve/CHANGELOG.md index 6e247542ef..25df8caf07 100644 --- a/Verve/CHANGELOG.md +++ b/Verve/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 2.18.1.1 +* Add support for binary consent state as a fallback option if the TCFv2 GDPR consent string is not present in User Defaults. + ## 2.18.1.0 * Certified with Verve SDK 2.18.1. * Remove unnecessary MAX SDK version check. diff --git a/Verve/VerveAdapter/ALVerveMediationAdapter.m b/Verve/VerveAdapter/ALVerveMediationAdapter.m index b8ae050e07..7df0346425 100644 --- a/Verve/VerveAdapter/ALVerveMediationAdapter.m +++ b/Verve/VerveAdapter/ALVerveMediationAdapter.m @@ -10,7 +10,7 @@ #import #import -#define ADAPTER_VERSION @"2.18.1.0" +#define ADAPTER_VERSION @"2.18.1.1" @interface ALVerveMediationAdapterInterstitialAdDelegate : NSObject @property (nonatomic, weak) ALVerveMediationAdapter *parentAdapter; @@ -292,15 +292,26 @@ - (void)updateLocationCollectionEnabled:(id)parameters - (void)updateConsentWithParameters:(id)parameters { // From PubNative: "HyBid SDK is TCF v2 compliant, so any change in the IAB consent string will be picked up by the SDK." - // Because of this, they requested that we don't update consent values if one is already set. + // Because of this, they requested that we don't update consent values if one is already set and use binary consent state as a fallback. // As a side effect, pubs that use the MAX consent flow will not be able to update consent values mid-session. // Full context in this PR: https://github.com/AppLovin/AppLovin-MAX-SDK-iOS/pull/57 NSNumber *hasUserConsent = parameters.hasUserConsent; - NSString *verveGDPRConsentString = [[HyBidUserDataManager sharedInstance] getIABGDPRConsentString]; - if ( hasUserConsent && (!verveGDPRConsentString || [verveGDPRConsentString isEqualToString: @""]) ) + if ( hasUserConsent ) { - [[HyBidUserDataManager sharedInstance] setIABGDPRConsentString: hasUserConsent.boolValue ? @"1" : @"0"]; + // NOTE: verveGDPRConsentString can be nil, TCFv2 consent string, "1" or "0" + NSString *verveGDPRConsentString = [[HyBidUserDataManager sharedInstance] getIABGDPRConsentString]; + + // If hasUserConsent is set to false, set consent string to "0" + if ( !hasUserConsent.boolValue ) + { + [[HyBidUserDataManager sharedInstance] setIABGDPRConsentString: @"0"]; + } + // If hasUserConsent is set to true, only override if it has not been set to a TCFv2 consent string or is set to "0" + else if ( ![verveGDPRConsentString al_isValidString] || [verveGDPRConsentString isEqualToString: @"0"] ) + { + [[HyBidUserDataManager sharedInstance] setIABGDPRConsentString: @"1"]; + } } NSNumber *isAgeRestrictedUser = parameters.ageRestrictedUser;