Skip to content

Commit

Permalink
5.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kdun committed Jun 4, 2018
1 parent 7effaf8 commit ac3d45e
Show file tree
Hide file tree
Showing 72 changed files with 1,177 additions and 1,233 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## Version 5.1.0 (June 5, 2018)
- **Features**
- Updated `MPReachability` to be IPv6 compliant.
- Allow publishers to determine which users should be treated as GDPR compliant users through the new API `forceGDPRApplicable`.
- Alert a publisher (through logs) when they are trying to use the new GDPR consent flow without being whitelisted.
- Banner refresh will only occur after an impression.

## Version 5.0.0 (May 14, 2018)
- **Features**
- General Data Protection Regulation (GDPR) update to support a way for publishers to determine GDPR applicability and to obtain and manage consent from users in European Economic Area, the United Kingdom, or Switzerland to serve personalize ads.
Expand Down
52 changes: 28 additions & 24 deletions MoPubSDK.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

18 changes: 16 additions & 2 deletions MoPubSDK/Internal/Banners/MPBannerAdManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

#import "MPBannerAdManager.h"
#import "MPAdServerURLBuilder.h"
#import "MPInstanceProvider.h"
#import "MPCoreInstanceProvider.h"
#import "MPBannerAdManagerDelegate.h"
#import "MPError.h"
Expand Down Expand Up @@ -198,6 +197,12 @@ - (void)refreshTimerDidFire
}
}

- (BOOL)shouldScheduleTimerOnImpressionDisplay {
// If `visibleImpressionTrackingEnabled` is set to `YES`, we
// should schedule the timer only after the impression has fired.
return self.requestingConfiguration.visibleImpressionTrackingEnabled;
}

#pragma mark - <MPAdServerCommunicatorDelegate>

- (void)communicatorDidReceiveAdConfigurations:(NSArray<MPAdConfiguration *> *)configurations
Expand Down Expand Up @@ -296,7 +301,10 @@ - (void)presentRequestingAdapter
[self.onscreenAdapter didDisplayAd];

self.requestingAdapterAdContentView = nil;
[self scheduleRefreshTimer];

if (![self shouldScheduleTimerOnImpressionDisplay]) {
[self scheduleRefreshTimer];
}
}
}

Expand Down Expand Up @@ -335,6 +343,12 @@ - (void)adapter:(MPBaseBannerAdapter *)adapter didFailToLoadAdWithError:(NSError
}
}

- (void)adapter:(MPBaseBannerAdapter *)adapter didTrackImpressionForAd:(UIView *)ad {
if (self.onscreenAdapter == adapter && [self shouldScheduleTimerOnImpressionDisplay]) {
[self scheduleRefreshTimer];
}
}

