sigmobad

Creator: coderz1093

Last updated:

0 purchases

TODO
Add to Cart

Description:

sigmobad

Sigmob广告 Flutter版本 #











官方文档 #

Android
IOS

版本更新 #
更新日志
本地开发环境 #
[✓] Flutter (Channel stable, 3.22.1, on macOS 14.5 23F79 darwin-x64, locale zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.1)
[✓] IntelliJ IDEA Ultimate Edition (version 2024.1.2)
[✓] VS Code (version 1.89.1)
[✓] Connected device (3 available)
[✓] Network resources
copied to clipboard
集成步骤 #
1、pubspec.yaml
sigmobad: ^latest
copied to clipboard
引入
import 'package:sigmobad/sigmobad.dart';
copied to clipboard
使用 #
1、SDK初始化 #
await SigmobAd.register(
//androidId
androidId: "6878",
//iosId
iosId: "6877",
//androidAppKey
androidAppKey: "8ebc1fd1c27e650c",
//iosAppKey
iosAppKey: "eccdcdbd9adbd4a7",
//是否显示日志log
debug: true,
//是否显示个性化推荐广告
personalized: true,
);
copied to clipboard
2、获取SDK版本 #
await SigmobAd.getSDKVersion();
copied to clipboard
3、信息流广告(自渲染) #
SigmobAdNativeWidget(
//andorid广告位id
androidId: "ed70b4760ff",
//ios广告位id
iosId: "ed70b3615a5",
//广告宽
viewWidth: 400,
//广告高 加载成功后会自动修改为sdk返回广告高
viewHeight: 200,
//用户id
userId: "123",
//广告回调
callBack: SigmobAdNativeCallBack(
onShow: () {
print("信息流广告显示");
},
onClose: () {
print("信息流广告关闭");
},
onFail: (message) {
print("信息流广告出错 $message");
},
onClick: () {
print("信息流广告点击");
},
),
),
copied to clipboard
4、激励广告 #
预加载广告
await SigmobAd.loadRewardAd(
//android广告id
androidId: "ea1f8ea2d90",
//ios广告id
iosId: "ea1f8f7b662",
//用户id
userID: "123",
//奖励
rewardName: "100金币",
//奖励数
rewardAmount: 100,
//扩展参数 服务器回调使用
customData: "",
);
copied to clipboard
显示广告
await SigmobAd.showRewardAd();
copied to clipboard
广告监听
SigmobAdStream.initAdStream(
//激励广告
rewardCallBack: SigmobAdRewardCallBack(
onShow: () {
print("激励广告显示");
},
onClick: () {
print("激励广告点击");
},
onFail: (message) {
print("激励广告失败 $message");
},
onClose: () {
print("激励广告关闭");
},
onReady: () async {
print("激励广告预加载准备就绪");
await SigmobAd.showRewardAd();
},
onUnReady: () {
print("激励广告预加载未准备就绪");
},
onVerify: (hasReward, rewardName, rewardAmount) {
print("激励广告奖励 $hasReward $rewardName $rewardAmount");
},
),
);
copied to clipboard
5、开屏广告 #
SigmobAdSplashWidget(
//android广告位id
androidId: "ea1f8f21300",
//ios广告位id
iosId: "ea1f8f9bd12",
//宽
width: MediaQuery.of(context).size.width,
//高
height: MediaQuery.of(context).size.height,
//超时时间
fetchDelay: 5,
//用户id
userId: "123",
callBack: SigmobAdSplashCallBack(
onShow: () {
print("开屏广告显示");
},
onClose: () {
print("开屏广告关闭");
Navigator.pop(context);
},
onFail: (message) {
print("开屏广告出错 $message");
},
onClick: () {
print("开屏广告点击");
},
),
),
copied to clipboard
6、插屏广告 #
预加载广告
await SigmobAd.loadInterstitialAd(
//android广告id
androidId: "ea1f8f45d80",
//ios广告id
iosId: "ea1f8fb93fb",
//用户id
userId: "123",
);
copied to clipboard
显示广告
await SigmobAd.showInterstitialAd();
copied to clipboard
广告监听
SigmobAdStream.initAdStream(
interstitialCallBack: SigmobAdInterstitialCallBack(
onShow: () {
print("插屏广告显示");
},
onClick: () {
print("插屏广告点击");
},
onFail: (message) {
print("插屏广告失败 $message");
},
onClose: () {
print("插屏广告关闭");
},
onReady: () async {
print("插屏广告预加载准备就绪");
await SigmobAd.showInterstitialAd();
},
onUnReady: () {
print("插屏广告预加载未准备就绪");
},
),
);
copied to clipboard
插件链接 #



插件
地址




字节-穿山甲广告插件
flutter_unionad


腾讯-优量汇广告插件
flutter_tencentad


百度-百青藤广告插件
baiduad


字节-Gromore聚合广告
gromore


Sigmob广告
sigmobad


聚合广告插件(迁移至GTAds)
flutter_universalad


GTAds聚合广告
GTAds


字节穿山甲内容合作插件
flutter_pangrowth


文档预览插件
file_preview


滤镜
gpu_image



开源不易,觉得有用的话可以请作者喝杯奶茶🧋 #

联系方式 #


Email: gstory0404@gmail.com


Blog:https://www.gstory.cn/


QQ群:

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.

Related Products

More From This Creator