@@ -1103,7 +1103,7 @@ Future<void> deepLinkToSubscriptions({
11031103 </ section >
11041104 < section >
11051105 < AnchorLink id = "validation" level = "h2" >
1106- Verify Purchase
1106+ Validation
11071107 </ AnchorLink >
11081108
11091109 < AnchorLink id = "verify-purchase" level = "h3" >
@@ -1116,18 +1116,40 @@ Future<void> deepLinkToSubscriptions({
11161116 should be validated before granting entitlements.
11171117 </ strong >
11181118 </ p >
1119- < CodeBlock language = "graphql" > { `"""
1120- Returns: VerifyPurchaseResult!
1121- """
1122- verifyPurchase(options: VerifyPurchaseProps!): Future` } </ CodeBlock >
1119+ < LanguageTabs >
1120+ { {
1121+ typescript : (
1122+ < CodeBlock language = "typescript" > { `// Function signature
1123+ verifyPurchase(options: ReceiptValidationProps): Promise<ReceiptValidationResult>` } </ CodeBlock >
1124+ ) ,
1125+ swift : (
1126+ < CodeBlock language = "swift" > { `// Function signature
1127+ func verifyPurchase(
1128+ options: ReceiptValidationProps
1129+ ) async throws -> ReceiptValidationResult` } </ CodeBlock >
1130+ ) ,
1131+ kotlin : (
1132+ < CodeBlock language = "kotlin" > { `// Function signature
1133+ suspend fun verifyPurchase(
1134+ options: ReceiptValidationProps
1135+ ): ReceiptValidationResult` } </ CodeBlock >
1136+ ) ,
1137+ dart : (
1138+ < CodeBlock language = "dart" > { `// Function signature
1139+ Future<ReceiptValidationResult> verifyPurchase(
1140+ ReceiptValidationProps options,
1141+ );` } </ CodeBlock >
1142+ ) ,
1143+ } }
1144+ </ LanguageTabs >
11231145 < p className = "type-link" >
11241146 See:{ ' ' }
1125- < Link to = "/docs/types#verify- purchase-types" >
1126- VerifyPurchaseProps
1147+ < Link to = "/docs/types#purchase-verification -types" >
1148+ ReceiptValidationProps
11271149 </ Link >
11281150 ,{ ' ' }
1129- < Link to = "/docs/types#verify-purchase -result" >
1130- VerifyPurchaseResult
1151+ < Link to = "/docs/types#receipt-validation -result" >
1152+ ReceiptValidationResult
11311153 </ Link >
11321154 </ p >
11331155 < p > Verifies purchases with the appropriate validation service.</ p >
@@ -1146,78 +1168,6 @@ verifyPurchase(options: VerifyPurchaseProps!): Future`}</CodeBlock>
11461168 can validate against the Google Play developer API.
11471169 </ p >
11481170
1149- < AnchorLink id = "verify-purchase-with-provider" level = "h3" >
1150- verifyPurchaseWithProvider
1151- </ AnchorLink >
1152- < p >
1153- Verify purchases via an external provider without running your own
1154- server. The first supported provider is IAPKit (
1155- < a href = "https://iapkit.com" target = "_blank" rel = "noopener noreferrer" >
1156- https://iapkit.com
1157- </ a >
1158- ), which handles validation through its hosted API (optional
1159- < code > Authorization: Bearer { '{apiKey}' } </ code > ).
1160- </ p >
1161- < CodeBlock language = "graphql" > { `"""
1162- Returns: VerifyPurchaseWithProviderResult!
1163- """
1164- # Future
1165- verifyPurchaseWithProvider(
1166- options: VerifyPurchaseWithProviderProps!
1167- ): Future` } </ CodeBlock >
1168- < p className = "type-link" >
1169- See:{ ' ' }
1170- < Link to = "/docs/types#purchase-verification-provider" >
1171- PurchaseVerificationProvider
1172- </ Link >
1173- ,{ ' ' }
1174- < Link to = "/docs/types#request-verify-purchase-with-iapkit-props" >
1175- RequestVerifyPurchaseWithIapkitProps
1176- </ Link >
1177- ,{ ' ' }
1178- < Link to = "/docs/types#verify-purchase-with-provider-props" >
1179- VerifyPurchaseWithProviderProps
1180- </ Link >
1181- ,{ ' ' }
1182- < Link to = "/docs/types#verify-purchase-with-provider-result" >
1183- VerifyPurchaseWithProviderResult
1184- </ Link >
1185- </ p >
1186- < CodeBlock language = "typescript" > { `// IAPKit — Apple + Google in one request
1187- await verifyPurchaseWithProvider({
1188- provider: 'iapkit',
1189- iapkit: {
1190- apiKey: process.env.IAPKIT_API_KEY,
1191- apple: {
1192- receipt: jwsTokenFromPurchase,
1193- environment: 'production',
1194- appId: 'com.example.app'
1195- },
1196- google: {
1197- packageName: 'com.example.app',
1198- purchaseId: 'premium_monthly',
1199- purchaseToken: purchase.purchaseToken
1200- }
1201- }
1202- });` } </ CodeBlock >
1203- < ul >
1204- < li >
1205- < code > apiKey</ code > is optional; when set it is sent as{ ' ' }
1206- < code > Authorization: Bearer { '{apiKey}' } </ code > .
1207- </ li >
1208- < li >
1209- < code > apple.appId</ code > is required when{ ' ' }
1210- < code > environment</ code > is < code > production</ code > .
1211- </ li >
1212- < li >
1213- For full API details, see{ ' ' }
1214- < a href = "https://api.iapkit.com" target = "_blank" rel = "noopener noreferrer" >
1215- https://api.iapkit.com
1216- </ a >
1217- .
1218- </ li >
1219- </ ul >
1220-
12211171 < AnchorLink id = "purchase-identifier-usage" level = "h3" >
12221172 Purchase Identifier Usage
12231173 </ AnchorLink >
@@ -1643,11 +1593,11 @@ struct ExternalPurchaseLinkResultIOS {
16431593 < strong > Deprecated:</ strong > Use < code > verifyPurchase</ code > { ' ' }
16441594 instead for both platforms.
16451595 </ p >
1646- < CodeBlock language = "graphql " > { `"""
1647- Validate a receipt for a specific product
1648- """
1649- # Future
1650- validateReceiptIOS(options: VerifyPurchaseProps!): VerifyPurchaseResultIOS! @deprecated(reason: "Use verifyPurchase") `} </ CodeBlock >
1596+ < CodeBlock language = "swift " > { `// Deprecated: Use verifyPurchase() instead
1597+ @available(*, deprecated, message: "Use verifyPurchase()")
1598+ func validateReceiptIOS(
1599+ options: ReceiptValidationProps
1600+ ) async throws -> ReceiptValidationResult `} </ CodeBlock >
16511601 < p >
16521602 Validates a receipt payload against the App Store using the
16531603 provided validation options. Returns the parsed validation
0 commit comments