@adobe/react-native-aepcampaignclassic

中文文档
7.0.0发布于 2025/03/29Apache-2.0TypeScriptCommonJS零依赖近 30 天下载 1692

Experience Platform Campaign Classic extension for Adobe Experience Platform Mobile SDK. Written and Supported by Adobe.

原始使用文档
文档目录10 节
  1. Peer Dependencies
  2. Installation
  3. Usage
  4. Initializing with SDK:
  5. Importing the extension:
  6. API reference
  7. Getting the SDK version:
  8. Register Device with Campaign Classic:
  9. Tracking Notification Click:
  10. Tracking Notification Receive:

React Native AEP Campaign Classic Extension

npm version npm downloads

@adobe/react-native-aepcampaignclassic is a wrapper around the iOS and Android Adobe Experience Platform Campaign Classic Extension to allow for integration with React Native applications.

Peer Dependencies

The Adobe Experience Platform Campaign Classic extension has the following peer dependency, which must be installed prior to installing the optimize extension:

Installation

See Requirements and Installation instructions on the main page

Install the @adobe/react-native-aepcampaignclassic package:

NPM:

npm install @adobe/react-native-aepcampaignclassic

Yarn:

yarn add @adobe/react-native-aepcampaignclassic

Usage

Initializing with SDK:

To initialize the SDK, use the following methods:

Refer to the root Readme for more information about the SDK setup.

Importing the extension:

import { CampaignClassic } from "@adobe/react-native-aepcampaignclassic";

API reference

Getting the SDK version:

Syntax

extensionVersion(): Promise<string>

Example

const version = await CampaignClassic.extensionVersion();
console.log(`AdobeExperienceSDK: Campaign Classic version: ${version}`);

Register Device with Campaign Classic:

This API dispatches a Campaign request content event containing registration information (device token, user key, and additional parameters). Syntax

registerDeviceWithToken(
    token: string,
    userKey: string,
    additionalParameters?: Record<string, any>
): void

Example

CampaignClassic.registerDeviceWithToken('myToken', 'myUserKey')
);

Tracking Notification Click:

Dispatch event containing tracking notification from notification click.

Syntax

trackNotificationClickWithUserInfo(userInfo: Record<string, any>): void

Example

CampaignClassic.trackNotificationClickWithUserInfo({
  _mId: "testId",
  _dId: "testId",
});

Tracking Notification Receive:

Dispatch event containing tracking notification from notification receive.

Syntax

CampaignClassic.trackNotificationReceiveWithUserInfo(userInfo: Record<string, any>): void;

Example

CampaignClassic.trackNotificationReceiveWithUserInfo({
  _mId: "testId",
  _dId: "testId",
});

版本与发布记录

@adobe/react-native-aepcampaignclassic 共发布 8 个版本,首次发布于 2022/10/28;过去 12 个月发布了 0 个版本。

版本发布日期距今
7.0.0latest2025/03/291.6 年前
6.0.22024/06/072 年前
6.0.12024/04/242 年前
6.0.02024/04/132 年前
5.0.02023/06/213 年前
2.0.02023/03/103 年前

关于 @adobe/react-native-aepcampaignclassic 的常见问题

@adobe/react-native-aepcampaignclassic 是什么?

Experience Platform Campaign Classic extension for Adobe Experience Platform Mobile SDK. Written and Supported by Adobe.

如何安装 @adobe/react-native-aepcampaignclassic?

在项目目录运行 npm install @adobe/react-native-aepcampaignclassic,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react-native(>=0.60.0)、@adobe/react-native-aepcore(^7.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@adobe/react-native-aepcampaignclassic 支持 TypeScript 吗?

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

@adobe/react-native-aepcampaignclassic 支持 ESM 还是 CommonJS?

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

@adobe/react-native-aepcampaignclassic 可以商用吗?

@adobe/react-native-aepcampaignclassic 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@adobe/react-native-aepcampaignclassic 的下载量有多少?

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

@adobe/react-native-aepcampaignclassic 还在维护吗?

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