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

cocos-admob-ios

v1.1.7

Published

A comprehensive AdMob integration for iOS apps built with Cocos Creator 3.8 or higher. Features include displaying banner ads, interstitial ads, and rewarded ads, providing a seamless advertising solution for developers.

Downloads

11

Readme

Cocos Creator 3.8 Admob iOS app

English

介紹

cocos-admob-ios 這個 npm 是提供給 cocos creator 3.8 版本以上的 iOS app,內有 3 個基礎的功能。

  1. 顯示橫幅廣告
  2. 顯示插頁廣告
  3. 獎勵廣告

工具

自動文件補足工具(cocos-native-ios-helper) : Download

配置設定

const config: GameCenterManagerConfig = {
  /** 是否開啟日誌 */
  openLog: true;
  /** banner(橫幅)廣告 */
   bannerAdId: "ca-app-pub-3940256099942544/2934735716",
  /** 插頁式廣告 */
    interstitialAdId: "ca-app-pub-3940256099942544/4411468910",
  /** 獎勵廣告 */
    rewardVideoAdId: "ca-app-pub-3940256099942544/1712485313",
}

// 使用 Admob 廣告前需要 initAd
AdmobAdManger.initAd(config);

使用範例

import { _decorator, Component, Label } from "cc";
import AdmobAdManger, { GameCenterManagerConfig } from "cocos-admob-ios";
const { ccclass, property } = _decorator;

@ccclass("AdmobManger")
export class AdmobManger extends Component {
  @property({ type: Label })
  public RewardLabel: Label = null;
  private _count: number = 0;

  start() {
    const config: GameCenterManagerConfig = { openLog: true };
    AdmobAdManger.initAd(config);
  }

  update(deltaTime: number) {}
  /** 觸發顯示獎勵廣告彈窗 */
  async onShowRewardedVideoAdClick(event: Event, str: string) {
    console.log("觸發顯示獎勵廣告彈窗");
    try {
      const reward = await AdmobAdManger.showRewardedVideoAd();
      console.log("弹出獎勵廣告事件", JSON.stringify(reward));
      if (reward.result === "complete") {
        console.log("獎勵廣告完成");
        // 增加獎勵廣告次數
        this._count++;
        if (this.RewardLabel) {
          this.RewardLabel.string = `獎勵次數:${this._count}`;
        }
      } else {
        console.log("獎勵廣告未完成");
      }
    } catch (error) {
      console.log("獎勵廣告錯誤", error);
    }
  }

  /** 顯示 橫幅廣告 */
  onShowBannerAdClick(event: Event, str: string) {
    console.log("顯示 橫幅廣告");
    AdmobAdManger.showBannerAd();
  }

  /** 關閉 橫幅廣告 */
  onHideBannerAdClick() {
    console.log("關閉 橫幅廣告");
    AdmobAdManger.hideBannerAd();
  }

  /** 觸發 插頁式廣告 */
  async onShowInterstitialAdClick(event: Event, str: string) {
    console.log("觸發 插頁式廣告");
    try {
      let result = await AdmobAdManger.showInterstitialAd();
      console.log("插頁式廣告 結果:", result);
    } catch (error) {
      console.log("插頁式廣告 錯誤:", error);
    }
  }
}

Issues

如果你發現了一個問題,或者有任何疑問,請訪問我們的 Issues 頁面 報告它。在創建一個新的 Issue 之前,請先檢查是否已有其他用戶報告了相同的問題。

Contact Me

若您在操作上遇到任何問題,或有無法解決的困難,歡迎透過 Discord (parazeni.ko) 聯繫我。 如果您有其他功能的相關知識,或願意分享技術資源,我也非常歡迎您的聯繫和交流。

Should you encounter any issues or have questions during the operation, feel free to reach out to me via Discord (parazeni.ko). Additionally, if you're willing to share more technical resources or interested in learning about other features, I'm open to communication as well.