Skip to content

Commit

Permalink
Merge branch 'release/2.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
BytesZero committed Mar 18, 2022
2 parents 8806cf2 + 64806fa commit 5b4653c
Show file tree
Hide file tree
Showing 13 changed files with 15 additions and 26 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/flutter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ on:
branches:
- develop
- master
- 2x
- release/*
pull_request:
branches:
- develop
- 2x

# on: push # Default will running for every branch.

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.5.0 [2022-03-18]
* [修复] `splashButtonType` 新版 SKD 不存在的问题 [#20](https://github.com/FlutterAds/flutter_pangle_ads/issues/20)
* 升级 iOS SDK 到 `v4.3.0.4`
* 升级 Android SDK 到 Pro 版 `v4.3.0.8`

## 2.4.0 [2021-11-30]
* [新增] 信息流广告类型
* 升级 Android SDK 到 Pro 版 `v4.0.2.2`
Expand Down
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
<h3 align="center">一款优质的 Flutter 广告插件(字节跳动、穿山甲)</h3>

<p align="center">
<a href="https://pub.dev/packages/flutter_pangle_ads"><img src=https://img.shields.io/badge/version-v1.4.0-success></a>
<a href="https://pub.dev/packages/flutter_pangle_ads"><img src=https://img.shields.io/badge/null_safety-v2.4.0-success></a>
<a href="https://pub.dev/packages/flutter_pangle_ads"><img src=https://img.shields.io/badge/pub-v2.5.0-success></a>
<a href="https://github.com/FlutterAds/flutter_pangle_ads"><img src=https://img.shields.io/badge/platform-iOS%20%7C%20Android-brightgreen></a>
<a href="https://github.com/FlutterAds/flutter_pangle_ads/actions/workflows/flutter.yml"><img src="https://github.com/FlutterAds/flutter_pangle_ads/actions/workflows/flutter.yml/badge.svg?branch=2x"></a>
<a href="https://github.com/FlutterAds/flutter_pangle_ads/actions/workflows/flutter.yml"><img src="https://github.com/FlutterAds/flutter_pangle_ads/actions/workflows/flutter.yml/badge.svg"></a>
<a href="https://github.com/FlutterAds/flutter_pangle_ads"><img src=https://img.shields.io/github/stars/FlutterAds/flutter_pangle_ads?color=brightgreen></a>
<a href="https://github.com/FlutterAds/flutter_pangle_ads/blob/develop/LICENSE"><img src=https://img.shields.io/badge/license-MIT-brightgreen></a>
</p>
Expand Down Expand Up @@ -39,8 +38,7 @@

``` Dart
dependencies:
flutter_pangle_ads: ^1.4.0 # 非 Null Safety 版本
flutter_pangle_ads: ^2.4.0 # Null Safety 版本
flutter_pangle_ads: ^2.5.0
```
### 初始化广告

Expand All @@ -60,12 +58,10 @@ FlutterPangleAds.initAd(appId);
/// [posId] 广告位 id
/// [logo] 如果传值则展示底部logo,不传不展示,则全屏展示
/// [timeout] 加载超时时间
/// [buttonType] 开屏广告的点击区域,1:全都可以点击 2:仅有下载 Bar 区域可以点击
FlutterPangleAds.showSplashAd(
posId,
logo: 'flutterads_logo',
timeout: 3.5,
buttonType: 2,
);
```

Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ dependencies {
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
// 广告 SDK
implementation 'com.pangle.cn:ads-sdk-pro:4.0.2.2'
implementation 'com.pangle.cn:ads-sdk-pro:4.3.0.8'
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ public static PluginDelegate getInstance() {
public static final String KEY_LOGO = "logo";
// timeout 参数
public static final String KEY_TIMEOUT = "timeout";
// splashButtonType 参数
public static final String KEY_SPLASH_BUTTON_TYPE = "buttonType";

/**
* 插件代理构造函数构造函数
Expand Down Expand Up @@ -221,12 +219,10 @@ public void showSplashAd(MethodCall call, MethodChannel.Result result) {
String posId = call.argument(KEY_POSID);
String logo = call.argument(KEY_LOGO);
double timeout = call.argument(KEY_TIMEOUT);
int buttonType = call.argument(KEY_SPLASH_BUTTON_TYPE);
Intent intent = new Intent(activity, AdSplashActivity.class);
intent.putExtra(KEY_POSID, posId);
intent.putExtra(KEY_LOGO, logo);
intent.putExtra(KEY_TIMEOUT, timeout);
intent.putExtra(KEY_SPLASH_BUTTON_TYPE, buttonType);
activity.startActivity(intent);
// 设置进入动画
activity.overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ private void initData() {
// 获取参数
posId = getIntent().getStringExtra(PluginDelegate.KEY_POSID);
String logo = getIntent().getStringExtra(PluginDelegate.KEY_LOGO);
int buttonType = getIntent().getIntExtra(PluginDelegate.KEY_SPLASH_BUTTON_TYPE, TTAdConstant.SPLASH_BUTTON_TYPE_FULL_SCREEN);
double timeout = getIntent().getDoubleExtra(PluginDelegate.KEY_TIMEOUT, 3.5);
int absTimeout = (int) (timeout * 1000);
// 判断是否有 Logo
Expand Down Expand Up @@ -92,7 +91,6 @@ private void initData() {
.setCodeId(posId)
.setSupportDeepLink(true)
.setImageAcceptedSize(width, height)
.setSplashButtonType(buttonType)
.build();
// 加载广告
splashAD.loadSplashAd(adSlot, this, absTimeout);
Expand Down
2 changes: 1 addition & 1 deletion example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 29
ndkVersion "21.4.7075529"
ndkVersion "21.4.7075529" // 本地跑时可以去掉,CI 需要指定
lintOptions {
disable 'InvalidPackage'
}
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: FlutterAds 穿山甲广告 SDK 插件示例
# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: "none" # Remove this line if you wish to publish to pub.dev
version: 2.4.0+12
version: 2.5.0+14

environment:
sdk: ">=2.12.0 <3.0.0"
Expand Down
2 changes: 0 additions & 2 deletions ios/Classes/Page/SplashPage.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@ @implementation SplashPage
-(void)loadAd:(FlutterMethodCall *)call{
NSString* logo=call.arguments[@"logo"];
double timeout=[call.arguments[@"timeout"] doubleValue];
int buttonType=[call.arguments[@"buttonType"] intValue];
// 开屏页面
SplashViewController *svc=[[SplashViewController alloc] init];
svc.posId=self.posId;
svc.logo=logo;
svc.timeout=timeout;
svc.buttonType=buttonType;
svc.sp=self;
//设置全屏
svc.modalPresentationStyle = UIModalPresentationFullScreen;
Expand Down
1 change: 0 additions & 1 deletion ios/Classes/Page/SplashViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,copy) NSString *posId;
@property (nonatomic,copy) NSString *logo;
@property double timeout;
@property int buttonType;
@end

NS_ASSUME_NONNULL_END
2 changes: 1 addition & 1 deletion ios/flutter_pangle_ads.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
Pod::Spec.new do |s|
s.name = 'flutter_pangle_ads'
s.version = '2.4.0'
s.version = '2.5.0'
s.summary = '一款优质的 Flutter 广告插件(字节跳动、穿山甲)'
s.description = <<-DESC
FlutterAds 致力于构建优质的 Flutter 广告插件
Expand Down
4 changes: 1 addition & 3 deletions lib/flutter_pangle_ads.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,14 @@ class FlutterPangleAds {
/// [posId] 广告位 id
/// [logo] 如果传值则展示底部logo,不传不展示,则全屏展示
/// [timeout] 加载超时时间
/// [buttonType] 开屏广告的点击区域,1:全都可以点击 2:仅有下载 Bar 区域可以点击。具体参考:https://www.csjplatform.com/support/doc/611f0f0c1b039f004611e4da
static Future<bool> showSplashAd(String posId,
{String? logo, double timeout = 3.5, int buttonType = 1}) async {
{String? logo, double timeout = 3.5}) async {
final bool result = await _methodChannel.invokeMethod(
'showSplashAd',
{
'posId': posId,
'logo': logo,
'timeout': timeout,
'buttonType': buttonType,
},
);
return result;
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_pangle_ads
description: 一款优质的 Flutter 广告插件(字节跳动、穿山甲)
version: 2.4.0
version: 2.5.0
homepage: https://github.com/FlutterAds

environment:
Expand Down

0 comments on commit 5b4653c

Please sign in to comment.