Skip to content

Commit ead738f

Browse files
[interactive_media_ads] Reland "Creates and adds the interactive_media_ads plugin #6060" (#6425)
Relands #6060 with the addition of the `multidexEnabled` as mentioned in #6417. See #6417 for revert Part of flutter/flutter#134228
1 parent 88a02f0 commit ead738f

File tree

98 files changed

+3235
-0
lines changed

Some content is hidden

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

98 files changed

+3235
-0
lines changed

.github/dependabot.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,34 @@ updates:
395395
- dependency-name: "*"
396396
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
397397

398+
- package-ecosystem: "gradle"
399+
directory: "/packages/interactive_media_ads/android"
400+
commit-message:
401+
prefix: "[interactive_media_ads]"
402+
schedule:
403+
interval: "weekly"
404+
open-pull-requests-limit: 10
405+
ignore:
406+
- dependency-name: "com.android.tools.build:gradle"
407+
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
408+
- dependency-name: "junit:junit"
409+
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
410+
- dependency-name: "org.mockito:*"
411+
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
412+
- dependency-name: "androidx.test:*"
413+
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
414+
415+
- package-ecosystem: "gradle"
416+
directory: "/packages/interactive_media_ads/example/android/app"
417+
commit-message:
418+
prefix: "[interactive_media_ads]"
419+
schedule:
420+
interval: "weekly"
421+
open-pull-requests-limit: 10
422+
ignore:
423+
- dependency-name: "*"
424+
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
425+
398426
- package-ecosystem: "gradle"
399427
directory: "/packages/image_picker/image_picker/example/android/app"
400428
commit-message:

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ packages/google_identity_services_web/** @ditman
2323
packages/google_maps_flutter/** @stuartmorgan
2424
packages/google_sign_in/** @stuartmorgan
2525
packages/image_picker/** @tarrinneal
26+
packages/interactive_media_ads/** @bparrishMines
2627
packages/in_app_purchase/** @bparrishMines
2728
packages/local_auth/** @stuartmorgan
2829
packages/metrics_center/** @keyonghan

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ These are the packages hosted in this repository:
5656
| [google\_maps\_flutter](./packages/google_maps_flutter/) | [![pub package](https://img.shields.io/pub/v/google_maps_flutter.svg)](https://pub.dev/packages/google_maps_flutter) | [![pub points](https://img.shields.io/pub/points/google_maps_flutter)](https://pub.dev/packages/google_maps_flutter/score) | [![popularity](https://img.shields.io/pub/popularity/google_maps_flutter)](https://pub.dev/packages/google_maps_flutter/score) | [![GitHub issues by-label](https://img.shields.io/github/issues/flutter/flutter/p%3A%20maps?label=)](https://github.com/flutter/flutter/labels/p%3A%20maps) | [![GitHub pull requests by-label](https://img.shields.io/github/issues-pr/flutter/packages/p%3A%20google_maps_flutter?label=)](https://github.com/flutter/packages/labels/p%3A%20google_maps_flutter) |
5757
| [google\_sign\_in](./packages/google_sign_in/) | [![pub package](https://img.shields.io/pub/v/google_sign_in.svg)](https://pub.dev/packages/google_sign_in) | [![pub points](https://img.shields.io/pub/points/google_sign_in)](https://pub.dev/packages/google_sign_in/score) | [![popularity](https://img.shields.io/pub/popularity/google_sign_in)](https://pub.dev/packages/google_sign_in/score) | [![GitHub issues by-label](https://img.shields.io/github/issues/flutter/flutter/p%3A%20google_sign_in?label=)](https://github.com/flutter/flutter/labels/p%3A%20google_sign_in) | [![GitHub pull requests by-label](https://img.shields.io/github/issues-pr/flutter/packages/p%3A%20google_sign_in?label=)](https://github.com/flutter/packages/labels/p%3A%20google_sign_in) |
5858
| [image\_picker](./packages/image_picker/) | [![pub package](https://img.shields.io/pub/v/image_picker.svg)](https://pub.dev/packages/image_picker) | [![pub points](https://img.shields.io/pub/points/image_picker)](https://pub.dev/packages/image_picker/score) | [![popularity](https://img.shields.io/pub/popularity/image_picker)](https://pub.dev/packages/image_picker/score) | [![GitHub issues by-label](https://img.shields.io/github/issues/flutter/flutter/p%3A%20image_picker?label=)](https://github.com/flutter/flutter/labels/p%3A%20image_picker) | [![GitHub pull requests by-label](https://img.shields.io/github/issues-pr/flutter/packages/p%3A%20image_picker?label=)](https://github.com/flutter/packages/labels/p%3A%20image_picker) |
59+
| [interactive\_media\_ads](./packages/interactive_media_ads/) | [![pub package](https://img.shields.io/pub/v/interactive_media_ads.svg)](https://pub.dev/packages/interactive_media_ads) | [![pub points](https://img.shields.io/pub/points/interactive_media_ads)](https://pub.dev/packages/interactive_media_ads/score) | [![popularity](https://img.shields.io/pub/popularity/interactive_media_ads)](https://pub.dev/packages/interactive_media_ads/score) | [![GitHub issues by-label](https://img.shields.io/github/issues/flutter/flutter/p%3A%20interactive_media_ads?label=)](https://github.com/flutter/flutter/labels/p%3A%20interactive_media_ads) | [![GitHub pull requests by-label](https://img.shields.io/github/issues-pr/flutter/packages/p%3A%20interactive_media_ads?label=)](https://github.com/flutter/packages/labels/p%3A%20interactive_media_ads) |
5960
| [in\_app\_purchase](./packages/in_app_purchase/) | [![pub package](https://img.shields.io/pub/v/in_app_purchase.svg)](https://pub.dev/packages/in_app_purchase) | [![pub points](https://img.shields.io/pub/points/in_app_purchase)](https://pub.dev/packages/in_app_purchase/score) | [![popularity](https://img.shields.io/pub/popularity/in_app_purchase)](https://pub.dev/packages/in_app_purchase/score) | [![GitHub issues by-label](https://img.shields.io/github/issues/flutter/flutter/p%3A%20in_app_purchase?label=)](https://github.com/flutter/flutter/labels/p%3A%20in_app_purchase) | [![GitHub pull requests by-label](https://img.shields.io/github/issues-pr/flutter/packages/p%3A%20in_app_purchase?label=)](https://github.com/flutter/packages/labels/p%3A%20in_app_purchase) |
6061
| [ios\_platform\_images](./packages/ios_platform_images/) | [![pub package](https://img.shields.io/pub/v/ios_platform_images.svg)](https://pub.dev/packages/ios_platform_images) | [![pub points](https://img.shields.io/pub/points/ios_platform_images)](https://pub.dev/packages/ios_platform_images/score) | [![popularity](https://img.shields.io/pub/popularity/ios_platform_images)](https://pub.dev/packages/ios_platform_images/score) | [![GitHub issues by-label](https://img.shields.io/github/issues/flutter/flutter/p%3A%20ios_platform_images?label=)](https://github.com/flutter/flutter/labels/p%3A%20ios_platform_images) | [![GitHub pull requests by-label](https://img.shields.io/github/issues-pr/flutter/packages/p%3A%20ios_platform_images?label=)](https://github.com/flutter/packages/labels/p%3A%20ios_platform_images) |
6162
| [local\_auth](./packages/local_auth/) | [![pub package](https://img.shields.io/pub/v/local_auth.svg)](https://pub.dev/packages/local_auth) | [![pub points](https://img.shields.io/pub/points/local_auth)](https://pub.dev/packages/local_auth/score) | [![popularity](https://img.shields.io/pub/popularity/local_auth)](https://pub.dev/packages/local_auth/score) | [![GitHub issues by-label](https://img.shields.io/github/issues/flutter/flutter/p%3A%20local_auth?label=)](https://github.com/flutter/flutter/labels/p%3A%20local_auth) | [![GitHub pull requests by-label](https://img.shields.io/github/issues-pr/flutter/packages/p%3A%20local_auth?label=)](https://github.com/flutter/packages/labels/p%3A%20local_auth) |
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Below is a list of people and organizations that have contributed
2+
# to the Flutter project. Names should be added to the list like so:
3+
#
4+
# Name/Organization <email address>
5+
6+
Google Inc.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 0.0.1
2+
3+
* Adds platform interface for Android and iOS.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Copyright 2013 The Flutter Authors. All rights reserved.
2+
3+
Redistribution and use in source and binary forms, with or without modification,
4+
are permitted provided that the following conditions are met:
5+
6+
* Redistributions of source code must retain the above copyright
7+
notice, this list of conditions and the following disclaimer.
8+
* Redistributions in binary form must reproduce the above
9+
copyright notice, this list of conditions and the following
10+
disclaimer in the documentation and/or other materials provided
11+
with the distribution.
12+
* Neither the name of Google Inc. nor the names of its
13+
contributors may be used to endorse or promote products derived
14+
from this software without specific prior written permission.
15+
16+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
20+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
23+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# interactive\_media\_ads
2+
3+
Flutter plugin for the [Interactive Media Ads SDKs][1].
4+
5+
[![pub package](https://img.shields.io/pub/v/webview_flutter.svg)](https://pub.dev/packages/interactive_media_ads)
6+
7+
A Flutter plugin for using the Interactive Media Ads SDKs on Android and iOS.
8+
9+
| | Android | iOS |
10+
|-------------|---------|-------|
11+
| **Support** | SDK 19+ | 12.0+ |
12+
13+
**This package is still in development.**
14+
15+
[1]: https://developers.google.com/interactive-media-ads
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
group 'dev.flutter.packages.interactive_media_ads'
2+
version '1.0-SNAPSHOT'
3+
4+
buildscript {
5+
ext.kotlin_version = '1.7.10'
6+
repositories {
7+
google()
8+
mavenCentral()
9+
}
10+
11+
dependencies {
12+
classpath 'com.android.tools.build:gradle:8.0.0'
13+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14+
}
15+
}
16+
17+
allprojects {
18+
repositories {
19+
google()
20+
mavenCentral()
21+
}
22+
}
23+
24+
apply plugin: 'com.android.library'
25+
apply plugin: 'kotlin-android'
26+
27+
android {
28+
if (project.android.hasProperty("namespace")) {
29+
namespace 'dev.flutter.packages.interactive_media_ads'
30+
}
31+
32+
compileSdk 34
33+
34+
compileOptions {
35+
sourceCompatibility JavaVersion.VERSION_1_8
36+
targetCompatibility JavaVersion.VERSION_1_8
37+
}
38+
39+
kotlinOptions {
40+
jvmTarget = '1.8'
41+
}
42+
43+
sourceSets {
44+
main.java.srcDirs += 'src/main/kotlin'
45+
test.java.srcDirs += 'src/test/kotlin'
46+
}
47+
48+
defaultConfig {
49+
minSdk 19
50+
}
51+
52+
dependencies {
53+
implementation 'androidx.annotation:annotation:1.5.0'
54+
testImplementation 'junit:junit:4.13.2'
55+
testImplementation 'org.jetbrains.kotlin:kotlin-test'
56+
testImplementation 'org.mockito:mockito-inline:5.1.0'
57+
testImplementation 'androidx.test:core:1.3.0'
58+
}
59+
60+
lintOptions {
61+
checkAllWarnings true
62+
warningsAsErrors true
63+
disable 'AndroidGradlePluginVersion', 'InvalidPackage', 'GradleDependency'
64+
}
65+
66+
testOptions {
67+
unitTests.includeAndroidResources = true
68+
unitTests.returnDefaultValues = true
69+
unitTests.all {
70+
useJUnitPlatform()
71+
testLogging {
72+
events "passed", "skipped", "failed", "standardOut", "standardError"
73+
outputs.upToDateWhen {false}
74+
showStandardStreams = true
75+
}
76+
}
77+
}
78+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rootProject.name = 'interactive_media_ads'
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="dev.flutter.packages.interactive_media_ads">
3+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Copyright 2013 The Flutter Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
package dev.flutter.packages.interactive_media_ads
6+
7+
import io.flutter.embedding.engine.plugins.FlutterPlugin
8+
import io.flutter.plugin.common.MethodCall
9+
import io.flutter.plugin.common.MethodChannel
10+
import io.flutter.plugin.common.MethodChannel.MethodCallHandler
11+
import io.flutter.plugin.common.MethodChannel.Result
12+
13+
/** InteractiveMediaAdsPlugin */
14+
class InteractiveMediaAdsPlugin : FlutterPlugin, MethodCallHandler {
15+
/// The MethodChannel that will the communication between Flutter and native Android
16+
///
17+
/// This local reference serves to register the plugin with the Flutter Engine and unregister it
18+
/// when the Flutter Engine is detached from the Activity
19+
private lateinit var channel: MethodChannel
20+
21+
override fun onAttachedToEngine(flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
22+
channel = MethodChannel(flutterPluginBinding.binaryMessenger, "interactive_media_ads")
23+
channel.setMethodCallHandler(this)
24+
}
25+
26+
override fun onMethodCall(call: MethodCall, result: Result) {
27+
if (call.method == "getPlatformVersion") {
28+
result.success("Android ${android.os.Build.VERSION.RELEASE}")
29+
} else {
30+
result.notImplemented()
31+
}
32+
}
33+
34+
override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) {
35+
channel.setMethodCallHandler(null)
36+
}
37+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Copyright 2013 The Flutter Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
package dev.flutter.packages.interactive_media_ads
6+
7+
import io.flutter.plugin.common.MethodCall
8+
import io.flutter.plugin.common.MethodChannel
9+
import kotlin.test.Test
10+
import org.mockito.Mockito
11+
12+
/*
13+
* This demonstrates a simple unit test of the Kotlin portion of this plugin's implementation.
14+
*
15+
* Once you have built the plugin's example app, you can run these tests from the command
16+
* line by running `./gradlew testDebugUnitTest` in the `example/android/` directory, or
17+
* you can run them directly from IDEs that support JUnit such as Android Studio.
18+
*/
19+
20+
internal class InteractiveMediaAdsPluginTest {
21+
@Test
22+
fun onMethodCall_getPlatformVersion_returnsExpectedValue() {
23+
val plugin = InteractiveMediaAdsPlugin()
24+
25+
val call = MethodCall("getPlatformVersion", null)
26+
val mockResult: MethodChannel.Result = Mockito.mock(MethodChannel.Result::class.java)
27+
plugin.onMethodCall(call, mockResult)
28+
29+
Mockito.verify(mockResult).success("Android " + android.os.Build.VERSION.RELEASE)
30+
}
31+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Platform Implementation Test App
2+
3+
This is a test app for manual testing and automated integration testing
4+
of this platform implementation. It is not intended to demonstrate actual use of
5+
this package, since the intent is that plugin clients use the app-facing
6+
package.
7+
8+
Unless you are making changes to this implementation package, this example is
9+
very unlikely to be relevant.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
plugins {
2+
id "com.android.application"
3+
id "kotlin-android"
4+
id "dev.flutter.flutter-gradle-plugin"
5+
}
6+
7+
def localProperties = new Properties()
8+
def localPropertiesFile = rootProject.file('local.properties')
9+
if (localPropertiesFile.exists()) {
10+
localPropertiesFile.withReader('UTF-8') { reader ->
11+
localProperties.load(reader)
12+
}
13+
}
14+
15+
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
16+
if (flutterVersionCode == null) {
17+
flutterVersionCode = '1'
18+
}
19+
20+
def flutterVersionName = localProperties.getProperty('flutter.versionName')
21+
if (flutterVersionName == null) {
22+
flutterVersionName = '1.0'
23+
}
24+
25+
android {
26+
namespace "dev.flutter.packages.interactive_media_ads_example"
27+
compileSdk flutter.compileSdkVersion
28+
ndkVersion flutter.ndkVersion
29+
30+
compileOptions {
31+
sourceCompatibility JavaVersion.VERSION_1_8
32+
targetCompatibility JavaVersion.VERSION_1_8
33+
}
34+
35+
kotlinOptions {
36+
jvmTarget = '1.8'
37+
}
38+
39+
sourceSets {
40+
main.java.srcDirs += 'src/main/kotlin'
41+
}
42+
43+
defaultConfig {
44+
applicationId "dev.flutter.packages.interactive_media_ads_example"
45+
minSdk flutter.minSdkVersion
46+
targetSdk flutter.targetSdkVersion
47+
multiDexEnabled true
48+
versionCode flutterVersionCode.toInteger()
49+
versionName flutterVersionName
50+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
51+
}
52+
53+
buildTypes {
54+
release {
55+
signingConfig signingConfigs.debug
56+
}
57+
}
58+
}
59+
60+
flutter {
61+
source '../..'
62+
}
63+
64+
dependencies {
65+
testImplementation 'junit:junit:4.13.2'
66+
androidTestImplementation 'androidx.test:runner:1.2.0'
67+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
68+
api 'androidx.test:core:1.4.0'
69+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2013 The Flutter Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
package dev.flutter.packages.interactive_media_ads_example
6+
7+
import androidx.test.rule.ActivityTestRule
8+
import dev.flutter.plugins.integration_test.FlutterTestRunner
9+
import io.flutter.plugins.DartIntegrationTest
10+
import org.junit.Rule
11+
import org.junit.runner.RunWith
12+
13+
@DartIntegrationTest
14+
@RunWith(FlutterTestRunner::class)
15+
class MainActivityTest {
16+
@JvmField @Rule var rule = ActivityTestRule(MainActivity::class.java)
17+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2+
<!-- The INTERNET permission is required for development. Specifically,
3+
the Flutter tool needs it to communicate with the running application
4+
to allow setting breakpoints, to provide hot reload, etc.
5+
-->
6+
<uses-permission android:name="android.permission.INTERNET"/>
7+
<application android:usesCleartextTraffic="true">
8+
<activity
9+
android:name="dev.flutter.packages.interactive_media_ads_example.DriverExtensionActivity"
10+
android:launchMode="singleTop"
11+
android:theme="@style/LaunchTheme"
12+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
13+
android:hardwareAccelerated="true"
14+
android:windowSoftInputMode="adjustResize">
15+
<meta-data
16+
android:name="io.flutter.Entrypoint"
17+
android:value="integrationTestMain" />
18+
</activity>
19+
</application>
20+
</manifest>

0 commit comments

Comments
 (0)