Skip to content

Commit

Permalink
Release: version 4.16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Bichen Wang and Nathan Shayefar committed Aug 23, 2017
1 parent f5ec43d commit 328dcd8
Show file tree
Hide file tree
Showing 102 changed files with 3,486 additions and 383 deletions.
47 changes: 47 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,50 @@
## Version 4.16.0 (August 23, 2017)
- Added support for viewability measurement from AVID (a.k.a. IAS) and Moat.
- **Important:** New dependencies were included in this release; please update your `build.gradle`'s repositories block to include `maven { url "https://s3.amazonaws.com/moat-sdk-builds" }`.
- To disable this feature, see note below on [Disabling Viewability Measurement](#disableViewability).
- Interstitials are now loaded offscreen instead of in a separate WebView.
- Rewarded Videos have a new init method. See `MoPubRewardedVideos.initializeRewardedVideo(Activity, List<Class<? extends CustomEventRewardedVideo>>, MediationSettings...)`. Pass in a list of networks to initialize, and MoPub will initialize those networks with the settings from the previous ad request, persisted across app close.
- Upgraded our ExoPlayer dependency to 2.4.4.
- Bug fixes

#### Disclosures
MoPub v4.16 SDK integrates technology from our partners Integral Ad Science, Inc. (“IAS”) and Moat, Inc. (“Moat”) in order to support viewability measurement and other proprietary reporting that [IAS](https://integralads.com/capabilities/viewability/) and [Moat](https://moat.com/analytics) provide to their advertiser and publisher clients. You have the option to remove or disable this technology by following the [opt-out instructions](#disableViewability) below.

If you do not remove or disable IAS's and/or Moat’s technology in accordance with these instructions, you agree that IAS's [privacy policy](https://integralads.com/privacy-policy/) and [license](https://integralads.com/sdk-license-agreement) and Moat’s [privacy policy](https://moat.com/privacy), [terms](https://moat.com/terms), and [license](https://moat.com/sdklicense.txt), respectively, apply to your integration of these partners' technologies into your application.

#### <a name="disableViewability"></a>Disabling Viewability Measurement
There are a few options for opting out of viewability measurement:
##### Strip out from JCenter Integration
Normally, to add the MoPub SDK to your app via JCenter, your `build.gradle` would contain:

```
dependencies {
compile('com.mopub:mopub-sdk:4.16.0@aar') {
transitive = true
}
}
```
Update to the following to exclude one or both viewability vendors:

```
dependencies {
compile('com.mopub:mopub-sdk:4.16.0@aar') {
transitive = true
exclude module: 'libAvid-mopub' // To exclude AVID
exclude module: 'moat-mobile-app-kit' // To exclude Moat
}
}
```
##### Strip out from GitHub integration
Navigate to the `gradle.properties` file in your home directory (e.g. `~/.gradle/gradle.properties`) and include one or both of these lines to opt out of viewability measurement for AVID and/or Moat.

```
mopub.avidEnabled=false
mopub.moatEnabled=false
```
##### Disable via API
If you would like to opt out of viewability measurement but do not want to modify the MoPub SDK, a function is provided for your convenience. At any point, call `MoPub.disableViewability(vendor);`. This method can can be called with any of the enum values available in `ExternalViewabilitySessionManager.ViewabilityVendor`: `AVID` will disable AVID but leave Moat enabled, `MOAT` will disable Moat but leave AVID enabled, and `ALL` will disable all viewability measurement.

## Version 4.15.0 (June 19, 2017)
- The SDK now sends Advertising ID on Amazon devices when appropriate.
- Fixed issue with Charles proxy in sample app for API 24+.
Expand Down
73 changes: 57 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ To file an issue with our team visit the [MoPub Forum](https://twittercommunity.

**Please Note: We no longer accept GitHub Issues.**

## Disclosures

MoPub v4.16 SDK integrates technology from our partners Integral Ad Science, Inc. (“IAS”) and Moat, Inc. (“Moat”) in order to support viewability measurement and other proprietary reporting that [IAS](https://integralads.com/capabilities/viewability/) and [Moat](https://moat.com/analytics) provide to their advertiser and publisher clients. You have the option to remove or disable this technology by following the [opt-out instructions](#disableViewability) below.

If you do not remove or disable IAS's and/or Moat’s technology in accordance with these instructions, you agree that IAS's [privacy policy](https://integralads.com/privacy-policy/) and [license](https://integralads.com/sdk-license-agreement) and Moat’s [privacy policy](https://moat.com/privacy), [terms](https://moat.com/terms), and [license](https://moat.com/sdklicense.txt), respectively, apply to your integration of these partners' technologies into your application.

## Download

The MoPub SDK is available via:
Expand All @@ -24,10 +30,11 @@ The MoPub SDK is available via:
```
repositories {
jcenter()
maven { url "https://s3.amazonaws.com/moat-sdk-builds" }
}
dependencies {
compile('com.mopub:mopub-sdk:4.15.0@aar') {
compile('com.mopub:mopub-sdk:4.16.0@aar') {
transitive = true
}
}
Expand All @@ -41,34 +48,34 @@ The MoPub SDK is available via:
repositories {
// ... other project repositories
jcenter()
maven { url "https://s3.amazonaws.com/moat-sdk-builds" }
}
// ...
dependencies {
// ... other project dependencies
// For banners
compile('com.mopub:mopub-sdk-banner:4.15.0@aar') {
compile('com.mopub:mopub-sdk-banner:4.16.0@aar') {
transitive = true
}
// For interstitials
compile('com.mopub:mopub-sdk-interstitial:4.15.0@aar') {
compile('com.mopub:mopub-sdk-interstitial:4.16.0@aar') {
transitive = true
}
// For rewarded videos. This will automatically also include interstitials
compile('com.mopub:mopub-sdk-rewardedvideo:4.15.0@aar') {
compile('com.mopub:mopub-sdk-rewardedvideo:4.16.0@aar') {
transitive = true
}
// For native static (images).
compile('com.mopub:mopub-sdk-native-static:4.15.0@aar') {
compile('com.mopub:mopub-sdk-native-static:4.16.0@aar') {
transitive = true
}
// For native video. This will automatically also include native static
compile('com.mopub:mopub-sdk-native-video:4.15.0@aar') {
compile('com.mopub:mopub-sdk-native-video:4.16.0@aar') {
transitive = true
}
}
Expand Down Expand Up @@ -96,9 +103,12 @@ 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.
- The SDK now sends Advertising ID on Amazon devices when appropriate.
- Fixed issue with Charles proxy in sample app for API 24+.
- Bug fixes.
- Added support for viewability measurement from AVID (a.k.a. IAS) and Moat.
- **Important:** New dependencies were included in this release; please update your `build.gradle`'s repositories block to include `maven { url "https://s3.amazonaws.com/moat-sdk-builds" }`. See [Upgrading from 4.15.0 and Prior](#upgradeRepositoryViewability) for more details.
- To disable this feature, see below section on [Disabling Viewability Measurement](#disableViewability).
- Interstitials are now loaded offscreen instead of in a separate WebView.
- Rewarded Videos have a new init method. See `MoPubRewardedVideos.initializeRewardedVideo(Activity, List<Class<? extends CustomEventRewardedVideo>>, MediationSettings...)`. Pass in a list of networks to initialize, and MoPub will initialize those networks with the settings from the previous ad request, persisted across app close.
- Upgraded our ExoPlayer dependency to 2.4.4.
## Requirements
Expand All @@ -109,12 +119,43 @@ Please view the [changelog](https://github.com/mopub/mopub-android-sdk/blob/mast
- MoPub Volley Library (mopub-volley-1.1.0.jar - available on JCenter) (**Updated in 3.6.0**)
- **Recommended** Google Play Services 9.4.0
## Upgrading from 3.2.0 and Prior
In 3.3.0 a dependency on android-support-annotations.jar was added. If you are using Maven or Gradle to include the MoPub SDK, this dependency is included in the build scripts. For instructions on adding dependencies for Eclipse projects, see our [Getting Started Guide](https://github.com/mopub/mopub-android-sdk/wiki/Getting-Started#adding-the-support-libraries-to-your-project)
## Important Message About Upgrading to MoPub SDK 4.4.0+
Version 4.4.0 of the MoPub SDK fixes a security issue identified by Google. Note that only publishers who received a message from Google are affected. While not all publishers are impacted, we recommend you upgrade to SDK 4.4.0+ ahead of Google's deadline (July 11, 2016) to avoid any issues submitting updates to your apps after the date. More information can be found in [Google's support article](https://support.google.com/faqs/answer/6345928).
## <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
`maven { url "https://s3.amazonaws.com/moat-sdk-builds" }`
to their `build.gradle` repositories block for these included dependencies to resolve.
## <a name="disableViewability"></a>Disabling Viewability Measurement
There are a few options for opting out of viewability measurement:
##### Strip out from JCenter Integration
Normally, to add the MoPub SDK to your app via JCenter, your `build.gradle` would contain:
```
dependencies {
compile('com.mopub:mopub-sdk:4.16.0@aar') {
transitive = true
}
}
```
Update to the following to exclude one or both viewability vendors:
```
dependencies {
compile('com.mopub:mopub-sdk:4.16.0@aar') {
transitive = true
exclude module: 'libAvid-mopub' // To exclude AVID
exclude module: 'moat-mobile-app-kit' // To exclude Moat
}
}
```
##### Strip out from GitHub integration
Navigate to the `gradle.properties` file in your home directory (e.g. `~/.gradle/gradle.properties`) and include one or both of these lines to opt out of viewability measurement for AVID and/or Moat.
```
mopub.avidEnabled=false
mopub.moatEnabled=false
```
##### Disable via API
If you would like to opt out of viewability measurement but do not want to modify the MoPub SDK, a function is provided for your convenience. At any point, call `MoPub.disableViewability(vendor);`. This method can can be called with any of the enum values available in `ExternalViewabilitySessionManager.ViewabilityVendor`: `AVID` will disable AVID but leave Moat enabled, `MOAT` will disable Moat but leave AVID enabled, and `ALL` will disable all viewability measurement.
## Working with Android 6.0 Runtime Permissions
If your app's target SDK is 23 or higher _**and**_ the user's device is running Android 6.0 or higher, you are responsible for supporting [runtime permissions](http://developer.android.com/training/permissions/requesting.html), one of the [changes](http://developer.android.com/about/versions/marshmallow/android-6.0-changes.html) introduced in Android 6.0 (API level 23). In addition to listing any dangerous permissions your app needs in the manifest, your app also has to explicitly request the dangerous permission(s) during runtime by calling method `requestPermissions()` in the [`ActivityCompat`](http://developer.android.com/reference/android/support/v4/app/ActivityCompat.html) class.
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
classpath 'com.android.tools.build:gradle:2.3.0'
classpath 'com.novoda:bintray-release:0.4.0'
}
}
Expand Down
1 change: 1 addition & 0 deletions extras/src/com/mopub/nativeads/FlurryNativeAdRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* specified in the FlurryNativeViewHolder.videoView to show a video. If a video is not available,
* this will still use the mainImageView.
*
*
* Certified with Flurry 7.2.0
*/
public class FlurryNativeAdRenderer implements
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
4 changes: 2 additions & 2 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="52"
android:versionName="4.15.0">
android:versionCode="53"
android:versionName="4.16.0">
<uses-sdk android:minSdkVersion="16"
android:targetSdkVersion="24"/>

Expand Down
13 changes: 7 additions & 6 deletions mopub-sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,25 @@ repositories {
flatDir {
dirs '../libs'
}
maven { url "https://s3.amazonaws.com/moat-sdk-builds" }
}

apply plugin: 'com.android.application'

project.group = 'com.mopub'
project.description = '''MoPub Sample App'''
project.version = '4.15.0'
project.version = '4.16.0'

android {
compileSdkVersion 24
compileSdkVersion 25
buildToolsVersion '25.0.2'
lintOptions { abortOnError false }

defaultConfig {
versionCode 52
versionCode 53
versionName version
minSdkVersion 16
targetSdkVersion 24
targetSdkVersion 25
}

buildTypes {
Expand Down Expand Up @@ -55,8 +56,8 @@ android {
}

dependencies {
compile 'com.android.support:support-v4:24.0.0'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.google.android.gms:play-services-ads:9.4.0'
compile 'com.android.support:recyclerview-v7:24.0.0'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile project(':mopub-sdk')
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@
import android.widget.Button;

import com.mopub.common.MoPubReward;
import com.mopub.mobileads.CustomEventRewardedVideo;
import com.mopub.mobileads.MoPubErrorCode;
import com.mopub.mobileads.MoPubRewardedVideoListener;
import com.mopub.mobileads.MoPubRewardedVideoManager.RequestParameters;
import com.mopub.mobileads.MoPubRewardedVideos;

import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
Expand All @@ -31,6 +34,10 @@ public class RewardedVideoDetailFragment extends Fragment implements MoPubReward

private static boolean sRewardedVideoInitialized;

// Include any custom event rewarded video classes, if available, for initialization.
private static final List<Class<? extends CustomEventRewardedVideo>> sNetworksToInit =
new LinkedList<>();

@Nullable private Button mShowButton;
@Nullable private String mAdUnitId;
@Nullable private Map<String, MoPubReward> mMoPubRewardsMap;
Expand All @@ -46,7 +53,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
hideSoftKeyboard(views.mKeywordsField);

if (!sRewardedVideoInitialized) {
MoPubRewardedVideos.initializeRewardedVideo(getActivity());
MoPubRewardedVideos.initializeRewardedVideo(getActivity(), sNetworksToInit);
sRewardedVideoInitialized = true;
}
MoPubRewardedVideos.setRewardedVideoListener(this);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package com.mopub.mobileads;

import android.app.Activity;
import android.content.Context;
import android.support.annotation.Nullable;

import com.mopub.common.AdReport;
import com.mopub.common.DataKeys;
import com.mopub.common.ExternalViewabilitySessionManager;
import com.mopub.common.logging.MoPubLog;
import com.mopub.mobileads.factories.HtmlBannerWebViewFactory;

Expand All @@ -14,8 +17,8 @@
import static com.mopub.mobileads.MoPubErrorCode.NETWORK_INVALID_STATE;

public class HtmlBanner extends CustomEventBanner {

private HtmlBannerWebView mHtmlBannerWebView;
@Nullable private ExternalViewabilitySessionManager mExternalViewabilitySessionManager;

@Override
protected void loadBanner(
Expand Down Expand Up @@ -48,11 +51,25 @@ protected void loadBanner(

mHtmlBannerWebView = HtmlBannerWebViewFactory.create(context, adReport, customEventBannerListener, isScrollable, redirectUrl, clickthroughUrl);
AdViewController.setShouldHonorServerDimensions(mHtmlBannerWebView);

if (context instanceof Activity) {
final Activity activity = (Activity) context;
mExternalViewabilitySessionManager = new ExternalViewabilitySessionManager(activity);
mExternalViewabilitySessionManager.createDisplaySession(activity, mHtmlBannerWebView);
} else {
MoPubLog.d("Unable to start viewability session for HTML banner: Context provided was not an Activity.");
}

mHtmlBannerWebView.loadHtmlResponse(htmlData);
}

@Override
protected void onInvalidate() {
if (mExternalViewabilitySessionManager != null) {
mExternalViewabilitySessionManager.endDisplaySession();
mExternalViewabilitySessionManager = null;
}

if (mHtmlBannerWebView != null) {
mHtmlBannerWebView.destroy();
}
Expand Down
Loading

0 comments on commit 328dcd8

Please sign in to comment.