# @javascriptcommon/react-native-google-mobile-ads 中文文档

规范地址：https://npmcn.com/package/%40javascriptcommon/react-native-google-mobile-ads/

版本：16\.3\.10
npm 元数据更新时间：2026-11-01T07:45:54.575Z
中文译文更新时间：2026-11-01T13:18:56.470Z
软件包许可：Apache-2\.0

本文由上游 README 机器翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40javascriptcommon/react-native-google-mobile-ads
原文对照：https://npmcn.com/package/%40javascriptcommon/react-native-google-mobile-ads/?lang=original
项目主页：https://github.com/invertase/react-native-google-mobile-ads#readme
源码仓库：https://github.com/invertase/react-native-google-mobile-ads

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：1.3 MB，626 个文件
- 模块格式：ESM + CJS
- TypeScript 类型：包内自带
- 运行依赖：2 个
- peer 依赖：expo \>=47\.0\.0
- 首次发布：2026-06-23T18:53:06.188Z
- 最新版本发布：2026-11-01T07:45:54.385Z
- 已发布版本数：8（近 12 个月 8 个）

## 中文简介

react-native-google-mobile-ads的分支迁移到Android上的GMA Next-Gen SDK （iOS保留了经典的谷歌Mobile Ads SDK）。支持横幅广告、插页广告和应用开放；原生广告和奖励并未移植到Android上。

## 安装

```sh
npm install @javascriptcommon/react-native-google-mobile-ads
```

也可以使用：`pnpm add @javascriptcommon/react-native-google-mobile-ads`、`yarn add @javascriptcommon/react-native-google-mobile-ads`、`bun add @javascriptcommon/react-native-google-mobile-ads`

## README

