1 Star 3 Fork 0

武尊 / flutter_csj_gromore

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

字节跳动穿山甲广告平台 Flutter版本

简介

flutter_csj_gromore是一款集成了穿山甲GroMore的Flutter插件,方便直接调用穿山甲SDK方法,目前只支持Android。

官方文档

版本更新

更新日志

适配平台

  • ✅ 穿山甲(5.1.0.2.0)
  • ✅ 优量汇(4.510.1380)
  • ✅ 快手(3.3.38.0)
  • 🔲 百度
  • 🔲 Admob
  • 🔲 Unity
  • 🔲 Sigmob
  • 🔲 Mintegral

支持功能

  • ✅ 开屏广告
  • ✅ 激励视频
  • 🔲 信息流
  • 🔲 Banner
  • 🔲 插屏
  • 🔲 draw信息流

集成步骤

1、pubspec.yaml

flutter_csj_gromore:
  git:
    url: https://gitee.com/dengshiwu/flutter_csj_gromore.git
    ref: master

引入

import 'package:flutter_csj_gromore/gm_ad_plugin.dart';

2、Android

新增maven仓库地址

maven {
    url "https://artifact.bytedance.com/repository/pangle"
}
maven {
    url "https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_support/"
}
flatDir {
    dirs project(':flutter_csj_gromore').file('libs')
}

修改配置

无需额外配置,只需要修改android/app/src/main/AndroidManifest.xml文件


<manifest xmlns:tools="http://schemas.android.com/tools">
  <application tools:replace="android:label"></application>
</manifest>

iOS

暂不支持iOS

使用教程

1、初始化SDK


GMAdInitParamModel initParamModel = GMAdInitParamModel(
    appId: "应用ID",
    appName: "应用名称",
    debug: "是否开启调试"
);
GMAdPlugin.instance.init(initParamModel);

2、开屏广告

当前兜底广告只支持穿山甲平台 GmAdEarsPlatform.PANGLE

GMAdPlugin.instance.splashAd(
  adUnitId: "广告位ID",
  earsPlatform: GmAdEarsPlatform.PANGLE,
  earsCodeId: "代码位ID",
  callBack: GmAdSplashCallBack(
    adLoadFail: () {
      print('广告加载失败');
    },
    adLoadSuccess: () {
      print('广告加载成功');  
    },
    onAdClicked: () {
      print('点击了广告');
    },
    onAdShow: () {
      print('广告显示成功');
    },
    onAdShowFail: () {
      print('广告显示失败');
    },
    onAdSkip: () {
      print('点击了跳过广告');
    },
    onAdDismiss: () {
      print('广告倒计时结束');  
    },
  ),
);

3、激励视频

GMAdPlugin.instance.loadRewardVideoAd(
    adUnitId: "广告位ID",
    userId: "用户ID",
    rewardName: "奖励名称",
    rewardAmount: "奖励金额",
    extraData: "透传额外参数",
    callBack: GmAdRewardVideoCallBack(// TODO 回调),
);

空文件

简介

穿山甲广告平台聚合插件 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/dengshiwu/flutter_csj_gromore.git
git@gitee.com:dengshiwu/flutter_csj_gromore.git
dengshiwu
flutter_csj_gromore
flutter_csj_gromore
master

搜索帮助