- (void)userActionWillBeginForAdapter:(MPBaseBannerAdapter *)adapter
{
if (self.onscreenAdapter == adapter) {
Expand Down
5 changes: 4 additions & 1 deletion MoPubSDK/Internal/Banners/MPBannerCustomEventAdapter.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#import "MPAdConfiguration.h"
#import "MPBannerCustomEvent.h"
#import "MPInstanceProvider.h"
#import "MPCoreInstanceProvider.h"
#import "MPLogging.h"
#import "MPAdImpressionTimer.h"
#import "MPBannerCustomEvent+Internal.h"
Expand Down Expand Up @@ -193,6 +193,9 @@ - (void)adViewWillLogImpression:(UIView *)adView
[self.bannerCustomEvent trackMPXAndThirdPartyImpressions];
// Start viewability tracking
[self.bannerCustomEvent startViewabilityTracker];

// Notify delegate that an impression tracker was fired
[self.delegate adapter:self didTrackImpressionForAd:adView];
}

@end
5 changes: 5 additions & 0 deletions MoPubSDK/Internal/Banners/MPBaseBannerAdapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,9 @@
*/
- (void)userWillLeaveApplicationFromAdapter:(MPBaseBannerAdapter *)adapter;

/**
* Fires when the impression tracker has been sent.
*/
- (void)adapter:(MPBaseBannerAdapter *)adapter didTrackImpressionForAd:(UIView *)ad;

@end
1 change: 0 additions & 1 deletion MoPubSDK/Internal/Common/MPActivityViewControllerHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
//

#import "MPActivityViewControllerHelper.h"
#import "MPInstanceProvider.h"

/**
* MPActivityItemProviderWithSubject subclasses UIActivityItemProvider
Expand Down
2 changes: 0 additions & 2 deletions MoPubSDK/Internal/Common/MPAdConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ extern NSString * const kNativeSDKParametersHeaderKey;
extern NSString * const kNetworkTypeHeaderKey;
extern NSString * const kRefreshTimeHeaderKey;
extern NSString * const kAdTimeoutHeaderKey;
extern NSString * const kScrollableHeaderKey;
extern NSString * const kWidthHeaderKey;
extern NSString * const kDspCreativeIdKey;
extern NSString * const kPrecacheRequiredKey;
Expand Down Expand Up @@ -71,7 +70,6 @@ extern NSString * const kBannerImpressionMinPixelHeaderKey;
@property (nonatomic, strong) NSURL *impressionTrackingURL;
@property (nonatomic, strong) NSURL *failoverURL;
@property (nonatomic, strong) NSURL *interceptURLPrefix;
@property (nonatomic, assign) BOOL scrollable;
@property (nonatomic, assign) NSTimeInterval refreshInterval;
@property (nonatomic, assign) NSTimeInterval adTimeoutInterval;
@property (nonatomic, copy) NSData *adResponseData;
Expand Down
5 changes: 2 additions & 3 deletions MoPubSDK/Internal/Common/MPAdConfiguration.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#import "MPAdConfiguration.h"

#import "MOPUBExperimentProvider.h"
#import "MPConsentAdServerKeys.h"
#import "MPAdServerKeys.h"
#import "MPConsentManager.h"
#import "MPConstants.h"
#import "MPLogging.h"
Expand Down Expand Up @@ -36,7 +36,6 @@
NSString * const kNetworkTypeHeaderKey = @"X-Networktype";
NSString * const kRefreshTimeHeaderKey = @"X-Refreshtime";
NSString * const kAdTimeoutHeaderKey = @"X-AdTimeout";
NSString * const kScrollableHeaderKey = @"X-Scrollable";
NSString * const kWidthHeaderKey = @"X-Width";
NSString * const kDspCreativeIdKey = @"X-DspCreativeid";
NSString * const kPrecacheRequiredKey = @"X-PrecacheRequired";
Expand Down Expand Up @@ -132,7 +131,6 @@ - (id)initWithHeaders:(NSDictionary *)headers data:(NSData *)data
self.interceptURLPrefix = [self URLFromHeaders:headers
forKey:kLaunchpageHeaderKey];

self.scrollable = [[headers objectForKey:kScrollableHeaderKey] boolValue];
self.refreshInterval = [self refreshIntervalFromHeaders:headers];
self.adTimeoutInterval = [self timeIntervalFromHeaders:headers forKey:kAdTimeoutHeaderKey];

Expand Down Expand Up @@ -235,6 +233,7 @@ - (id)initWithHeaders:(NSDictionary *)headers data:(NSData *)data
[[MPConsentManager sharedManager] forceStatusShouldForceExplicitNo:[headers[kForceExplicitNoKey] boolValue]
shouldInvalidateConsent:[headers[kInvalidateConsentKey] boolValue]
shouldReacquireConsent:[headers[kReacquireConsentKey] boolValue]
shouldForceGDPRApplicability:[headers[kForceGDPRAppliesKey] boolValue]
consentChangeReason:headers[kConsentChangedReasonKey]
shouldBroadcast:YES];
}
Expand Down
14 changes: 12 additions & 2 deletions MoPubSDK/Internal/Common/MPAdServerURLBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,20 @@
//

#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>

@class CLLocation;

@interface MPAdServerURLBuilder : NSObject

/**
* Returns an NSURL object given an endpoint and a dictionary of query parameters/values
*/
+ (NSURL *)URLWithEndpointPath:(NSString *)endpointPath queryParameters:(NSDictionary *)parameters;

@end

@interface MPAdServerURLBuilder (Ad)

+ (NSURL *)URLWithAdUnitID:(NSString *)adUnitID
keywords:(NSString *)keywords
userDataKeywords:(NSString *)userDataKeywords
Expand All @@ -32,7 +42,7 @@

@end

@interface MPAdServerURLBuilder (OpenEndpoint)
@interface MPAdServerURLBuilder (Open)

/**
Constructs the conversion tracking URL using current consent state, SDK state, and @c appID parameter.
Expand Down
Loading

0 comments on commit ac3d45e

Please sign in to comment.