The Product Code Block, which can be found in Payments - In-App Purchases -> In-App Purchases Actions is used by the Purchase actions to define which Product will execute the action, for example, which Product to initiate the purchase.
Tip: You can use the dropdown to change between available products, that you have already added in Manage products.
You can use this Code Block to check if the provided Product has already been marked as purchased in the current device. This action is not using Apple servers and only checks if the Product is locally cached as purchased.
Note: A product could be cached as not purchased if the user has reinstalled the application, or purchased it on a different device. User will need to use the Restore Purchases Button or the Restore Purchases Code Block.
In the example, the user will be navigated to Main Screen if has already purchased the Monthly subscription, else Payments Screen will be presented.
In the example, the Monthly Subscription details will be fetched, and then its price will be displayed in the Price Label.
Similar to Get Product Details Code Block, you can use this block to fetch multiple products simultaneously.
Buy Product, similar to the Buy Button, can be used for your user to purchase the selected Product. In the success, canceled, and errored section, you can add more Blocks to define each result’s action.
In the example, the user will initiate a purchase for Monthly Subscription, and if the purchase is successful, Label will change its text to
Thank you! and the user will be navigated to Main Screen.
You can use this Code Block in order to validate using Apple’s servers if a product is still purchased.
You can use this Code Block in order to validate by accessing only the cached In-App Purchases Receipt if a product is still purchased.
You can use this Code Block to initiate a Restore Purchases action.
Tip: It is easier to use the Restore Purchases Button.
You can use the Code Blocks from this section with a fetched product from the Get Product Details Code Block.
Returns product’s price (including the currency symbol) in the device’s locale format.
Returns product’s subscription period in a human-readable format.
Returns the In-App Purchase product id, which has been set in App Store Connect and Manage Products.
Returns true, if the fetched Product is of Subscription type.
Returns the Name of the fetched Product.
Returns only the currency symbol in the device’s locale.
Returns only the Price numeric value without the currency symbol.
Returns the Product Description of the fetched Product. You can define this value in App Store Connect before the release of the application.
Returns the Product Unique Id to use it in In-App Purchase Actions Code Blocks.