Skip to content

Commit

Permalink
Introduce Rendering API (#305)
Browse files Browse the repository at this point in the history
* MOBILE-6999: Introduce the rendering module in prebid app (#1)

feat(Migration):
- Migrated Apollo SDK and omsdk modules to prebid
- Migrated GAM event handlers and mopub adapters modules
- Migrated internal test app
- Added TestUtils module and included it in SDK and GAM event handlers
- Using gradle.properties in each module to enable androidx support
- Added fastlane and jenkins scripts
- Updated gradle plugin and fixed issues after update

* MOBILE-7002: Rename modules and products (#2)

refactoring:
- Rename Test app module and package names
- Rename Rendering module and package names
- Rename GAM event handlers module and package names
- Update package name reference in layout files
- Remove mentions of apollo and openx
- Rename PPM to In-App
- Remove openx icon

* MOBILE-7013: Introduce ability to set custom host for pbs (#3)

* feat(PrebidRenderingSettings):
- Added ability to change bidServerHost

refactoring(DemoRenderingKotlin)
- Replaced reflection usage for setting bid server host

tests:
- Added unit test to verify that bid server host was changed (if not empty)

* refactoring(PrebidInternalTestApp):
- Rename prebid rendering demo app module

* feat(PrebidRenderingSettings):
- Introduced Host enum with RUBICON, APPNEXUS and CUSTOM values
- Added ability to set custom host through HOST enum
- Added host url validation to fetchDemand

tests:
- Added unit test to verify fetch demand error on invalid custom host
- Applied change to unit tests that rely on bid server host

* MOBILE-7010: Rename classes and methods (#4)

* refactoring:
- Removed mentions of OpenX and apollo where possible
- Renaming classes and methods with openx prefixes
- Renaming Gamutils methods
- Renaming tests and removing openx mentions from resources
- Renaming test utils package to org.prebid.mobile.test

* fix(ui tests):
- Applied changes for GAM UI tests to work until config changes are applied

* MOBILE-7037: Update mockito dependency (#5)

refactoring(Mockito):
- Update mockito version and applied changes for tests

* MOBILE-7007: Rename config keys (#6)

* refactoring(AppEvents):
- Changed app events constant
- Removed unneeded event field from utils

* refactoring(MoPub adapters):
- Changed adapter names to prebid
- Removed mentions of apollo / openx

* MOBILE-7043: Rename file signature (copyright) (#7)

chore(copyright):
- Added prebid copyright to rendering modules

* MOBILE-7049: Sync support of GDPR and CCPA (#8)

feat(UserConsentManager):
- Added handling of device purpose consent
- Cleanup unused variables

feat(Requester):
- Fetching ADID only if device consent is valid
- Nullifying ADID if consent is not granted (in case it changed)

tests(unit):
- Added unit tests to verify consent behaviour

* MOBILE-7046: Replace OM SDK with prebid version (#9)

chore(OM SDK):
- Replaced openx OM SDK with Prebid OM SDK
- Updated imports

* MOBILE-7055: Update GAM to latest version (#10)

refactoring(GAM SDK v20):
- Updated GAM SDK to v20
- Applied changes for RewardedAdWrapper, InterstitialWrapper, BannerWrapper
- Applied changes to GamUtils
- Applied changes to InternalTestApp
- Removed GAM reflection from rendering SDK. Providing access without reflection in GamUtils
- Renaming unified and customTemplate mentions

tests(unit):
- Applied GAM v20 changes to unit tests
- Added isLoad tests to ad wrappers
- Rename test methods

* MOBILE-7053: Update MoPub version in adapters (#11)

feat(MoPub adapters):
- Updated mopub to 5.16.4
- Removed mopub dependency from rendering module
- Remove deprecated classes from RV example

tests(unit)
- Moved tests with mopub dependency from rendering module to adapters module
- Created dummy mopub view in tests to verify keywords are set
- Added steps into dastfile to execute mopub adapter tests

* MOBILE-7044: Remove AdChoices functionality (#12)

refactoring(AdIndicator):
- Removed AdIndicator classes and resources
- Removed references to ad indicator

tests:
- Removed adIndicator unit / ui tests
- Modified MraidExpand tests to avoid dialog show execution

* MOBILE-7056: Introduce rendering module as part of Prebid (#13)

feat(gradle.publish):
- Added script to generate OM SDK POM
- Added script to generate MoPub Adapters POM
- Added script to generate GAM EH SDK POM
- Added script to generate rendering SDK POM
- Added shared build script to reduce duplication

feat(gradle):
- Renaming and moving common properties to project ext

feat(deployPrebidMobile):
- Simplifying script by extracting maven publishing into a separate function
- Added artifact generation and moving them to generated folder alongside prebid artifacts

* MOBILE-7057: Remove OX OXB prefixes (#14)

* refactoring:
- Remove mentions of OXM, OXA, OX, OXB prefixes in source code

* refactoring:
- Rename PbLog into LogUtil

* fix(buildPrebidMobile.sh):
- Fixed mkdir command failure due */META-INF folder exists

* chore:
- Applied changes to fix auto tests.

* fix(UserConsentManager):
- Change deviceConsent index to 0 and modified unit tests.

* MOBILE-7080: Sync request params with Prebid (#18)

* chore(request):
- Added "adslot" to imp.ext.context.data.adslot
- Added API for setting pbAdSlot
- Added "storedauctionresponse" and "storedbidresponse" support and API
- Added unit tests

* chore(Targeting):
- Removed possibility to set targeting for carrier and ip

* MOBILE-7090: Restore sending of OM event tracker (#19)

feat(NativeAdUnit):
- Appending omid tracker on adunit creation

tests:
- Added test to verify event tracker list contains OMID event

* Add switcher to demo app for GDPR

- Added gdpr helper class to work with updating iab values
- Added switch to change state of GDPR
- Disabling gdpr in ui tests

* Migration of rendering module and reviving unit tests.  (#281)

* feat: update buildPrebidMobile.sh script, add Proguard rules for rendering modules

* refactor(kotlin-app): refactore code, add data binding

* feat(kotlin-app): add in app rendering banner to test app

* feat(unit-tests): revive tests

Update tests dependencies.

* feat(instrumented-tests): update dependencies to make tests runnable

* feat(unit-tests): fix unit tests, update testPrebidMobile.sh to run rendering tests too (#275)

Co-authored-by: Valentin Petrovych <valllentua9128@gmail.com>

* Add in-app with gam example in PrebidInternalTestApp (#276) (#284)

* Fixed broken instrumented tests.  (#285)

* feat(project-structure): update project structure, add in-app with gam example in PrebidInternalTestApp (#276)

* feat(instrumented-tests): fix broken tests, check mock server #277

* feat(instrumented-tests): fix broken tests, check mock server #277

* Make native ad from rendering private, comment tests with native from InternalTestApp (#290)

* Added integration examples with rendering to PrebidDemoKotlin (#295)

* feat(DemoKotlin): add rendering examples, make code cleaner and flexible #286

* feat(DemoKotlin): fix ad unit ids and config ids, add required MoPub ad size parameter #286

* Created mediation api for scalable connecting mediation platforms (#299)

* feat(mediation): create scalable delegate for ad servers integrations #292

* feat(mediation): add documentation #292

* Actualize build and test scripts #293 (#301)

* Added content url field onto rendering API  (#302)

* feat(content url): add content url to rendering API #300

* feat(content url): rename method as in original SDK #300

* Provide access to the bid response  #297 (#304)

* Migrate project to AndroidX #294 (#298)

Co-authored-by: KostiantynTselykh <79995965+KostiantynTselykh@users.noreply.github.com>
Co-authored-by: KostiantynTselykh <konstantin.tseluch@openx.com>
Co-authored-by: Valentin Petrovych <72038591+ValentinPostindustria@users.noreply.github.com>
Co-authored-by: Valentin Petrovych <valllentua9128@gmail.com>
  • Loading branch information
5 people authored Dec 3, 2021
1 parent 71b97f6 commit 40e918f
Show file tree
Hide file tree
Showing 1,002 changed files with 90,373 additions and 670 deletions.
16 changes: 8 additions & 8 deletions Example/PrebidDemoJava/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,20 @@ dependencies {
implementation 'com.google.android.exoplayer:exoplayer-core:2.11.1'
implementation 'com.google.android.exoplayer:exoplayer-ui:2.11.1'
implementation 'com.google.android.exoplayer:extension-ima:2.11.1'
implementation 'com.android.support:multidex:1.0.3'
implementation 'androidx.multidex:multidex:2.0.0'
implementation('com.mopub:mopub-sdk:5.8.0@aar') {
transitive = true

exclude module: 'libAvid-mopub' // To exclude AVID
exclude module: 'moat-mobile-app-kit' // To exclude Moat
}

androidTestImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
androidTestImplementation 'androidx.test:rules:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-web:3.1.1'
androidTestImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test:rules:1.4.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.4.0'
androidTestImplementation 'androidx.test.espresso:espresso-web:3.4.0'
androidTestImplementation 'com.squareup.okhttp3:mockwebserver:3.2.0'
androidTestImplementation 'org.mockito:mockito-android:2.24.0'
androidTestImplementation 'org.mockito:mockito-android:4.0.0'
}
36 changes: 24 additions & 12 deletions Example/PrebidDemoKotlin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 28
buildToolsVersion "29.0.0"
compileSdkVersion 30
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "org.prebid.mobile.prebidkotlindemo"
minSdkVersion 16
targetSdkVersion 28
minSdkVersion 19
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand All @@ -22,25 +22,37 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildFeatures {
dataBinding true
}
}

dependencies {

implementation 'com.android.support:multidex:1.0.3'

implementation project(':PrebidMobile')
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':PrebidMobile-gamEventHandlers')
implementation project(':PrebidMobile-mopubAdapters')

// Standard libraries
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'com.google.android.gms:play-services-ads:20.0.0'
implementation('com.mopub:mopub-sdk:5.4.1@aar') {
transitive = true
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.preference:preference-ktx:1.1.1'

// Advertisement
implementation 'com.google.android.gms:play-services-ads:20.4.0'
implementation('com.mopub:mopub-sdk:5.17.0@aar') {
transitive = true
exclude module: 'libAvid-mopub' // To exclude AVID
exclude module: 'moat-mobile-app-kit' // To exclude Moat
}

// Multidex
implementation 'androidx.multidex:multidex:2.0.0'

// Tests
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
package org.prebid.mobile.prebidkotlindemo

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import android.content.Context
import androidx.test.core.app.ApplicationProvider
import org.junit.Assert.assertEquals
import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(androidx.test.ext.junit.runners.AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = androidx.test.platform.app.InstrumentationRegistry.getTargetContext()
assertEquals("org.prebid.mobile.prebidkotlindemo", appContext.packageName)
val context = ApplicationProvider.getApplicationContext<Context>()
assertEquals("org.prebid.mobile.prebidkotlindemo", context.packageName)
}
}
27 changes: 16 additions & 11 deletions Example/PrebidDemoKotlin/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
package="org.prebid.mobile.prebidkotlindemo">

<!-- Required permissions -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

<!-- Optional permissions. Will pass Lat/Lon values when available. Choose either Coarse or Fine -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

<!-- Optional permissions. Used for MRAID 2.0 storePicture ads -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

<application
android:name=".CustomApplication"
android:allowBackup="true"
Expand All @@ -22,30 +24,33 @@
<meta-data
android:name="com.google.android.gms.ads.AD_MANAGER_APP"
android:value="true"/>

<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.MAIN"/>

<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name=".DemoActivity" />
<activity android:name=".DemoActivity"/>

<!--MoPub Activities-->
<activity
android:name="com.mopub.mobileads.MoPubActivity"
android:configChanges="keyboardHidden|orientation|screenSize" />
android:configChanges="keyboardHidden|orientation|screenSize"/>
<activity
android:name="com.mopub.mobileads.MraidActivity"
android:configChanges="keyboardHidden|orientation|screenSize" />
android:configChanges="keyboardHidden|orientation|screenSize"/>
<activity
android:name="com.mopub.mobileads.RewardedMraidActivity"
android:configChanges="keyboardHidden|orientation|screenSize" />
android:configChanges="keyboardHidden|orientation|screenSize"/>
<activity
android:name="com.mopub.common.MoPubBrowser"
android:configChanges="keyboardHidden|orientation|screenSize" />
android:configChanges="keyboardHidden|orientation|screenSize"/>
<activity
android:name="com.mopub.mobileads.MraidVideoPlayerActivity"
android:configChanges="keyboardHidden|orientation|screenSize" />
android:configChanges="keyboardHidden|orientation|screenSize"/>

</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package org.prebid.mobile.prebidkotlindemo

import android.app.Activity
import android.view.ViewGroup

data class AdType(
var name: String,
var onCreate: (activity: Activity, wrapper: ViewGroup, autoRefreshTime: Int) -> Unit,
var onDestroy: (() -> Unit)? = null
)
Loading

0 comments on commit 40e918f

Please sign in to comment.