Skip to content

Commit d259158

Browse files
committed
SDK v7.1
* commit 'ef1c9f639dcc35a2c4bd491d9f5930e056b71092': Updated Release Notes, Updated SDK/Instream Video version remove commented line fb_version Merge pull request #367 in MOBILE-SDK/app_mobile-sdk-android from ANAdResponseInfo_Implementation to develop Fix failing Unit Tests Remove Meta Data for Google Play Adapter remove total latency Merge pull request #343 in MOBILE-SDK/app_mobile-sdk-android from outlook_fb_integration to develop MS-4165 Remove total latency fields and logic MS-3581 InAppBrowser Redesign Google AdMob SDK v18.3.0 OMID Session Start Merge pull request #361 in MOBILE-SDK/app_mobile-sdk-android from MS-4152_Decimal_Comma_Representation to develop
2 parents d994ece + ef1c9f6 commit d259158

File tree

126 files changed

+4590
-639
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+4590
-639
lines changed

RELEASE-NOTES.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
## 7.1
2+
### New Feature
3+
+ MS-3956 Added ANAdResponseInfo to return associated data with Ad response
4+
+ MS-4075 Added Client Side Rendering for FB mediated Ads.
5+
### Mediation partner upgrade
6+
+ MS-4209 Google AdMob SDK v18.3.0
7+
### Improvements/Bug Fixes
8+
+ MS-3581 InApp Browser Redesign
9+
+ MS-3882 Added option to include "publisher_id" in Ad request
10+
+ MS-4166 Fixed VideoAd OMID session tracker firing bug
11+
112
## 7.0
213
### New Features
314
+ MS-3885 Added support for Multi Ad Request (MAR) [https://wiki.xandr.com/display/sdk/Single+Request+Mode+for+Android]

csr/Facebook/AndroidManifest.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.appnexus.opensdk.csr.Facebook">
4+
5+
<uses-permission android:name="android.permission.INTERNET" />
6+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
7+
8+
<application android:hardwareAccelerated="true">
9+
<activity
10+
android:name="com.facebook.ads.AudienceNetworkActivity"
11+
android:hardwareAccelerated="true" />
12+
</application>
13+
</manifest>

csr/Facebook/build.gradle

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
// Project Properties
2+
version = "5.7.1" // supported Facebook version
3+
4+
apply plugin: 'com.android.library'
5+
6+
android {
7+
compileSdkVersion 28
8+
buildToolsVersion '29.0.0'
9+
10+
defaultConfig {
11+
minSdkVersion 14
12+
targetSdkVersion 28
13+
versionCode 1
14+
versionName version
15+
consumerProguardFiles 'proguard-project.txt'
16+
}
17+
18+
sourceSets {
19+
main.manifest.srcFile 'AndroidManifest.xml'
20+
main.java.srcDir 'src'
21+
main.res.srcDir 'res'
22+
main.assets.srcDir 'assets'
23+
main.resources.srcDir 'src'
24+
}
25+
26+
lintOptions {
27+
abortOnError false
28+
}
29+
30+
}
31+
32+
dependencies {
33+
api "com.facebook.android:audience-network-sdk:${project.version}@aar"
34+
api project(':sdk')
35+
}
36+
37+
repositories {
38+
jcenter()
39+
}
40+
41+
evaluationDependsOn(':sdk')
42+
ext {
43+
pom_name = "AppNexus Android SDK: Facebook Mediation Adapter"
44+
pom_description = "AppNexus's Android Advertising Libraries: Mediation adapter for Facebook"
45+
pom_url = "https://wiki.appnexus.com/display/sdk/Mobile+SDKs?src=search#MobileSDKs-Android"
46+
47+
pom_groupId = "com.appnexus.opensdk.csr"
48+
pom_artifactId = "appnexus-facebook-csr"
49+
pom_packaging = "aar"
50+
pom_version = project(':sdk').version + "-" + project.version
51+
52+
pom_distribution_snapshotRepo_id = "ossrh"
53+
pom_distribution_snapshotRepo_url = "https://oss.sonatype.org/content/repositories/snapshots"
54+
pom_distribution_repo_id = "ossrh"
55+
pom_distribution_repo_url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
56+
57+
username =project.hasProperty('nexusUsername') ? project.getProperties().get('nexusUsername') : "Replace your username here"
58+
password = project.hasProperty('nexusPassword') ? project.getProperties().get('nexusPassword') : "Replace your password here"
59+
}
60+
61+
apply plugin: 'maven'
62+
apply plugin: 'signing'
63+
64+
signing {
65+
sign configurations.archives
66+
}
67+
68+
69+
uploadArchives {
70+
configuration = configurations.archives
71+
repositories {
72+
mavenDeployer {
73+
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
74+
repository(url: project.pom_distribution_repo_url) {
75+
authentication(userName: project.username, password: project.password)
76+
}
77+
snapshotRepository(url: project.pom_distribution_snapshotRepo_url) {
78+
authentication(userName: project.username, password: project.password)
79+
}
80+
pom.project {
81+
name project.pom_name
82+
packaging project.pom_packaging
83+
groupId project.pom_groupId
84+
artifactId project.pom_artifactId
85+
version project.pom_version
86+
//artifact("${project.buildDir}/outputs/aar/${project.name}-release.aar")
87+
description project.pom_description
88+
url project.pom_url
89+
scm {
90+
connection 'scm:git:git@github.com:appnexus/mobile-sdk-android.git'
91+
developerConnection 'scm:git:git@github.com:appnexus/mobile-sdk-android.git'
92+
url 'git@github.com:appnexus/mobile-sdk-android.git'
93+
}
94+
licenses {
95+
license {
96+
name 'The Apache License, Version 2.0'
97+
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
98+
}
99+
}
100+
developers {
101+
developer {
102+
name 'AppNexus Mobile Team'
103+
email 'sdk@appnexus.com'
104+
organizationUrl 'http://www.appnexus.com'
105+
}
106+
}
107+
}
108+
}
109+
}
110+
}

csr/Facebook/proguard-project.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# To enable ProGuard in your project, edit project.properties
2+
# to define the proguard.config property as described in that file.
3+
#
4+
# Add project specific ProGuard rules here.
5+
# By default, the flags in this file are appended to flags specified
6+
# in ${sdk.dir}/tools/proguard/proguard-android.txt
7+
# You can edit the include path and order by changing the ProGuard
8+
# include property in project.properties.
9+
#
10+
# For more details, see
11+
# http://developer.android.com/guide/developing/tools/proguard.html
12+
13+
# Add any project specific keep options here:
14+
15+
# If your project uses WebView with JS, uncomment the following
16+
# and specify the fully qualified class name to the JavaScript interface
17+
# class:
18+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19+
# public *;
20+
#}
21+
22+
-keep public class com.facebook.ads.* { public *;}
23+
-keepattributes Signature
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
/*
2+
* Copyright 2020 APPNEXUS INC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.appnexus.opensdk.csr;
18+
19+
import android.content.Context;
20+
import android.text.TextUtils;
21+
22+
import com.appnexus.opensdk.CSRAd;
23+
import com.appnexus.opensdk.CSRController;
24+
import com.appnexus.opensdk.ResultCode;
25+
import com.appnexus.opensdk.TargetingParameters;
26+
import com.facebook.ads.Ad;
27+
import com.facebook.ads.AdError;
28+
import com.facebook.ads.NativeAdListener;
29+
import com.facebook.ads.NativeBannerAd;
30+
31+
import org.json.JSONException;
32+
import org.json.JSONObject;
33+
34+
import java.lang.ref.WeakReference;
35+
36+
public class FBNativeBanner implements CSRAd {
37+
@Override
38+
public void requestAd(Context context, String payload, final CSRController mBC, TargetingParameters tp) {
39+
if (!TextUtils.isEmpty(payload)) {
40+
String placementID = null;
41+
try {
42+
JSONObject payloadJSON = new JSONObject(payload);
43+
placementID = payloadJSON.getString("placement_id");
44+
} catch (JSONException e) {
45+
e.printStackTrace();
46+
}
47+
if (!TextUtils.isEmpty(placementID)) {
48+
final NativeBannerAd nativeBannerAd = new NativeBannerAd(context, placementID);
49+
nativeBannerAd.loadAd(nativeBannerAd.buildLoadAdConfig().withBid(payload).withAdListener(new NativeAdListener() {
50+
WeakReference<FBNativeBannerAdResponse> responseWeakReference = new WeakReference<>(null);
51+
52+
@Override
53+
public void onMediaDownloaded(Ad ad) {
54+
55+
}
56+
57+
@Override
58+
public void onError(Ad ad, AdError adError) {
59+
ResultCode code;
60+
61+
62+
if (adError.getErrorCode() == AdError.NO_FILL.getErrorCode()) {
63+
code = ResultCode.UNABLE_TO_FILL;
64+
} else if (adError.getErrorCode() == AdError.LOAD_TOO_FREQUENTLY.getErrorCode()) {
65+
code = ResultCode.REQUEST_TOO_FREQUENT;
66+
} else if (adError.getErrorCode() == AdError.INTERNAL_ERROR.getErrorCode()) {
67+
code = ResultCode.INTERNAL_ERROR;
68+
} else {
69+
code = ResultCode.INTERNAL_ERROR;
70+
}
71+
72+
mBC.onAdFailed(code);
73+
}
74+
75+
@Override
76+
public void onAdLoaded(Ad ad) {
77+
FBNativeBannerAdResponse response = FBNativeBannerAdResponse.createResponse(nativeBannerAd);
78+
if (response == null) {
79+
mBC.onAdFailed(ResultCode.INTERNAL_ERROR);
80+
} else {
81+
mBC.onAdLoaded(response);
82+
responseWeakReference = new WeakReference<>(response);
83+
}
84+
85+
}
86+
87+
@Override
88+
public void onAdClicked(Ad ad) {
89+
mBC.onAdClicked();
90+
if (responseWeakReference.get() != null) {
91+
FBNativeBannerAdResponse response = responseWeakReference.get();
92+
if (response.nativeAdEventListener != null) {
93+
response.nativeAdEventListener.onAdWasClicked();
94+
}
95+
}
96+
}
97+
98+
@Override
99+
public void onLoggingImpression(Ad ad) {
100+
mBC.onAdImpression();
101+
}
102+
}).build());
103+
} else {
104+
mBC.onAdFailed(ResultCode.INVALID_REQUEST);
105+
}
106+
107+
} else {
108+
mBC.onAdFailed(ResultCode.INVALID_REQUEST);
109+
}
110+
111+
}
112+
}

0 commit comments

Comments
 (0)