One Logo Pool Ball
wwwwwwwwwwwwwwwwwww

iOS Store Views

StoreKit ProductView, StoreView, and SubscriptionStoreView under One.iOS

StoreKit’s merchandising views under One.iOS: ProductView for one product, StoreView for a list, and SubscriptionStoreView for a subscription group. StoreKit loads each product from the App Store, draws its name, price, and buy button, and runs the purchase sheet when the person taps it.

Product identifiers come from App Store Connect, or from a StoreKit configuration file while you develop. A product that does not load shows StoreKit’s own unavailable state. To list products, buy them, and read entitlements from code, use Purchases. These views throw on web and Android.

Usage

import { One } from 'one'
function Store() {
return (
<>
<One.iOS.ProductView id="com.example.coins.100" />
<One.iOS.SubscriptionStoreView groupID="21482456" style={{ height: 420 }} />
</>
)
}

How it works

The binding uses ProductView(id:prefersPromotionalIcon:), StoreView(ids:prefersPromotionalIcon:), and the SubscriptionStoreView groupID:visibleRelationships: or productIDs: initializers. Overloads accepting StoreKit.Product objects, icon builders, or marketing content are not bound: their arguments include native product values and callbacks returning generic SwiftUI views, which the generated constructor bridge cannot carry. Pass catalog identifiers to the bound overloads.

ProductView

One product with its icon, name, description, and buy button.

import { One } from 'one'
function Coins() {
return <One.iOS.ProductView id="com.example.coins.100" prefersPromotionalIcon />
}
PropsTypeDescription
id (required)stringThe product identifier.
stringThe product identifier.
prefersPromotionalIconboolean = falseUses the promotional image from App Store Connect as the icon.
boolean = falseUses the promotional image from App Store Connect as the icon.

StoreView

A list of products, each drawn as a ProductView.

import { One } from 'one'
function CoinStore() {
return <One.iOS.StoreView ids={['com.example.coins.100', 'com.example.coins.500']} />
}
PropsTypeDescription
ids (required)readonly string[]The product identifiers, in display order.
readonly string[]The product identifiers, in display order.
prefersPromotionalIconboolean = falseUses each promotional image as its icon.
boolean = falseUses each promotional image as its icon.

SubscriptionStoreView

The subscription store for one group of auto-renewable subscriptions. Pass exactly one of groupID and productIDs; both or neither throws. visibleRelationships applies only with groupID and throws with productIDs. Give it a height, since it fills the box React Native gives it.

import { One } from 'one'
function Subscribe() {
return (
<One.iOS.SubscriptionStoreView
groupID="21482456"
visibleRelationships="all"
style={{ height: 420 }}
/>
)
}
PropsTypeDescription
groupIDstringThe subscription group identifier.
stringThe subscription group identifier.
visibleRelationships"current" | "downgrade" | "crossgrade" | "upgrade" | "all" = "all"Which plans to show relative to the current one. Only with groupID; it throws with productIDs.
"current" | "downgrade" | "crossgrade" | "upgrade" | "all" = "all"Which plans to show relative to the current one. Only with groupID; it throws with productIDs.
productIDsreadonly string[]The subscription product identifiers to show.
readonly string[]The subscription product identifiers to show.

Platform differences

iOSAndroidWeb
RendersStoreKit viewsThrowsThrows
CatalogApp StoreNoneNone
PurchaseSystem sheetNoneNone

Limits and gotchas

Edit this page on GitHub.