Git Product home page Git Product logo

gromore's Introduction

穿山甲gromore聚合广告插件flutter版

⚠️ SDK已合并,请使用flutter_unionad,gromore不再维护

官方文档

版本更新

更新日志

本地开发环境

[✓] Flutter (Channel stable, 3.10.6, on macOS 13.5 22G74 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 14.3.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.1)
[✓] IntelliJ IDEA Ultimate Edition (version 2023.2)
[✓] VS Code (version 1.80.2)
[✓] Connected device (4 available)
[✓] Network resources

说明

iOS

运行环境配置 支持系统iOS 10.X 及以上; SDK编译环境 Xcode 13.1及以上版本;

插件

当前使用gromore基础库Ads-Mediation-CN_4.3.0.1, 穿山甲ABUAdCsjAdapter_5.3.0.4.0已内置,其他的广告adapter根据文档导入到podfile中

集成步骤

pubspec.yaml

gromore: ^0.0.3

引入

import 'package:gromore/gromore.dart';

使用

SDK初始化

await Gromore.register(
    //gromore广告 Android appid 必填
    androidAppId: "5205916",
    //gromore广告 ios appid 必填
    iosAppId: "5205916",
    //是否debug  上线改为false
    debug: false,
);

获取SDK版本

await Gromore.sdkVersion();

激励视频广告

预加载激励视频广告

await Gromore.loadRewardAd(
    //android广告ID
    androidId: "102110738",
    //ios广告ID
    iosId: "102110738",
    //奖励名称
    rewardName: "奖励100金币",
    //奖励金额
    rewardAmount: 100,
    //扩展参数,服务器回调使用
    extra: "111111",
    //用户id
    userID: "10000");

显示激励视频广告

  await Gromore.showRewardAd();

监听激励视频结果

GromoreStream.initAdStream(
//激励广告
    gromoreRewardCallBack: GromoreRewardCallBack(
        onShow: () {
          print("激励广告显示");
        },
        onClick: () {
          print("激励广告点击");
        },
        onFail: (code, message) {
          print("激励广告失败 $code $message");
        },
        onClose: () {
          print("激励广告关闭");
        },
        onReady: () async {
          print("激励广告预加载准备就绪");
          await Gromore.showRewardAd();
        },
        onUnReady: () {
          print("激励广告预加载未准备就绪");
        },
        onVerify: (verify, transId, rewardName, rewardAmount) {
          print("激励广告奖励 $verify $transId   $rewardName   $rewardAmount");
        }, onAdInfo: (GromoreAdInfo info) {
          print("激励相关信息 ${info.toJson()}");
      }));

信息流广告

配置广告时请使用模板广告

GroMoreNativeAd(
     //android广告id
     androidId: "102110836",
     //ios广告id
     iosId: "102110836",
     //宽
     width: 300,
     //高
     height: 200,
     callBack: GromoreNativeCallBack(
          onShow: () {
             print("信息流广告显示");
          },
          onFail: (code,error) {
             print("信息流广告失败 $error");
          },
          onClose: () {
             print("信息流广告关闭");
          },
          onClick: () {
             print("信息流广告点击");
       
          }, 
          onAdInfo: (GromoreAdInfo info) {
            print("信息流广告相关信息 ${info.toJson()}");
          }),
),

Banner(横幅)广告

配置广告时请使用模板广告

GromoreBannerAd(
     //android广告id
     androidId: "",
     //ios广告id
     iosId: "102110739",
     //宽
     width: 300,
     //高
     height: 200,
     callBack: GromoreBannerCallBack(
       onShow: () {
          print("banner广告显示");
       },
       onFail: (code,error) {
          print("banner广告失败 $error");
       },
       onClose: () {
          print("banner广告关闭");
       },
       onClick: () {
          print("banner广告点击");
       },
        onAdInfo: (GromoreAdInfo info) {
          print("信息流广告相关信息 ${info.toJson()}");
       }),
   ),

回调说明

GromoreAdInfo

广告加载相关信息

/// @Description: 广告加载相关信息
/// [adnName] ADN的名称,与平台配置一致,自定义ADN时为ADN唯一标识
/// [customAdnName] 自定义ADN的名称,与平台配置一致,非自定义ADN为nil
/// [slotID]  代码位
/// [levelTag] 价格标签,多阶底价下有效
/// [ecpm] 返回价格,nil为无权限
/// [biddingType] 广告类型
/// [errorMsg] 额外错误信息,一般为空(扩展字段)
/// [requestID]  adn提供的真实广告加载ID,可为空
GromoreAdInfo(
      {this.adnName,
        this.customAdnName,
        this.slotID,
        this.levelTag,
        this.ecpm,
        this.biddingType,
        this.errorMsg,
        this.requestID});

GromoreError

广告加载错误信息

/// [code] 错误码
/// [message] 错误信息
GromoreError(
    {this.code,
  this.message});

GromoreError

激励广告奖励信息

/// [verify] 是否有效
/// [transId] 验证id
/// [rewardName] 奖励名称
/// [rewardAmount] 奖励数量
GromoreVerify(
    {this.verify,
      this.transId,
      this.rewardName,
      this.rewardAmount});

插件链接

插件 地址
字节穿山甲广告插件 flutter_unionad
腾讯优量汇广告插件 flutter_tencentad
聚合广告插件 flutter_universalad
百度百青藤广告插件 flutter_baiduad
字节穿山甲内容合作插件 flutter_pangrowth
文档预览插件 file_preview
滤镜 gpu_image
Gromore聚合广告 gromore

联系方式

gromore's People

Contributors

gstory0404 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gromore's Issues

运行demo提示错误

感谢提供插件,运行示例的时候提示插件问题 ,麻烦指点下什么问题呢

An Observatory debugger and profiler on BKL AL20 is available at:
http://127.0.0.1:50850/qenUTkx0je4=/
E/flutter (10081): [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: MissingPluginException(No implementation found for method register on channel gromore)
E/flutter (10081): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:165:7)
E/flutter (10081):
E/flutter (10081): #1 Gromore.register (package:gromore/gromore.dart:21:12)
E/flutter (10081):
E/flutter (10081): #2 IndexPageState._initSDK (package:gromore_example/main.dart:74:13)
E/flutter (10081):
E/flutter (10081):

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.