npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cordova-plugin-admob-tencent

v1.0.15

Published

Cordova Plugin for Tencent Mobile Ads

Downloads

11

Readme

Tencent Admob for GDT / Cordova Plugin

release platforms qq

通过 Javascript 调用腾讯广点通(GDT)SDK 接口,渲染广告内容

官方 SDK 下载:

NPM

https://www.npmjs.com/package/cordova-plugin-admob-tencent

Installation

通过 Cordova Plugins 安装

$ cordova plugin add cordova-plugin-admob-tecent

通过 URL 安装

$ cordova plugin add https://github.com/liangyongxiong/cordova-plugin-admob-tencent.git

Usage

YOUR_APP_ID : 应用媒体ID

YOUR_POSITION_ID : 广告位ID

横幅广告(Banner)

interval : 刷新间隔(秒)

gps : 是否开启GPS(0-否,1-是)

close : 是否显示关闭按钮(0-否,1-是)

animation : 是否显示动画效果(0-否,1-是)

align : 显示位置(top-顶部,bottom-底部)

var banner = cordova.TencentAdMob.BannerAd.show({
    app: YOUR_APP_ID,
    position: YOUR_POSITION_ID,
    interval: 30,
    gps: 0,
    close: 1,
    animation: 0,
    align: 'bottom'
}).addEventListener('onSuccess', function(event) {
    console.log('Tencent AdMob banner onSuccess');

    // 5秒后自动关闭
    setTimeout(function() {
        banner.hide();
    }, 1000*5);
}).addEventListener('onError', function(event) {
    console.log('Tencent AdMob banner onError');
    console.error(event.msg);
}).addEventListener('onClose', function(event) {
    console.log('Tencent AdMob banner onClose');
}).addEventListener('onClick', function(event) {
    console.log('Tencent AdMob banner onClick');
}).addEventListener('onOpenOverlay', function(event) {
    console.log('Tencent AdMob banner onOpenOverlay');
}).addEventListener('onLeftApplication', function(event) {
    console.log('Tencent AdMob banner onLeftApplication');
});

插屏广告(Interstitial)

gps : 是否开启GPS(0-否,1-是)

popup : 是否使用弹出模式(0-否,1-是),仅针对 Android 平台

var interstitial = cordova.TencentAdMob.InterstitialAd.show({
    app: YOUR_APP_ID,
    position: YOUR_POSITION_ID,
    gps: 0,
    popup: 1
}).addEventListener('onSuccess', function(event) {
    console.log('Tencent AdMob interstitial onSuccess');

    // 5秒后自动关闭(仅针对 Android 平台下 popup = 1 的插屏广告有效)
    setTimeout(function() {
        interstitial.hide();
    }, 1000*5);
}).addEventListener('onError', function(event) {
    console.log('Tencent AdMob interstitial onError');
    console.error(event.msg);
}).addEventListener('onClose', function(event) {
    console.log('Tencent AdMob interstitial onClose');
}).addEventListener('onClick', function(event) {
    console.log('Tencent AdMob interstitial onClick');
}).addEventListener('onOpenOverlay', function(event) {
    console.log('Tencent AdMob interstitial onOpenOverlay');
}).addEventListener('onLeftApplication', function(event) {
    console.log('Tencent AdMob interstitial onLeftApplication');
});

开屏广告(Splash)

delay : 延迟加载时间上限(秒)

bottom : 底部填充区域,包括图片路径和填充区域高度(单位:dp)

cordova.TencentAdMob.SplashAd.show({
    app: YOUR_APP_ID,
    position: YOUR_POSITION_ID,
    delay: 3,
    bottom: {
        image: 'images/bottom.jpg',
        height: 120
    }
}).addEventListener('onSuccess', function(event) {
    console.log('Tencent AdMob splash onSuccess');
}).addEventListener('onError', function(event) {
    console.log('Tencent AdMob splash onError');
    console.error(event.msg);
}).addEventListener('onClose', function(event) {
    console.log('Tencent AdMob splash onClose');
}).addEventListener('onClick', function(event) {
    console.log('Tencent AdMob splash onClick');
}).addEventListener('onTick', function(event) {
    console.log('Tencent AdMob splash onTick');
    console.log('Milliseconds Until Finished : ' + event.milliseconds);
}).addEventListener('onLeftApplication', function(event) {
    console.log('Tencent AdMob splash onLeftApplication');
});

原生广告(Native)

count : 单次加载广告数量

cordova.TencentAdMob.NativeAd.load({
    app: YOUR_APP_ID,
    position: YOUR_POSITION_ID,
    count: 3,
}).addEventListener('onSuccess', function(event) {
    console.log('Tencent AdMob native onSuccess');

    // 原生广告的 JSON 数据
    alert(JSON.stringify(event.ads));
}).addEventListener('onError', function(event) {
    console.log('Tencent AdMob native onError');
});

FAQ

Empty

Support

Contribute

Please contribute! Look at the issues.

License

This project is licensed under MIT.