Skip to content
This repository has been archived by the owner on Mar 29, 2024. It is now read-only.

Commit

Permalink
2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
fan-neobiz-bot committed Aug 9, 2023
1 parent e55ddf2 commit 68f16c7
Show file tree
Hide file tree
Showing 43 changed files with 1,479 additions and 584 deletions.
4 changes: 2 additions & 2 deletions .fvm/fvm_config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"flutterSdkVersion": "3.7.3",
"flutterSdkVersion": "3.10.6",
"flavors": {}
}
}
29 changes: 26 additions & 3 deletions .metadata
Original file line number Diff line number Diff line change
@@ -1,10 +1,33 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.
# This file should be version controlled.

version:
revision: d8cbb80206db06d151206f8b599b7dde5a386a2d
channel: beta
revision: 9944297138845a94256f1cf37beb88ff9a8e811a
channel: stable

project_type: plugin

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: 9944297138845a94256f1cf37beb88ff9a8e811a
base_revision: 9944297138845a94256f1cf37beb88ff9a8e811a
- platform: android
create_revision: 9944297138845a94256f1cf37beb88ff9a8e811a
base_revision: 9944297138845a94256f1cf37beb88ff9a8e811a
- platform: ios
create_revision: 9944297138845a94256f1cf37beb88ff9a8e811a
base_revision: 9944297138845a94256f1cf37beb88ff9a8e811a

# User provided section

# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 2.0.1
- Bump up nendSDK_iOS to 8.1.0.

## 2.0.0
- Bump up nendSDK_iOS to 8.0.1.
- Bump up nendSDK_Android to 9.0.1.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Add this to your package's `pubspec.yaml` file and execute `flutter pub get`:
```Dart
dependencies:
nend_plugin: ^2.0.0
nend_plugin: ^2.0.1
```
## Preparation
Go to [nend admin page](https://www.nend.net/admin/login). Create ad space and obtain **apiKey**, **spotId**.
Expand Down
5 changes: 5 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,10 @@ android {

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

// For integration test
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.5.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
implementation 'net.nend.android:nend-sdk:9.0.1'
}
2 changes: 1 addition & 1 deletion example/.fvm/fvm_config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"flutterSdkVersion": "3.7.3",
"flutterSdkVersion": "3.10.6",
"flavors": {}
}
2 changes: 2 additions & 0 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ android {
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}

buildTypes {
Expand All @@ -64,4 +65,5 @@ dependencies {
testImplementation 'junit:junit:4.13.1'
androidTestImplementation 'com.android.support.test:runner:1.4.0'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.4.0'
implementation "androidx.multidex:multidex:2.0.1"
}
3 changes: 2 additions & 1 deletion example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
FlutterApplication and put your custom class here. -->
<application
android:label="nend_plugin_example"
android:icon="@mipmap/ic_launcher">
android:icon="@mipmap/ic_launcher"
android:name="androidx.multidex.MultiDexApplication">
<activity
android:name=".MainActivity"
android:exported="true"
Expand Down
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
130 changes: 130 additions & 0 deletions example/integration_test/banner_integration_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:nend_plugin/nend_plugin.dart';
import 'package:nend_plugin_example/banner.dart' as app;

void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();

group('Banner ad tests', () {
testWidgets('320x50 banner ad test', (tester) async {
app.main();
await tester.pumpAndSettle();

var banner = find.text('loadAd: 320x50');
await tester.tap(banner);
await tester.pump(new Duration(seconds: 3));

var playIcon = find.byIcon(Icons.play_arrow).at(1);
await tester.tap(playIcon);
await tester.pumpAndSettle();

final bannerAd =
find.byType(BannerAd).first.evaluate().single.widget as BannerAd;
expect(bannerAd.adjustSize, false);
expect(bannerAd.bannerSize, BannerSize.type320x50);

final loadCounter = find.text("onLoaded: 2");
expect(loadCounter, findsOneWidget);
final receiveCounter = find.text("onReceived: 2");
expect(receiveCounter, findsOneWidget);

/// Default interval for auto reload is 60 sec.
await tester.pump(new Duration(seconds: 30));
final receiveIncrementCounter = find.text("onReceived: 3");
expect(receiveIncrementCounter, findsOneWidget);
});

testWidgets('320x100 banner ad test', (tester) async {
app.main();
await tester.pumpAndSettle();

var banner = find.text('loadAd: 320x100');
await tester.tap(banner);
await tester.pump(new Duration(seconds: 3));

var playIcon = find.byIcon(Icons.play_arrow).at(1);
await tester.tap(playIcon);
await tester.pumpAndSettle();

final bannerAd =
find.byType(BannerAd).first.evaluate().single.widget as BannerAd;
expect(bannerAd.adjustSize, false);
expect(bannerAd.bannerSize, BannerSize.type320x100);

final loadCounter = find.text("onLoaded: 2");
expect(loadCounter, findsOneWidget);
final receiveCounter = find.text("onReceived: 2");
expect(receiveCounter, findsOneWidget);
});

testWidgets('300x100 banner ad test', (tester) async {
app.main();
await tester.pumpAndSettle();

var banner = find.text('loadAd: 300x100');
await tester.tap(banner);
await tester.pump(new Duration(seconds: 3));

var playIcon = find.byIcon(Icons.play_arrow).at(1);
await tester.tap(playIcon);
await tester.pumpAndSettle();

final bannerAd =
find.byType(BannerAd).first.evaluate().single.widget as BannerAd;
expect(bannerAd.adjustSize, false);
expect(bannerAd.bannerSize, BannerSize.type300x100);

final loadCounter = find.text("onLoaded: 2");
expect(loadCounter, findsOneWidget);
final receiveCounter = find.text("onReceived: 2");
expect(receiveCounter, findsOneWidget);
});

testWidgets('300x250 banner ad test', (tester) async {
app.main();
await tester.pumpAndSettle();

var banner = find.text('loadAd: 300x250');
await tester.tap(banner);
await tester.pump(new Duration(seconds: 3));

var playIcon = find.byIcon(Icons.play_arrow).at(1);
await tester.tap(playIcon);
await tester.pumpAndSettle();

final bannerAd =
find.byType(BannerAd).first.evaluate().single.widget as BannerAd;
expect(bannerAd.adjustSize, false);
expect(bannerAd.bannerSize, BannerSize.type300x250);

final loadCounter = find.text("onLoaded: 2");
expect(loadCounter, findsOneWidget);
final receiveCounter = find.text("onReceived: 2");
expect(receiveCounter, findsOneWidget);
});

testWidgets('728x90 banner ad test', (tester) async {
app.main();
await tester.pumpAndSettle();

var banner = find.text('loadAd: 728x90');
await tester.tap(banner);
await tester.pump(new Duration(seconds: 3));

var playIcon = find.byIcon(Icons.play_arrow).at(1);
await tester.tap(playIcon);

await tester.pumpAndSettle();
final bannerAd =
find.byType(BannerAd).first.evaluate().single.widget as BannerAd;
expect(bannerAd.adjustSize, false);
expect(bannerAd.bannerSize, BannerSize.type728x90);

/// Assuming that the testing device is NOT tablet.
final failedToLoadCounter = find.text("onFailedToLoad: 2");
expect(failedToLoadCounter, findsOneWidget);
});
});
}
47 changes: 47 additions & 0 deletions example/integration_test/interstitial_integration_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:nend_plugin_example/interstitial.dart' as app;

