Skip to content

Commit

Permalink
Reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
nihalgonsalves committed Jan 30, 2025
1 parent 6e96b9c commit 185e50f
Show file tree
Hide file tree
Showing 12 changed files with 305 additions and 208 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,19 @@ The default sidebar is rendered at the bottom of `sidebars.js`.

- Install dependencies

```sh
$ yarn install
```
```sh
$ yarn install
```

- Optionally install [typos-cli](https://github.com/crate-ci/typos)

```sh
brew install typos-cli
```
```sh
brew install typos-cli
```

See the link for other options.
This is optional, but will enable running it via the pre-commit hook. You can also use the recommended [vscode extension](https://marketplace.visualstudio.com/items?itemName=tekumara.typos-vscode) or let it run via GitHub Actions when you create a PR.
See the link for other options.

This is optional, but will enable running it via the pre-commit hook. You can also use the recommended [vscode extension](https://marketplace.visualstudio.com/items?itemName=tekumara.typos-vscode) or let it run via GitHub Actions when you create a PR.

### Local Development

Expand Down
57 changes: 35 additions & 22 deletions docs/getting-started/entitlements/roku-products.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@ slug: roku-products
excerpt: Setting up your in-app purchases in Roku
hidden: false
---

:::warning Beta Feature
RevenueCat's Roku support is currently in beta.
:::

To set up in-channel products for Roku, start by logging into the [Roku dashboard](https://developer.roku.com/dev/landing).
To set up in-channel products for Roku, start by logging into the [Roku dashboard](https://developer.roku.com/dev/landing).

**This guide assumes basic knowledge of Roku and the Roku dashboard, as well as having a Roku channel set up and ready for products.** For more information, visit Roku's [documentation](https://developer.roku.com/docs/developer-program/getting-started/roku-dev-prog.md).

## Create a new Product

This process is going to configure a subscription product, but the steps are similar for creating other products. To configure other types of products, select the appropriate 'Purchase Type'. However, please read our [limitations](/getting-started/installation/roku#beta-limitations) on what we currently support in this beta program.

To create a new in-channel product, click on products in the sidebar of the Roku Developer Dashboard, then click **Add a new product**.
Expand All @@ -22,101 +24,112 @@ To create a new in-channel product, click on products in the sidebar of the Roku
![](/images/roku/roku-add-product.png)

### Product basics

![](/images/roku/roku-product-basics.png)

- **Channels**: From the channels list, select one or more channels where this product will be available for sale. The channels listed in this selection show the channels belonging to the root account.
- **Product category**: Select a product category for the product you are creating.
- _Video_: Primarily video content, includes music videos.
- _Audio_: Primarily audio content without accompanying video, such as streaming music services or audio-only podcasts.
- _Game_: Primarily functions as a game.
- _App/Utility_: Application or utility. Examples include screensavers, weather apps, etc.
- _Video_: Primarily video content, includes music videos.
- _Audio_: Primarily audio content without accompanying video, such as streaming music services or audio-only podcasts.
- _Game_: Primarily functions as a game.
- _App/Utility_: Application or utility. Examples include screensavers, weather apps, etc.
- **Product name**: Enter a 30-character maximum product name in English. The product name will be disaplued to your customers in their purchasing workflow, as well as emails sent by Roku. Roku recommends the following syntax: "channelName - planName".

:::warning
The product name must clearly identify the service being offered. Product names may not include the name "Roku", text related to a trial or discount offer, or any misleading language.
The product name must clearly identify the service being offered. Product names may not include the name "Roku", text related to a trial or discount offer, or any misleading language.
:::

- **Localization**: Optionally, you can also provide a localized product name by selecting 'Add product name in another language', selecting a language, and entering the product localized name. Repeat this to create another localized name.
- **Product identifier**: The product identifier is a unique ID that is used for accessing your product in development and syncing with RevenueCat. After you use a Product ID for one product within a Roku Channel Store, it can’t be used again. It helps to be a little organized here from the beginning - we recommend using a consistent naming scheme across all of your product identifiers.

### Product pricing

![](/images/roku/roku-product-pricing.png)

- **Purchase type**: The purchase type list will allow you to select the following types for the product being created:
- _Monthly subscription_: A product that will auto-renew monthly.
- _Yearly subscription_: A product that will auto-renew annually.
- _One-time Purchase_: This product type may only be purchased a single time.
- _One-time Purchase, Consumable - Quantity_ This is a "packet" of identical items (e.g: number of viewings permitted).
- _Monthly subscription_: A product that will auto-renew monthly.
- _Yearly subscription_: A product that will auto-renew annually.
- _One-time Purchase_: This product type may only be purchased a single time.
- _One-time Purchase, Consumable - Quantity_ This is a "packet" of identical items (e.g: number of viewings permitted).

:::warning One-time and consumable product limitations
At the moment, RevenueCat does not support One-time Purchase and One-time Purchase, Consumable - Quantity products
:::

- **Price tier**: Roku's price tiers enforce a 99 cent or 49 cent pricing tier.
- One to three-digit tier numbers are used for 99 cent pricing. To calculate, you can subtract 1 cent from the tier to get the corresponding price. For example, Tier 100 is $99.99 (`$100 - $0.01 = $99.99`).
- Four-digit tier numbers are used for 49 cent pricing. To calculate this, you can add 49 cents to the last two digits in the tier. For example, Tier 1030 is $30.49 (30 is the last 2 digits → `$30 + $0.49 = $30.49`).
- **Price tier**: Roku's price tiers enforce a 99 cent or 49 cent pricing tier.
- One to three-digit tier numbers are used for 99 cent pricing. To calculate, you can subtract 1 cent from the tier to get the corresponding price. For example, Tier 100 is $99.99 (`$100 - $0.01 = $99.99`).
- Four-digit tier numbers are used for 49 cent pricing. To calculate this, you can add 49 cents to the last two digits in the tier. For example, Tier 1030 is $30.49 (30 is the last 2 digits → `$30 + $0.49 = $30.49`).

Once you select a price tier, a chart will appear that displays the purchase price, net price, and proceeds for each country the product is available for.

- **Purchase price**: Reflects the amount your customer will pay.
- **Net price**: This is the pre-tax price.
- **Your proceeds**: This is the amount you will receive from Roku for the sale of the product.

### Trials and offers

Roku subscription products support free trials and discounted offers. Note that the root account must be creating free trials, discounted offers, or limited-time offers for subscriptions.

Under **Base offer**, select one of the following:

![](/images/roku/roku-discounted-offer.png)

- **Discounted price**: This will provide new customers a discounted introductory price.
- _Discounted price range_: This is the discounted price you'd like to offer. The discounted price range must be lower than the base price.
- _Discount duration_: Enter the number of months the discount will be until the customer renews at full price.
- **Discounted price**: This will provide new customers a discounted introductory price.
- _Discounted price range_: This is the discounted price you'd like to offer. The discounted price range must be lower than the base price.
- _Discount duration_: Enter the number of months the discount will be until the customer renews at full price.

![](/images/roku/roku-free-trial.png)

- **Free trial**: This will provide new customers with a free trial of your product.
- _Free trial duration_: Enter the number of days or months for the trial
- Select the unit of time (**Days** or **Months**)
- _Free trial duration_: Enter the number of days or months for the trial
- Select the unit of time (**Days** or **Months**)

### Ready for sale
Once the product is ready to be made available to customers for purchase, select the _"Cleared for sale"_ checkbox. After selecting this checkbox, you will be able to [schedule limited-time free trials and discount offers](/getting-started/entitlements/roku-products#scheduling-offers) for the product.

Once the product is ready to be made available to customers for purchase, select the _"Cleared for sale"_ checkbox. After selecting this checkbox, you will be able to [schedule limited-time free trials and discount offers](/getting-started/entitlements/roku-products#scheduling-offers) for the product.

<figure>
![](/images/roku/roku-product-save.png)
<figcaption>Remember to select 'Save'</figcaption>
</figure>

### Scheduling offers

Once your product is cleared for sale, you can schedule limited-time free trials and discount offers on your subscription products.

Within your product details, you can select 'Schedule offer' > 'Create new offer'.
Within your product details, you can select 'Schedule offer' > 'Create new offer'.

![](/images/roku/roku-schedule-offer.png)

Please refer to the [Trials and offers](/getting-started/entitlements/roku-products#trials-and-offers) section of this documentation for additional instructions on creating an offer. When scheduling an offer, you must input a **Start date** and **End date**.

Note that a customer can only receive one free trial or discount offer, regardless if it is a scheduled offer or part of your base product. For example, if you have a monthly subscription product with the following offers:

- Time-limited offer: Two-month free trial
- Base offer: Three-month 50% discount

When your customer accepts a two-month free trial, once that trial is over the customer will be billed at full price. If your subscription product does not contain a time-limited offer, the customer would be billed for the first three months at 50% then convert to paying full price.

## Editing / deleting products

### Edit products
You can edit a product by selecting the **Product name** in your **Manage In-Channel Products** index page. You may want to edit a product if you no longer wish to list a product for sale.

You can edit a product by selecting the **Product name** in your **Manage In-Channel Products** index page. You may want to edit a product if you no longer wish to list a product for sale.

:::warning Editing cleared for sale
Note that changing the **Cleared for Sale** to "No" will cancel all existing subscriptions of the product and will not renew at the end of the billing period.
:::

### Deleting products
Deleted products cannot be recovered.

Deleted products cannot be recovered.

:::warning Deleting products that are cleared for sale
Note that deleting a product without first changing its **Cleared for Sale** status to "No" will keep the current subscriptions of the product active and will prevent additional purchases of the subscription product.
:::

## Product groups

Product groups are used for upgrade/downgrade functionality and to prevent double billing your customers. For more information regarding upgrades/downgrades, please visit our documentation on [_Upgrades, Downgrades, & Management_](/subscription-guidance/managing-subscriptions#roku).

To set up a product group, navigate to your _'Manage In-Channel Products' > 'All product groups' > 'Add a new group'_
Expand Down
26 changes: 15 additions & 11 deletions docs/getting-started/installation/flutter.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ slug: flutter
excerpt: Instructions for installing Purchases SDK for Flutter
hidden: false
---

## What is RevenueCat?

RevenueCat provides a backend and a wrapper around StoreKit and Google Play Billing to make implementing in-app purchases and subscriptions easy. With our SDK, you can build and manage your app business on any platform without having to maintain IAP infrastructure. You can read more about [how RevenueCat fits into your app](https://www.revenuecat.com/blog/growth/where-does-revenuecat-fit-in-your-app/) or you can [sign up free](https://app.revenuecat.com/signup) to start building.
Expand All @@ -17,13 +18,11 @@ Minimum target: iOS 11.0+

[![Release](https://img.shields.io/github/release/RevenueCat/purchases-flutter.svg?style=flat)](https://github.com/RevenueCat/purchases-flutter/releases)

To use this plugin, add `purchases_flutter` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/) (and run an implicit dart pub get):
To use this plugin, add `purchases_flutter` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/) (and run an implicit dart pub get):

import content from "!!raw-loader!@site/code_blocks/getting-started/installation/flutter_1.yaml";

<RCCodeBlock tabs={[
{ type: 'yaml', content: content, name: 'YAML' }
]} />
<RCCodeBlock tabs={[{ type: "yaml", content: content, name: "YAML" }]} />

Alternatively run this command:

Expand All @@ -32,14 +31,17 @@ Alternatively run this command:
```

### iOS Deployment Target

RevenueCat is compatible with iOS 11.0 or higher. Flutter does not automatically set the iOS deployment target for your project. You need to make sure that the deployment target is set to 11.0 or higher. To do that, simply edit `ios/Podfile` and add the following line if it's not already there:

```
platform :ios, '11.0'
```

Set it to 11.0 or a higher version for RevenueCat to work.

### iOS Swift Version

RevenueCat requires Swift >= 5.0 to work. If the `Podfile` in your project's `ios` folder specifies a Swift version, make sure that it's at least 5.0, otherwise you may run into build issues.

### Set the correct launchMode for Android
Expand All @@ -48,9 +50,11 @@ Depending on your user's payment method, they may be asked by Google Play to ver

import launchModeContent from "!!raw-loader!@site/code_blocks/getting-started/installation/android_launchmode.xml";

<RCCodeBlock tabs={[
{ type: 'xml', content: launchModeContent, name: 'AndroidManifest.xml' }
]} />
<RCCodeBlock
tabs={[
{ type: "xml", content: launchModeContent, name: "AndroidManifest.xml" },
]}
/>

You can find Android's documentation on the various `launchMode` options [here](https://developer.android.com/guide/topics/manifest/activity-element#lmode).

Expand All @@ -60,9 +64,7 @@ You should now be able to import `purchases_flutter`.

import content2 from "!!raw-loader!@site/code_blocks/getting-started/installation/flutter_2.kt";

<RCCodeBlock tabs={[
{ type: 'flutter', content: content2, name: 'Dart' }
]} />
<RCCodeBlock tabs={[{ type: "flutter", content: content2, name: "Dart" }]} />

:::info Enable In-App Purchase capability for iOS projects in Xcode
Don't forget to enable the In-App Purchase capability for your iOS project under `Project Target -> Capabilities -> In-App Purchase`
Expand All @@ -75,12 +77,14 @@ Don't forget to enable the In-App Purchase capability for your iOS project under
:::warning
If you're using other plugins like [mobx](https://pub.dev/packages/flutter_mobx), you may run into conflicts with types from other plugins having the same name as those defined in `purchases_flutter`.<br/>
If this happens, you can resolve the ambiguity in the types by adding an import alias, for example:

```dart
import 'package:purchases_flutter/purchases_flutter.dart' as purchases;
```

After that, you can reference the types from `purchases_flutter` as `purchases.Foo`, like `purchases.PurchaserInfo`.
:::

## Next Steps

* Now that you've installed the Purchases SDK in Flutter, get started by [configuring an instance of Purchases →](/getting-started/quickstart#4-using-revenuecats-purchases-sdk)
- Now that you've installed the Purchases SDK in Flutter, get started by [configuring an instance of Purchases →](/getting-started/quickstart#4-using-revenuecats-purchases-sdk)
Loading

0 comments on commit 185e50f

Please sign in to comment.