From 1797769ee1fa32b7353edcd1ffdd6eb2bff496db Mon Sep 17 00:00:00 2001 From: "smartling-github-connector[bot]" <165276057+smartling-github-connector[bot]@users.noreply.github.com> Date: Thu, 7 Nov 2024 10:14:08 +0000 Subject: [PATCH] File src/content/docs/en/sdk/react-native/v4/features/subscriptions.mdx was translated to zh-CN locale --- .../v4/features/subscriptions.mdx | 159 ++++++++---------- 1 file changed, 66 insertions(+), 93 deletions(-) diff --git a/src/content/docs/zh/sdk/react-native/v4/features/subscriptions.mdx b/src/content/docs/zh/sdk/react-native/v4/features/subscriptions.mdx index 22bc7cf18c..68ced73424 100644 --- a/src/content/docs/zh/sdk/react-native/v4/features/subscriptions.mdx +++ b/src/content/docs/zh/sdk/react-native/v4/features/subscriptions.mdx @@ -1,47 +1,45 @@ --- -title: 发送订阅信息 -description: 使用这些方法向 Adjust 发送订阅信息。 -slug: zh/sdk/react-native/v4/features/subscriptions -versions: - - label: v5 - value: v5 - default: true - - label: v4 - value: v4 -redirects: - v5: /zh/sdk/react-native/features/subscriptions +title: "发送订阅信息" +description: "使用这些方法向 Adjust 发送订阅信息。" +slug: "en/sdk/react-native/v4/features/subscriptions" +versions: + - + label: "v5" + value: "v5" + default: true + - + label: "v4" + value: "v4" +redirects: + v5: "/en/sdk/react-native/features/subscriptions" --- + - - -下列步骤仅会在 Adjust SDK 中设置订阅监测。要启动该功能,Adjust 需要设置应用相关的具体信息。请发送邮件至 [support@adjust.com](mailto:support@adjust.com)或与您的技术客户经理联系进行设置。 - - +下列步骤仅会在 Adjust SDK 中设置订阅监测。要启用该功能,请按照[为应用设置订阅监测](https://help.adjust.com/en/article/set-up-subscriptions-for-your-app)中的步骤操作。 + 您可以用 Adjust SDK 记录 App Store 和 Play 应用商店的订阅,并验证这些订阅是否有效。用户购买订阅后,创建一个包含细节的 `AdjustAppStoreSubscription` 或 `AdjustPlayStoreSubscription` 实例。 -## 1\. Instantiate a subscription object {#1-instantiate-a-subscription-object} +1\. 实例化订阅对象\{\#instantiate\-a\-subscription\-object\} +------------------------------------------------------------ 要开始设置,先创建一个包含订阅购买细节的订阅对象。 - - - - + ```ts constructor(price: string, currency: string, transactionId: string, receipt: string) ``` - + 创建一个 `AdjustAppStoreSubscription` 对象,属性如下: -| 参数 | 数据类型 | 描述 | -| --------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `price` | `string` | 订阅价格 | +| 参数 | 数据类型 | 描述 | +|-----------------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `price` | `string` | 订阅价格 | | `currency` | `string` | 订阅使用的币种。此信息格式为 [`priceLocale`](https://developer.apple.com/documentation/foundation/nslocale/1642836-currencycode?language=objc) 对象的 [`currencyCode`](https://developer.apple.com/documentation/storekit/skproduct/1506145-pricelocale?language=objc)。 | -| `transactionId` | `string` | 您的交易 ID | -| `receipt` | `string` | 收据信息 | +| `transactionId` | `string` | 您的交易 ID | +| `receipt` | `string` | 收据信息 | ```jsx var subscription = new AdjustAppStoreSubscription( @@ -53,26 +51,24 @@ var subscription = new AdjustAppStoreSubscription( Adjust.trackAppStoreSubscription(subscription); ``` - - - + ```ts constructor(price: string, currency: string, sku: string, orderId: string, signature: string, purchaseToken: string) ``` - + 创建一个 `AdjustPlayStoreSubscription` 对象,属性如下: -| 参数 | 数据类型 | 描述 | -| --------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `price` | `string` | 订阅价格 | -| `currency` | `string` | 订阅使用的币种 | -| `sku` | `string` | 产品 ID | -| `orderId` | `string` | 您的交易 ID | -| `signature` | `string` | 购买数据的签名 | -| `purchaseToken` | `string` | 交易唯一识别码。请参考[Google 的文档](),了解更多信息。 | +| 参数 | 数据类型 | 描述 | +|-----------------|----------|------------------------------------------------------------------------------------------------------------------------------------| +| `price` | `string` | 订阅价格 | +| `currency` | `string` | 订阅使用的币种 | +| `sku` | `string` | 产品 ID | +| `orderId` | `string` | 您的交易 ID | +| `signature` | `string` | 购买数据的签名 | +| `purchaseToken` | `string` | 交易唯一识别码。请参考[Google 的文档](https://developer.android.com/reference/com/android/billingclient/api/Purchase#getPurchaseToken()),了解更多信息。 | ```jsx var subscription = new AdjustPlayStoreSubscription( @@ -85,22 +81,18 @@ var subscription = new AdjustPlayStoreSubscription( ); ``` - - + -### Record the purchase date {#record-the-purchase-date} +### 记录购买日期\{\#record\-the\-purchase\-date\} 您可以记录用户购买订阅的日期。SDK 会返回该数据用于报告。 - - - - + ```ts public setTransactionDate(transactionDate: string): void ``` - + 在您的订阅对象上调用 `setTransactionDate` 方法来记录订阅的时间戳。 @@ -116,15 +108,13 @@ subscription.setTransactionDate(transactionDate); Adjust.trackAppStoreSubscription(subscription); ``` - - - + ```ts public setPurchaseTime(purchaseTime: string): void ``` - + 在您的订阅对象上调用 `setPurchaseTime` 方法来记录订阅的时间戳。 @@ -140,20 +130,19 @@ var subscription = new AdjustPlayStoreSubscription( subscription.setPurchaseTime(purchaseTime); ``` - - + -### Record the purchase region \(iOS only\) {#record-the-purchase-region-ios-only} +### Record the purchase region \(iOS only\) \{\#record\-the\-purchase\-region\-ios\-only\} - + ```ts public setSalesRegion(salesRegion: string): void ``` - + -您可以记录用户购买订阅的地区。为此,请在订阅对象上调用 `setSalesRegion` 方法并将国家代码作为 `string` 传递。此信息格式需为 [`priceLocale`](https://developer.apple.com/documentation/storekit/skproduct/1506145-pricelocale?language=swift) 对象的 [`countryCode`](https://developer.apple.com/documentation/foundation/nslocale/1643060-countrycode?language=swift)。 +您可以记录用户购买订阅的地区。为此,请在订阅对象上调用 `setSalesRegion` 方法并将国家代码作为 `string` 传递。此信息格式需为 [`priceLocale`](https://developer.apple.com/documentation/foundation/nslocale/1643060-countrycode?language=swift) 对象的 [`countryCode`](https://developer.apple.com/documentation/storekit/skproduct/1506145-pricelocale?language=swift)。 ```jsx var subscription = new AdjustAppStoreSubscription( @@ -167,19 +156,16 @@ subscription.setSalesRegion(salesRegion); Adjust.trackAppStoreSubscription(subscription); ``` -### Add callback parameters {#add-callback-parameters} +### 添加回传参数\{\#add\-callback\-parameters\} 您可以向订阅对象附加回传参数。SDK 会将这些参数附加至您的回传 URL。要添加回传参数,请在订阅对象上调用 `addCallbackParameter` 方法。多次调用该方法可添加多个回传参数。 - - - - + ```ts public addCallbackParameter(key: string, value: string): void ``` - + ```jsx var subscription = new AdjustAppStoreSubscription( @@ -197,15 +183,13 @@ subscription.addCallbackParameter("key2", "value2"); Adjust.trackAppStoreSubscription(subscription); ``` - - - + ```ts public addCallbackParameter(key: string, value: string): void ``` - + ```jsx var subscription = new AdjustPlayStoreSubscription( @@ -221,22 +205,18 @@ subscription.addCallbackParameter("key1", "value1"); subscription.addCallbackParameter("key2", "value2"); ``` - - + -### Add partner parameters {#add-partner-parameters} +### 添加合作伙伴参数\{\#add\-partner\-parameters\} 您可以向订阅对象附加合作伙伴参数。用户购买订阅时,SDK 会将这些参数发送至 Adjust 服务器。Adjust 服务器会将此信息转发至您的合作伙伴。要添加合作伙伴参数,请在您的订阅对象上调用`addPartnerParameter`方法。多次调用该方法可添加多个合作伙伴参数。 - - - - + ```ts public addPartnerParameter(key: string, value: string): void ``` - + ```jsx var subscription = new AdjustAppStoreSubscription( @@ -254,15 +234,13 @@ subscription.addPartnerParameter("key2", "value2"); Adjust.trackAppStoreSubscription(subscription); ``` - - - + ```ts public addPartnerParameter(key: string, value: string): void ``` - + ```jsx var subscription = new AdjustPlayStoreSubscription( @@ -278,22 +256,19 @@ subscription.addPartnerParameter("key1", "value1"); subscription.addPartnerParameter("key2", "value2"); ``` - - + -## 2\. Record subscription information {#2-record-subscription-information} +2\. Record subscription information \{\#record\-subscription\-information\} +--------------------------------------------------------------------------------- 设置好订阅对象后,您就可以通过 Adjust SDK 对其进行记录了。 - - - - + ```ts trackAppStoreSubscription: (subscription: AdjustAppStoreSubscription) => void ``` - + 将订阅对象传送至 `trackAppStoreSubscription` 方法,以记录用户订阅购买。 @@ -310,15 +285,13 @@ subscription.setSalesRegion(salesRegion); Adjust.trackAppStoreSubscription(subscription); ``` - - - + ```ts trackPlayStoreSubscription: (subscription: AdjustPlayStoreSubscription) => void ``` - + 将订阅对象传送至 `trackPlayStoreSubscription` 方法,以记录用户订阅购买。 @@ -336,5 +309,5 @@ subscription.setPurchaseTime(purchaseTime); Adjust.trackPlayStoreSubscription(subscription); ``` - - + +