Skip to content
This repository has been archived by the owner on May 22, 2023. It is now read-only.

Commit

Permalink
Release: version 5.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Uchitel and Bichen Wang committed Jun 5, 2018
1 parent 30f97ce commit 41eb08c
Show file tree
Hide file tree
Showing 42 changed files with 1,100 additions and 291 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)
- Upgraded Moat dependency to 2.4.5.
- Banners now only refresh after an impression is made.
- Added `PersonalInfoManager.forceGdprApplies()` in order to let MoPub know that this app should always apply GDPR rules.
- Loading MoPub's consent dialog is only possible when GDPR rules applies to the app.
- Bug fixes.

## Version 5.0.0 (May 14, 2018)
- 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 personalized ads.
- New SDK initialization method to initialize consent management and rewarded video ad networks. Required for receiving personalized ads. In future versions of the SDK, initialization will be required to receive ads.
Expand Down
27 changes: 13 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ The MoPub SDK is available via:
}
dependencies {
implementation('com.mopub:mopub-sdk:5.0.0@aar') {
implementation('com.mopub:mopub-sdk:5.1.0@aar') {
transitive = true
}
}
Expand All @@ -61,27 +61,27 @@ The MoPub SDK is available via:
// ... other project dependencies
// For banners
implementation('com.mopub:mopub-sdk-banner:5.0.0@aar') {
implementation('com.mopub:mopub-sdk-banner:5.1.0@aar') {
transitive = true
}
// For interstitials
implementation('com.mopub:mopub-sdk-interstitial:5.0.0@aar') {
implementation('com.mopub:mopub-sdk-interstitial:5.1.0@aar') {
transitive = true
}
// For rewarded videos. This will automatically also include interstitials
implementation('com.mopub:mopub-sdk-rewardedvideo:5.0.0@aar') {
implementation('com.mopub:mopub-sdk-rewardedvideo:5.1.0@aar') {
transitive = true
}
// For native static (images).
implementation('com.mopub:mopub-sdk-native-static:5.0.0@aar') {
implementation('com.mopub:mopub-sdk-native-static:5.1.0@aar') {
transitive = true
}
// For native video. This will automatically also include native static
implementation('com.mopub:mopub-sdk-native-video:5.0.0@aar') {
implementation('com.mopub:mopub-sdk-native-video:5.1.0@aar') {
transitive = true
}
}
Expand Down Expand Up @@ -109,11 +109,10 @@ The MoPub SDK is available via:
## New in this Version
Please view the [changelog](https://github.com/mopub/mopub-android-sdk/blob/master/CHANGELOG.md) for a complete list of additions, fixes, and enhancements in the latest release.
- 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 personalized ads.
- New SDK initialization method to initialize consent management and rewarded video ad networks. Required for receiving personalized ads. In future versions of the SDK, initialization will be required to receive ads.
- Updated network stack to MoPub-Volley-2.0.0.
- Updated ad requests to use POST instead of GET.
- All communication with MoPub servers is now made via HTTPS.
- Upgraded Moat dependency to 2.4.5.
- Banners now only refresh after an impression is made.
- Added `PersonalInfoManager.forceGdprApplies()` in order to let MoPub know that this app should always apply GDPR rules.
- Loading MoPub's consent dialog is only possible when GDPR rules applies to the app.
## Requirements
Expand All @@ -128,7 +127,7 @@ Please view the [changelog](https://github.com/mopub/mopub-android-sdk/blob/mast
Please see the [Getting Started Guide](https://developers.mopub.com/docs/android/getting-started/) for instructions on upgrading from SDK 4.X to SDK 5.0.
For GDPR-specific upgrading instructions, also see the [GDPR Integration Guide](https://developers.mopub.com/docs/publisher/gdpr-guide/).
For GDPR-specific upgrading instructions, also see the [GDPR Integration Guide](https://developers.mopub.com/docs/publisher/gdpr).
## <a name="upgradeRepositoryViewability"></a>Upgrading from 4.15.0 and Prior
In 4.16.0, dependencies were added to viewability libraries provided by AVID and Moat. Apps upgrading from previous versions must add
Expand All @@ -142,7 +141,7 @@ Normally, to add the MoPub SDK to your app via JCenter, your `build.gradle` woul
```
dependencies {
implementation('com.mopub:mopub-sdk:5.0.0@aar') {
implementation('com.mopub:mopub-sdk:5.1.0@aar') {
transitive = true
}
}
Expand All @@ -151,7 +150,7 @@ Update to the following to exclude one or both viewability vendors:
```
dependencies {
implementation('com.mopub:mopub-sdk:4.20.0@aar') {
implementation('com.mopub:mopub-sdk:5.1.0@aar') {
transitive = true
exclude module: 'libAvid-mopub' // To exclude AVID
exclude module: 'moat-mobile-app-kit' // To exclude Moat
Expand Down
6 changes: 3 additions & 3 deletions mopub-sample/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mopub.simpleadsdemo"
android:versionCode="59"
android:versionName="5.0.0">
android:versionCode="61"
android:versionName="5.1.0">
<uses-sdk android:minSdkVersion="16"
android:targetSdkVersion="26"/>

Expand All @@ -17,7 +17,7 @@
android:networkSecurityConfig="@xml/network_security_config">
<activity android:name="com.mopub.simpleadsdemo.MoPubSampleActivity"
android:label="@string/app_name"
android:launchMode="singleInstance"
android:launchMode="singleTask"
android:configChanges="orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
4 changes: 2 additions & 2 deletions mopub-sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ apply plugin: 'com.android.application'

project.group = 'com.mopub'
project.description = '''MoPub Sample App'''
project.version = '5.0.0'
project.version = '5.1.0'

android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
lintOptions { abortOnError false }

defaultConfig {
versionCode 59
versionCode 61
versionName version
minSdkVersion 16
targetSdkVersion 26
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ static void enableCanaryLogging(@NonNull final Context context) {
}

final Handler handler = new SampleAppLogHandler(context.getApplicationContext());
MoPubLog.c("Setting up MoPubLog");
final Logger logger = getLogger();
logger.addHandler(handler);

Expand Down
4 changes: 2 additions & 2 deletions mopub-sdk/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Jun 20 17:19:29 PDT 2016
#Mon Nov 13 15:46:01 PST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3.1-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public class CustomEventBannerAdapter implements CustomEventBannerListener {

private final Handler mHandler;
private final Runnable mTimeout;
private boolean mStoredAutorefresh;

private int mImpressionMinVisibleDips = Integer.MIN_VALUE;
private int mImpressionMinVisibleMs = Integer.MIN_VALUE;
Expand Down Expand Up @@ -226,6 +225,8 @@ public void onBannerLoaded(View bannerView) {
// Else, retain old behavior of firing AdServer impression tracking URL if and only if
// banner is not HTML.
if (mIsVisibilityImpressionTrackingEnabled) {
// Disable autorefresh temporarily until an impression happens.
mMoPubView.pauseAutorefresh();
// Set up visibility tracker and listener if in experiment
mVisibilityTracker = new BannerVisibilityTracker(mContext, mMoPubView, bannerView,
mImpressionMinVisibleDips, mImpressionMinVisibleMs);
Expand All @@ -237,6 +238,7 @@ public void onVisibilityChanged() {
if (mCustomEventBanner != null) {
mCustomEventBanner.trackMpxAndThirdPartyImpressions();
}
mMoPubView.resumeAutorefresh();
}
});
}
Expand Down Expand Up @@ -273,8 +275,7 @@ public void onBannerExpanded() {
return;
}

mStoredAutorefresh = mMoPubView.getAutorefreshEnabled();
mMoPubView.setAutorefreshEnabled(false);
mMoPubView.expand();
mMoPubView.adPresentedOverlay();
}

Expand All @@ -284,7 +285,7 @@ public void onBannerCollapsed() {
return;
}

mMoPubView.setAutorefreshEnabled(mStoredAutorefresh);
mMoPubView.collapse();
mMoPubView.adClosed();
}

Expand Down
2 changes: 1 addition & 1 deletion mopub-sdk/mopub-sdk-base/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencies {
}
def moatEnabled = project.hasProperty("mopub.moatEnabled") ? project.getProperty("mopub.moatEnabled").toBoolean() : true
if (moatEnabled) {
compile 'com.moat.analytics.mobile.mpub:moat-mobile-app-kit:2.4.1'
compile 'com.moat.analytics.mobile.mpub:moat-mobile-app-kit:2.4.5'
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,21 +109,14 @@ public abstract class AdUrlGenerator extends BaseUrlGenerator {
*/
private static final String ADVANCED_BIDDING_TOKENS_KEY = "abt";

private static final String GDPR_APPLIES = "gdpr_applies";

private static final String CURRENT_CONSENT_STATUS = "current_consent_status";

private static final String CONSENTED_PRIVACY_POLICY_VERSION = "consented_privacy_policy_version";

private static final String CONSENTED_VENDOR_LIST_VERSION = "consented_vendor_list_version";

protected Context mContext;
protected String mAdUnitId;
protected String mKeywords;
protected String mUserDataKeywords;
protected Location mLocation;
@Nullable private final PersonalInfoManager mPersonalInfoManager;
@Nullable private final ConsentData mConsentData;
protected Boolean mForceGdprApplies;

public AdUrlGenerator(Context context) {
mContext = context;
Expand Down Expand Up @@ -269,23 +262,29 @@ protected void setGdprApplies() {
}
}

protected void setForceGdprApplies() {
if (mConsentData != null) {
addParam(FORCE_GDPR_APPLIES, mConsentData.isForceGdprApplies());
}
}

protected void setCurrentConsentStatus() {
if (mPersonalInfoManager != null) {
addParam(CURRENT_CONSENT_STATUS, mPersonalInfoManager.getPersonalInfoConsentStatus()
addParam(CURRENT_CONSENT_STATUS_KEY, mPersonalInfoManager.getPersonalInfoConsentStatus()
.getValue());
}
}

protected void setConsentedPrivacyPolicyVersion() {
if (mConsentData != null) {
addParam(CONSENTED_PRIVACY_POLICY_VERSION,
addParam(CONSENTED_PRIVACY_POLICY_VERSION_KEY,
mConsentData.getConsentedPrivacyPolicyVersion());
}
}

protected void setConsentedVendorListVersion() {
if (mConsentData != null) {
addParam(CONSENTED_VENDOR_LIST_VERSION, mConsentData.getConsentedVendorListVersion());
addParam(CONSENTED_VENDOR_LIST_VERSION_KEY, mConsentData.getConsentedVendorListVersion());
}
}

Expand Down Expand Up @@ -328,6 +327,8 @@ protected void addBaseParams(final ClientMetadata clientMetadata) {

setGdprApplies();

setForceGdprApplies();

setCurrentConsentStatus();

setConsentedPrivacyPolicyVersion();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ public abstract class BaseUrlGenerator {
*/
protected static final String GDPR_APPLIES = "gdpr_applies";

/**
* "1" if the publisher has forced GDPR rules to apply to this app. "0" if this is not set.
*/
protected static final String FORCE_GDPR_APPLIES = "force_gdpr_applies";

private static final String WIDTH_KEY = "w";
private static final String HEIGHT_KEY = "h";

Expand Down Expand Up @@ -130,16 +135,6 @@ protected void setDeviceInfo(String... info) {
addParam("dn", result.toString());
}

protected void setDoNotTrack(boolean dnt) {
if (dnt) {
addParam(DNT_KEY, "1");
}
}

protected void setUdid(String udid) {
addParam(UDID_KEY, udid);
}

/**
* Appends special keys/values for advertising id and do-not-track. PlayServicesUrlRewriter will
* replace these templates with the correct values when the request is processed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,15 @@

import com.mopub.common.logging.MoPubLog;
import com.mopub.common.privacy.PersonalInfoManager;
import com.mopub.common.util.ManifestUtils;
import com.mopub.common.util.Reflection;
import com.mopub.mobileads.MoPubConversionTracker;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

import static com.mopub.common.ExternalViewabilitySessionManager.ViewabilityVendor;

public class MoPub {
public static final String SDK_VERSION = "5.0.0";
public static final String SDK_VERSION = "5.1.0";

public enum LocationAwareness { NORMAL, TRUNCATED, DISABLED }

Expand Down Expand Up @@ -157,7 +155,7 @@ public static void initializeSdk(@NonNull final Context context,
Preconditions.checkNotNull(sdkConfiguration);

// This also initializes MoPubLog
MoPubLog.d("Initializing MoPub");
MoPubLog.d("Initializing MoPub with ad unit: " + sdkConfiguration.getAdUnitId());

if (context instanceof Activity && Reflection.classFound(MOPUB_REWARDED_VIDEO_MANAGER)) {
final Activity activity = (Activity) context;
Expand Down Expand Up @@ -185,8 +183,6 @@ public static void initializeSdk(@NonNull final Context context,

sAdvancedBiddingTokens = new AdvancedBiddingTokens(compositeSdkInitializationListener);
sAdvancedBiddingTokens.addAdvancedBidders(sdkConfiguration.getAdvancedBidders());

ManifestUtils.checkSdkActivitiesDeclared(context);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public class AdvertisingId implements Serializable {
@NonNull String mopubId,
boolean limitAdTrackingEnabled,
long rotationTime) {
Preconditions.NoThrow.checkNotNull(ifaId);
Preconditions.NoThrow.checkNotNull(ifaId);
Preconditions.checkNotNull(ifaId);
Preconditions.checkNotNull(ifaId);

mAdvertisingId = ifaId;
mMopubId = mopubId;
Expand Down
Loading

0 comments on commit 41eb08c

Please sign in to comment.