-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
- Loading branch information
Showing
126 changed files
with
4,590 additions
and
639 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.appnexus.opensdk.csr.Facebook"> | ||
|
||
<uses-permission android:name="android.permission.INTERNET" /> | ||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | ||
|
||
<application android:hardwareAccelerated="true"> | ||
<activity | ||
android:name="com.facebook.ads.AudienceNetworkActivity" | ||
android:hardwareAccelerated="true" /> | ||
</application> | ||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
// Project Properties | ||
version = "5.7.1" // supported Facebook version | ||
|
||
apply plugin: 'com.android.library' | ||
|
||
android { | ||
compileSdkVersion 28 | ||
buildToolsVersion '29.0.0' | ||
|
||
defaultConfig { | ||
minSdkVersion 14 | ||
targetSdkVersion 28 | ||
versionCode 1 | ||
versionName version | ||
consumerProguardFiles 'proguard-project.txt' | ||
} | ||
|
||
sourceSets { | ||
main.manifest.srcFile 'AndroidManifest.xml' | ||
main.java.srcDir 'src' | ||
main.res.srcDir 'res' | ||
main.assets.srcDir 'assets' | ||
main.resources.srcDir 'src' | ||
} | ||
|
||
lintOptions { | ||
abortOnError false | ||
} | ||
|
||
} | ||
|
||
dependencies { | ||
api "com.facebook.android:audience-network-sdk:${project.version}@aar" | ||
api project(':sdk') | ||
} | ||
|
||
repositories { | ||
jcenter() | ||
} | ||
|
||
evaluationDependsOn(':sdk') | ||
ext { | ||
pom_name = "AppNexus Android SDK: Facebook Mediation Adapter" | ||
pom_description = "AppNexus's Android Advertising Libraries: Mediation adapter for Facebook" | ||
pom_url = "https://wiki.appnexus.com/display/sdk/Mobile+SDKs?src=search#MobileSDKs-Android" | ||
|
||
pom_groupId = "com.appnexus.opensdk.csr" | ||
pom_artifactId = "appnexus-facebook-csr" | ||
pom_packaging = "aar" | ||
pom_version = project(':sdk').version + "-" + project.version | ||
|
||
pom_distribution_snapshotRepo_id = "ossrh" | ||
pom_distribution_snapshotRepo_url = "https://oss.sonatype.org/content/repositories/snapshots" | ||
pom_distribution_repo_id = "ossrh" | ||
pom_distribution_repo_url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" | ||
|
||
username =project.hasProperty('nexusUsername') ? project.getProperties().get('nexusUsername') : "Replace your username here" | ||
password = project.hasProperty('nexusPassword') ? project.getProperties().get('nexusPassword') : "Replace your password here" | ||
} | ||
|
||
apply plugin: 'maven' | ||
apply plugin: 'signing' | ||
|
||
signing { | ||
sign configurations.archives | ||
} | ||
|
||
|
||
uploadArchives { | ||
configuration = configurations.archives | ||
repositories { | ||
mavenDeployer { | ||
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } | ||
repository(url: project.pom_distribution_repo_url) { | ||
authentication(userName: project.username, password: project.password) | ||
} | ||
snapshotRepository(url: project.pom_distribution_snapshotRepo_url) { | ||
authentication(userName: project.username, password: project.password) | ||
} | ||
pom.project { | ||
name project.pom_name | ||
packaging project.pom_packaging | ||
groupId project.pom_groupId | ||
artifactId project.pom_artifactId | ||
version project.pom_version | ||
//artifact("${project.buildDir}/outputs/aar/${project.name}-release.aar") | ||
description project.pom_description | ||
url project.pom_url | ||
scm { | ||
connection 'scm:git:[email protected]:appnexus/mobile-sdk-android.git' | ||
developerConnection 'scm:git:[email protected]:appnexus/mobile-sdk-android.git' | ||
url '[email protected]:appnexus/mobile-sdk-android.git' | ||
} | ||
licenses { | ||
license { | ||
name 'The Apache License, Version 2.0' | ||
url 'http://www.apache.org/licenses/LICENSE-2.0.txt' | ||
} | ||
} | ||
developers { | ||
developer { | ||
name 'AppNexus Mobile Team' | ||
email '[email protected]' | ||
organizationUrl 'http://www.appnexus.com' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# To enable ProGuard in your project, edit project.properties | ||
# to define the proguard.config property as described in that file. | ||
# | ||
# Add project specific ProGuard rules here. | ||
# By default, the flags in this file are appended to flags specified | ||
# in ${sdk.dir}/tools/proguard/proguard-android.txt | ||
# You can edit the include path and order by changing the ProGuard | ||
# include property in project.properties. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# Add any project specific keep options here: | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
-keep public class com.facebook.ads.* { public *;} | ||
-keepattributes Signature |
112 changes: 112 additions & 0 deletions
112
csr/Facebook/src/com/appnexus/opensdk/csr/FBNativeBanner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
/* | ||
* Copyright 2020 APPNEXUS INC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.appnexus.opensdk.csr; | ||
|
||
import android.content.Context; | ||
import android.text.TextUtils; | ||
|
||
import com.appnexus.opensdk.CSRAd; | ||
import com.appnexus.opensdk.CSRController; | ||
import com.appnexus.opensdk.ResultCode; | ||
import com.appnexus.opensdk.TargetingParameters; | ||
import com.facebook.ads.Ad; | ||
import com.facebook.ads.AdError; | ||
import com.facebook.ads.NativeAdListener; | ||
import com.facebook.ads.NativeBannerAd; | ||
|
||
import org.json.JSONException; | ||
import org.json.JSONObject; | ||
|
||
import java.lang.ref.WeakReference; | ||
|
||
public class FBNativeBanner implements CSRAd { | ||
@Override | ||
public void requestAd(Context context, String payload, final CSRController mBC, TargetingParameters tp) { | ||
if (!TextUtils.isEmpty(payload)) { | ||
String placementID = null; | ||
try { | ||
JSONObject payloadJSON = new JSONObject(payload); | ||
placementID = payloadJSON.getString("placement_id"); | ||
} catch (JSONException e) { | ||
e.printStackTrace(); | ||
} | ||
if (!TextUtils.isEmpty(placementID)) { | ||
final NativeBannerAd nativeBannerAd = new NativeBannerAd(context, placementID); | ||
nativeBannerAd.loadAd(nativeBannerAd.buildLoadAdConfig().withBid(payload).withAdListener(new NativeAdListener() { | ||
WeakReference<FBNativeBannerAdResponse> responseWeakReference = new WeakReference<>(null); | ||
|
||
@Override | ||
public void onMediaDownloaded(Ad ad) { | ||
|
||
} | ||
|
||
@Override | ||
public void onError(Ad ad, AdError adError) { | ||
ResultCode code; | ||
|
||
|
||
if (adError.getErrorCode() == AdError.NO_FILL.getErrorCode()) { | ||
code = ResultCode.UNABLE_TO_FILL; | ||
} else if (adError.getErrorCode() == AdError.LOAD_TOO_FREQUENTLY.getErrorCode()) { | ||
code = ResultCode.REQUEST_TOO_FREQUENT; | ||
} else if (adError.getErrorCode() == AdError.INTERNAL_ERROR.getErrorCode()) { | ||
code = ResultCode.INTERNAL_ERROR; | ||
} else { | ||
code = ResultCode.INTERNAL_ERROR; | ||
} | ||
|
||
mBC.onAdFailed(code); | ||
} | ||
|
||
@Override | ||
public void onAdLoaded(Ad ad) { | ||
FBNativeBannerAdResponse response = FBNativeBannerAdResponse.createResponse(nativeBannerAd); | ||
if (response == null) { | ||
mBC.onAdFailed(ResultCode.INTERNAL_ERROR); | ||
} else { | ||
mBC.onAdLoaded(response); | ||
responseWeakReference = new WeakReference<>(response); | ||
} | ||
|
||
} | ||
|
||
@Override | ||
public void onAdClicked(Ad ad) { | ||
mBC.onAdClicked(); | ||
if (responseWeakReference.get() != null) { | ||
FBNativeBannerAdResponse response = responseWeakReference.get(); | ||
if (response.nativeAdEventListener != null) { | ||
response.nativeAdEventListener.onAdWasClicked(); | ||
} | ||
} | ||
} | ||
|
||
@Override | ||
public void onLoggingImpression(Ad ad) { | ||
mBC.onAdImpression(); | ||
} | ||
}).build()); | ||
} else { | ||
mBC.onAdFailed(ResultCode.INVALID_REQUEST); | ||
} | ||
|
||
} else { | ||
mBC.onAdFailed(ResultCode.INVALID_REQUEST); | ||
} | ||
|
||
} | ||
} |
Oops, something went wrong.