@batch.com/react-native-plugin

中文文档
12.3.1发布于 2026/10/28MITTypeScriptCommonJS零依赖构建来源已验证近 30 天下载 2.4万

Batch.com React-Native Plugin

原始使用文档
Batch Logo

Batch React-Native Plugin

The Batch React-Native Plugin allows you to build meaningful communication experience in your Android/iOS app through highly personalized push notifications & In-App messages.

Our 📕 setup documentation details the steps to take for an easy and successful integration.

Prerequisites

As this plugin is built over Batch's Native SDKs, their respective Android and iOS requirements apply.

Documentation

  • Setup guide: start your implementation here!
  • Help center: answers to most questions you may have during the integration
  • API reference: this documents each of the classes and methods in the Batch React-Native Plugin

React Native architecture

Batch ships a TurboModule implementation for the React Native New Architecture. Starting with v12.0.0, the legacy bridge has been removed and the plugin now requires the New Architecture to be enabled.

You may also find this guide useful to review after integration to make sure you're ready to go live: How can I test the integration on iOS? / How can I test the integration on Android?

Swift Package Manager (iOS, experimental)

The plugin supports React Native's experimental Swift Package Manager integration, for iOS apps that use npx react-native spm instead of CocoaPods.

The plugin ships a self-managed ios/Package.swift, so no manual scaffolding is required. Install the plugin, then run your app's usual SPM setup:

npm install @batch.com/react-native-plugin
npx react-native spm   # regenerates the SPM autolinking graph

ios/Package.swift wires the native Batch iOS SDK as a Swift package dependency.

Releases

Release instructions are detailed in RELEASING.md.

Building

Build instructions are detailed in BUILDING.md.

Contributing

Please refer to our contributing guidelines.

Credits

Batch-React-Native-Plugin is based on bamlab's React Native plugin.

版本与发布记录

@batch.com/react-native-plugin 共发布 22 个版本,首次发布于 2022/07/27;过去 12 个月发布了 4 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
12.3.1latest2026/10/2810 天前
12.3.02026/09/161 个月前
12.2.02026/04/226 个月前
12.1.02025/12/0810 个月前
12.0.02025/11/071 年前
11.1.02025/10/211 年前

关于 @batch.com/react-native-plugin 的常见问题

@batch.com/react-native-plugin 是什么?

Batch.com React-Native Plugin

如何安装 @batch.com/react-native-plugin?

在项目目录运行 npm install @batch.com/react-native-plugin,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react-native(*)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@batch.com/react-native-plugin 支持 TypeScript 吗?

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

@batch.com/react-native-plugin 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@batch.com/react-native-plugin 可以商用吗?

@batch.com/react-native-plugin 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@batch.com/react-native-plugin 的下载量有多少?

根据 npm 官方下载统计,@batch.com/react-native-plugin 在 2026/10/08 – 2026/11/06 这 30 天内被下载 23,577 次,日均约 786 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@batch.com/react-native-plugin 还在维护吗?

最新版本 12.3.1 发布于 2026/10/28(10 天前);至今共发布 22 个版本,其中过去 12 个月发布了 4 个;首次发布于 2022/07/27。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。