void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();

group('Interstitial ad tests', () {
testWidgets('Show interstitial ad 1', (tester) async {
app.main();
await tester.pumpAndSettle();

var loadInterstitial1 = find.textContaining('Load').first;
await tester.tap(loadInterstitial1);
await tester.pump(new Duration(seconds: 3));

final loadCounter = find.text("onLoaded: 1");
expect(loadCounter, findsOneWidget);

var showInterstitial1 = find.textContaining('Show').first;
await tester.tap(showInterstitial1);
await tester.pumpAndSettle();

final showCounter = find.text("onShown: 1");
expect(showCounter, findsOneWidget);
});

testWidgets('Show interstitial ad 2', (tester) async {
app.main();
await tester.pumpAndSettle();

var loadInterstitial2 = find.textContaining('Load').at(1);
await tester.tap(loadInterstitial2);
await tester.pump(new Duration(seconds: 3));

final loadCounter = find.text("onLoaded: 1");
expect(loadCounter, findsOneWidget);

var showInterstitial2 = find.textContaining('Show').at(1);
await tester.tap(showInterstitial2);
await tester.pumpAndSettle();

final showCounter = find.text("onShown: 1");
expect(showCounter, findsOneWidget);
});
});
}
25 changes: 25 additions & 0 deletions example/integration_test/interstitial_video_integration_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:nend_plugin_example/interstitial_video.dart' as app;

void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();

group('Interstitial video ad tests', () {
testWidgets('Show interstitial video ad', (tester) async {
app.main();
await tester.pumpAndSettle();

var loadInterstitialVideo = find.textContaining('Load').first;
await tester.tap(loadInterstitialVideo);
await tester.pump(new Duration(seconds: 10));

final loadCounter = find.text("onLoaded: 1");
expect(loadCounter, findsOneWidget);

var showInterstitialVideo = find.textContaining('Show').first;
await tester.tap(showInterstitialVideo);
await tester.pump(new Duration(seconds: 10));
});
});
}
25 changes: 25 additions & 0 deletions example/integration_test/rewarded_video_integration_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:nend_plugin_example/rewarded_video.dart' as app;

void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();

group('Rewarded video ad tests', () {
testWidgets('Show rewarded video ad', (tester) async {
app.main();
await tester.pumpAndSettle();

var loadRewardedVideo = find.textContaining('Load').first;
await tester.tap(loadRewardedVideo);
await tester.pump(new Duration(seconds: 10));

final loadCounter = find.text("onLoaded: 1");
expect(loadCounter, findsOneWidget);

var showRewardedVideo = find.textContaining('Show').first;
await tester.tap(showRewardedVideo);
await tester.pump(new Duration(seconds: 10));
});
});
}
20 changes: 20 additions & 0 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
4F82F8965BE757F198199D26 /* [CP] Copy Pods Resources */,
7105BE6CE11D781D4E4C13D5 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand Down Expand Up @@ -214,6 +215,7 @@
files = (
);
inputPaths = (
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
);
name = "Thin Binary";
outputPaths = (
Expand All @@ -240,6 +242,24 @@
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
showEnvVarsInLog = 0;
};
7105BE6CE11D781D4E4C13D5 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/integration_test/integration_test.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/integration_test.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
Expand Down
Loading

0 comments on commit 68f16c7

Please sign in to comment.