[![](https://npmcn.com/package/%40javascriptcommon/react-native-google-mobile-ads/docs/img/logo_admob_192px.svg)  
](https://docs.page/invertase/react-native-google-mobile-ads)

## React Native谷歌手机广告（次世代Android分支）

> **叉通知** - - - - - - `@javascriptcommon/react-native-google-mobile-ads` 迁移的 **安卓** 本地层到 **GMA下一代SDK** （`ads-mobile-sdk`）. iOS是 不变（经典GMA SDK）。在Android平台上，只有横幅广告/插页广告/ app-open / 同意得到执行；原生广告和奖励广告则不然。与上游相同的JS API。

[![NPM downloads](https://img.shields.io/npm/dm/react-native-google-mobile-ads.svg?style=flat-square)](https://www.npmjs.com/package/react-native-google-mobile-ads) [![NPM version](https://img.shields.io/npm/v/react-native-google-mobile-ads.svg?style=flat-square)](https://www.npmjs.com/package/react-native-google-mobile-ads) [![License](https://img.shields.io/npm/l/react-native-google-mobile-ads.svg?style=flat-square)](https://npmcn.com/LICENSE)

[![Chat on Discord](https://img.shields.io/discord/295953187817521152.svg?style=flat-square&colorA=7289da&label=Chat%20on%20Discord)](https://invertase.link/discord) [![Follow on Twitter](https://img.shields.io/twitter/follow/invertaseio.svg?style=flat-square&colorA=1da1f2&colorB=&label=Follow%20on%20Twitter)](https://twitter.com/invertaseio) [![Follow on Facebook](https://img.shields.io/badge/Follow%20on%20Facebook-4172B8?logo=facebook&style=flat-square&logoColor=fff)](https://www.facebook.com/groups/invertase.io)

* * *

**React Native谷歌移动广告** 允许你通过AdMob实现应用盈利；一个React Native的包装，围绕原生的谷歌移动广告sdk的iOS和Android。

React Native b谷歌移动广告是基于三个关键原则构建的；

-   🧪 **好测试**
    -   该模块经过广泛测试，覆盖率达到了95%（从react-native-firebase迁移到那里之后！）
-   👁 **好的类型**
    -   包括对Typescript的第一类支持
-   📄 **良好的文档记录**
    -   完整的参考和安装文档以及详细的指南和常见问题解答

## 广告形式

### 应用程序打开

应用打开广告是一种特殊的广告形式，专为希望从应用加载屏幕中获利的发行商设计。

![App open ad](https://developers.google.com/static/admob/images/app-open-ad.png)

[了解更多](https://docs.page/invertase/react-native-google-mobile-ads/displaying-ads#app-open-ads)

### 横幅

横幅广告单元显示矩形广告，占据应用布局的一部分。 当用户与应用交互时，它们会留在屏幕上，或者固定在屏幕的顶部或底部，或者在用户滚动时与内容嵌在一起。 横幅广告可以在一段时间后自动刷新。

#### 固定的自适应

全宽度和自动高度的动态大小的横幅。锚定自适应横幅预计将始终在屏幕上，锁定在屏幕的顶部或底部。

![Anchored adaptive](https://developers.google.com/static/admob/images/Android_adaptive.png)

[了解更多](https://docs.page/invertase/react-native-google-mobile-ads/displaying-ads#banner-ads-component)

#### 内联适应性

与锚定自适应横幅相比，内联自适应横幅更大、更高。 它们的高度是可变的，可以和设备屏幕一样高。 它们被放置在滚动内容中。

![Inline adaptive](https://developers.google.com/static/admob/images/inline-adaptive.png)

[了解更多](https://docs.page/invertase/react-native-google-mobile-ads/displaying-ads#banner-ads-component)

#### 可折叠的

可折叠横幅广告的目的是提高锚定广告的性能，否则是一个较小的尺寸。

![Collapsible banner](https://developers.google.com/static/admob/images/collapsible-banner.png)

[了解更多](https://docs.page/invertase/react-native-google-mobile-ads/displaying-ads#collapsible-banner-ads)

#### 固定大小（遗留）

谷歌移动广告SDK支持固定广告大小的情况下，自适应横幅广告不能满足您的需求。 横幅（320x50），大横幅（320x100），中矩形（300x250），全横幅（468x60）和排行榜（728x90）。

[了解更多](https://docs.page/invertase/react-native-google-mobile-ads/displaying-ads#banner-ads-component)

### 本地的

原生广告允许你自定义出现在应用中的广告的外观和感觉。 你决定它们的放置方式和位置，所以布局更符合你的应用设计。

![Native](https://developers.google.com/static/admob/images/format-native.svg)

[了解更多](https://docs.page/invertase/react-native-google-mobile-ads/native-ads)

### 间质

插页式广告单元在你的应用中显示整页广告。将它们放置在应用界面的自然休息和过渡处，例如在游戏应用中完成关卡后。

![Interstitial](https://developers.google.com/static/admob/images/format-interstitial.svg)

[了解更多](https://docs.page/invertase/react-native-google-mobile-ads/displaying-ads#interstitial-ads)

### 奖励

AdMob奖励广告单元允许你为与视频广告、可玩广告和调查互动的用户提供应用内道具奖励。

![Rewarded](https://developers.google.com/static/admob/images/format-rewarded.svg)

[了解更多](https://docs.page/invertase/react-native-google-mobile-ads/displaying-ads#rewarded-ads)

### 奖励间隙

奖励性插播广告是一种激励广告形式，允许你为在应用自然过渡期间自动出现的广告提供奖励。 与奖励广告不同的是，用户不需要选择是否观看奖励插播广告。

![Rewarded interstitial](https://developers.google.com/static/admob/images/format-rewarded-interstitial.svg)

[了解更多](https://docs.page/invertase/react-native-google-mobile-ads/displaying-ads#rewarded-interstitial-ads)

## 迁移到新的体系结构状态（向后兼容）

这个包可以在The Old和 [新建筑](https://reactnative.dev/docs/the-new-architecture/landing-page). 当使用新架构时，一些遗留代码仍然会被使用。请参阅下面的状态：

| 平台 | 特征 | 状态 |
| --- | --- | --- |
| iOS | 移动广告SDK方法（Turbo Native Module） | ✅完成 |
| iOS | 横幅（Fabric Native Component） | ✅完成 |
| iOS | 全屏广告（Turbo Native Module） | ✅完成 |
| iOS | 原生广告（Turbo原生模块，Fabric原生组件） | ✅完成 |
| iOS | 用户消息传递平台（Turbo原生模块） | ✅完成 |
| iOS | [EventEmitter](https://github.com/reactwg/react-native-new-architecture/blob/main/docs/turbo-modules.md#add-event-emitting-capabilities) （Turbo原生模块） | ⏳待办事项 |
| iOS | 收益精度常量（Turbo原生模块） | ✅完成 |
| 安卓 | 移动广告SDK方法（Turbo Native Module） | ⏳待办事项 |
| 安卓 | 横幅（Fabric Native Component） | ⏳待办事项 |
| 安卓 | 全屏广告（Turbo Native Module） | ⏳待办事项 |
| 安卓 | 原生广告（Turbo原生模块，Fabric原生组件） | ✅完成 |
| 安卓 | 用户消息传递平台（Turbo原生模块） | ⏳待办事项 |
| 安卓 | [EventEmitter](https://github.com/reactwg/react-native-new-architecture/blob/main/docs/turbo-modules.md#add-event-emitting-capabilities) （Turbo原生模块） | ⏳待办事项 |
| 安卓 | 收益精度常量（Turbo原生模块） | ⏳待办事项 |

## 文档

-   [安装](https://docs.page/invertase/react-native-google-mobile-ads)
-   [显示广告](https://docs.page/invertase/react-native-google-mobile-ads/displaying-ads)

## 贡献

-   [问题](https://github.com/invertase/react-native-google-mobile-ads/issues)
-   [PRs](https://github.com/invertase/react-native-google-mobile-ads/pulls)
-   [指导方针](https://github.com/invertase/react-native-google-mobile-ads/blob/main/CONTRIBUTING.md)
-   [行为准则](https://github.com/invertase/meta/blob/main/CODE_OF_CONDUCT.md)

## 许可证

-   看到 [许可证](https://npmcn.com/LICENSE)

* * *

[![](https://static.invertase.io/assets/invertase/invertase-rounded-avatar.png)](https://invertase.io/?utm_source=readme&utm_medium=footer&utm_campaign=react-native-google-mobile-ads)

建造和维护 [转化酶](https://invertase.io/?utm_source=readme&utm_medium=footer&utm_campaign=react-native-google-mobile-ads).

## 常见问题

### @javascriptcommon/react-native-google-mobile-ads 是什么？

react-native-google-mobile-ads的分支迁移到Android上的GMA Next-Gen SDK （iOS保留了经典的谷歌Mobile Ads SDK）。支持横幅广告、插页广告和应用开放；原生广告和奖励并未移植到Android上。

### 如何安装 @javascriptcommon/react-native-google-mobile-ads？

在项目目录运行 npm install @javascriptcommon/react-native-google-mobile-ads，或使用 pnpm add / yarn add / bun add。

### @javascriptcommon/react-native-google-mobile-ads 支持 TypeScript 吗？

支持。包内自带 TypeScript 类型声明（package\.json 声明了 types 入口），安装后即可获得类型提示，无需再安装 @types 包。

### @javascriptcommon/react-native-google-mobile-ads 支持 ESM 还是 CommonJS？

同时提供 ES Module 与 CommonJS 入口，import 和 require\(\) 都可以使用，打包工具会自动选择合适的版本。

### @javascriptcommon/react-native-google-mobile-ads 可以商用吗？

@javascriptcommon/react-native-google-mobile-ads 使用 Apache-2\.0 许可。宽松许可：允许商业使用、修改和再分发，并附带明确的专利授权；分发时需保留许可与 NOTICE 文件，修改过的文件要注明改动。以上为概括，不构成法律意见，请以许可原文为准。

### @javascriptcommon/react-native-google-mobile-ads 还在维护吗？

最新版本 16\.3\.10 发布于 2026/11/01（2 天前）；至今共发布 8 个版本，其中过去 12 个月发布了 8 个；首次发布于 2026/06/24。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

