( metadata: ProductPricingMetadata[], customIds?: string[], )
| 96 | ); |
| 97 | |
| 98 | export const getApplePricing = async ( |
| 99 | metadata: ProductPricingMetadata[], |
| 100 | customIds?: string[], |
| 101 | ) => { |
| 102 | if (!messageHandlerExists(WebKitMessageHandlers.IAPSubscriptionRequest)) { |
| 103 | return []; |
| 104 | } |
| 105 | |
| 106 | const response = getAppleProducts(metadata); |
| 107 | const ids = |
| 108 | customIds || metadata.map(({ idMap }) => idMap.ios).filter(Boolean); |
| 109 | |
| 110 | postWebKitMessage(WebKitMessageHandlers.IAPProductList, ids); |
| 111 | |
| 112 | return response; |
| 113 | }; |
no test coverage detected