Skip to content

Commit

Permalink
Merge branch 'release/2.7.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
BytesZero committed Oct 24, 2023
2 parents 40f8dc5 + 090f6a9 commit 1c41ccb
Show file tree
Hide file tree
Showing 30 changed files with 634 additions and 49 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/flutter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ jobs:
steps:

# Setup Java environment in order to build the Android app.
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: '8.x'
distribution: 'temurin'
java-version: '11'
cache: 'gradle'
# Setup the flutter environment.
- uses: subosito/flutter-action@v1
- uses: subosito/flutter-action@v2
with:
channel: 'stable' # 'dev', 'alpha', default to: 'stable'
# flutter-version: '1.22.x' # you can also specify exact version of flutter
Expand All @@ -38,9 +40,6 @@ jobs:
# Statically analyze the Dart code for any errors.
- run: dart analyze .

# Run widget tests for our flutter project.
- run: flutter test

#####
# Build app
#####
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v3
- name: Publish
uses: sakebook/[email protected]
with:
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/publish_apk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v3
- name: Setup Java
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: '8.x'
distribution: 'temurin'
java-version: '11'
cache: 'gradle'
- name: Setup Flutter
uses: subosito/flutter-action@v1
uses: subosito/flutter-action@v2
with:
channel: 'stable' # 'dev', 'alpha', default to: 'stable'
#flutter-version: '1.22.x'
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 2.7.0 [2023-10-22]
* 🚀 推荐使用【[Gromore](https://flutterads.github.io/site/)】 让您的广告收益最大化
* [更新] Android SDK `v4.542.1412`
* [更新] iOS SDK `v4.14.45`

## 2.6.0 [2023-08-22]
* [更新] Android SDK `v4.540.1410`
* [更新] iOS SDK `v4.14.40`
Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<h3 align="center">一款优质的 Flutter 广告插件(腾讯广告、广点通、优量汇)</h3>

<p align="center">
<a href="https://github.com/FlutterAds/flutter_qq_ads"><img src=https://img.shields.io/badge/pub-v2.6.0-success></a>
<a href="https://github.com/FlutterAds/flutter_qq_ads"><img src=https://img.shields.io/badge/pub-v2.7.0-success></a>
<a href="https://github.com/FlutterAds/flutter_qq_ads"><img src=https://img.shields.io/badge/platform-iOS%20%7C%20Android-brightgreen></a>
<a href="https://github.com/FlutterAds/flutter_qq_ads/actions/workflows/flutter.yml"><img src="https://github.com/FlutterAds/flutter_qq_ads/actions/workflows/flutter.yml/badge.svg"></a>
<a href="https://github.com/FlutterAds/flutter_qq_ads"><img src=https://img.shields.io/github/stars/FlutterAds/flutter_qq_ads?color=brightgreen></a>
Expand All @@ -27,6 +27,12 @@
-[Banner](#Banner)
-[信息流](#信息流)

## 📣 推荐使用 GroMore

-[Gromore](https://flutterads.github.io/site/)】可进行多家广告瀑布流竞价,让您拥有更高的广告收益,发挥最大的用户价值

[![](https://raw.githubusercontent.com/FlutterAds/.github/main/gromore_pro_site.png)](https://flutterads.github.io/site/)

## 下载体验
<a href="https://www.pgyer.com/app/qrcode/fadsqq"><img src="https://raw.githubusercontent.com/yy1300326388/yy1300326388/main/images/gzh/gzh_qrcode.jpeg" width='100' height='100'></a>
> 回复 `优量汇体验`
Expand All @@ -36,7 +42,7 @@

``` Dart
dependencies:
flutter_qq_ads: ^2.6.0
flutter_qq_ads: ^2.7.0
```

### 初始化广告
Expand Down Expand Up @@ -312,5 +318,6 @@ pod install
|[flutter_qq_ads](https://github.com/FlutterAds/flutter_qq_ads)|腾讯广告、广点通、优量汇 Flutter 广告插件|
|[flutter_pangle_ads](https://github.com/FlutterAds/flutter_pangle_ads)|字节跳动、穿山甲 Flutter 广告插件|
|[flutter_gromore_ads](https://github.com/FlutterAds/flutter_gromore_ads)|字节跳动、穿山甲、Gromore 聚合 Flutter 广告插件|
|[flutter_gromore_pro](https://flutterads.github.io/site/)|🏆🏆🏆 帮你大幅提升广告收益,发挥出最大的用户价值|


2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ dependencies {
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
// 广告 SDK
implementation 'com.qq.e.union:union:4.540.1410'
implementation 'com.qq.e.union:union:4.542.1412'
}
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:4.2.1'
classpath 'com.android.tools.build:gradle:7.3.0'
}
}

Expand Down
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
Binary file added example/images/gromore_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example/images/gromore_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example/images/gromore_pro.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example/images/pro.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1300;
LastUpgradeCheck = 1430;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1430"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
23 changes: 1 addition & 22 deletions example/lib/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ class _HomePageState extends State<HomePage> {
@override
void initState() {
super.initState();
init().then((value) {
if (value) {
showSplashAd(AdsConfig.logo);
}
});
setAdEvent();
}

@override
Expand All @@ -50,9 +44,7 @@ class _HomePageState extends State<HomePage> {
children: [
ElevatedButton(
child: Text('初始化'),
onPressed: () {
init();
},
onPressed: () {},
),
SizedBox(height: 20),
ElevatedButton(
Expand Down Expand Up @@ -239,19 +231,6 @@ class _HomePageState extends State<HomePage> {
}
}

/// 初始化广告 SDK
Future<bool> init() async {
try {
bool result = await FlutterQqAds.initAd(AdsConfig.appId);
_result = "广告SDK 初始化${result ? '成功' : '失败'}";
return result;
} on PlatformException catch (e) {
_result =
"广告SDK 初始化失败 code:${e.code} msg:${e.message} details:${e.details}";
}
return false;
}

/// 展示开屏广告
/// [logo] 展示如果传递则展示logo,不传递不展示
Future<void> showSplashAd([String? logo]) async {
Expand Down
44 changes: 41 additions & 3 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
import 'package:flutter/material.dart';
import 'package:flutter_qq_ads_example/home_page.dart';
import 'package:flutter_qq_ads/flutter_qq_ads.dart';

import 'ads_config.dart';
import 'pages/home_page.dart';

void main() {
/// 绑定引擎
// 绑定引擎
WidgetsFlutterBinding.ensureInitialized();
setAdEvent();
init().then((value) {
if (value) {
FlutterQqAds.showSplashAd(
AdsConfig.splashId,
logo: AdsConfig.logo,
);
}
});

// 启动
runApp(MyApp());
}

Expand All @@ -15,6 +29,30 @@ class MyApp extends StatefulWidget {
class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return MaterialApp(home: HomePage());
return MaterialApp(
home: HomePage(),
);
}
}

/// 初始化广告 SDK
Future<bool> init() async {
bool result = await FlutterQqAds.initAd(AdsConfig.appId);
debugPrint("广告SDK 初始化${result ? '成功' : '失败'}");
return result;
}

/// 设置广告监听
Future<void> setAdEvent() async {
FlutterQqAds.onEventListener((event) {
debugPrint('adId:${event.adId} action:${event.action}');
if (event is AdErrorEvent) {
// 错误事件
debugPrint(' errCode:${event.errCode} errMsg:${event.errMsg}');
} else if (event is AdRewardEvent) {
// 激励事件
debugPrint(
' transId:${event.transId} userId:${event.userId} customData:${event.customData}');
}
});
}
37 changes: 37 additions & 0 deletions example/lib/pages/banner_page.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import 'package:flutter/material.dart';
import 'package:flutter_qq_ads/flutter_qq_ads.dart';

import '../ads_config.dart';
import '../widgets/widgets.dart';

class BannerPage extends StatefulWidget {
const BannerPage({Key? key}) : super(key: key);

@override
_BannerPageState createState() => _BannerPageState();
}

class _BannerPageState extends State<BannerPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: buildAppBar(context, 'Banner广告'),
body: Center(
child: Column(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(height: 20),
AdBannerWidget(
posId: AdsConfig.bannerId,
width: 300,
height: 80,
interval: 30,
show: true,
),
],
),
),
);
}
}
Loading

0 comments on commit 1c41ccb

Please sign in to comment.