showNotice(for:)
Displays the system disclosure notice sheet for a custom link type and asks the customer whether to continue.
Declaration
static func showNotice(for externalPurchaseType: ExternalPurchaseCustomLink.ExternalPurchaseType) async throws -> ExternalPurchaseCustomLink.NoticeResultParameters
- externalPurchaseType:
An Externalpurchasetype value you select that determines the disclosure sheet the system displays.
Return Value
This method returns ExternalPurchaseCustomLink.NoticeResult.continued to indicate the customer chooses to continue, or ExternalPurchaseCustomLink.NoticeResult.cancelled to indicate the customer chooses not to continue to view external purchases. This method throws an error if your app isn’t eligible to use this API at runtime. In case of an error, this method throws a StoreKitError.
Discussion
Use this method in combination with a specific entitlement entitlement assigned to your app and Information Property List key depending on the region where you want to offer external purchases, following these guidelines:
The com.apple.developer.storekit.external-purchase-link entitlement requires the SKExternalPurchaseCustomLinkRegions Information Property List key.
The com.apple.developer.storekit.external-purchase-link-streaming entitlement requires the SKExternalPurchaseLinkStreamingRegions Information Property List key.
The StoreKit external purchases or offers entitlement entitlement is a standalone entitlement and doesn’t require any additional Information Property List key.
An app needs to call this method when a customer taps on a button or scans a QR code to begin a purchase through an alternative payment processor within an app, or to go out of the app to engage with an offer. If isEligible is false, this method always fails.
Select the notice type based on how your app communicates the offers if the customer chooses to continue:
Use ExternalPurchaseCustomLink.ExternalPurchaseType.outOfApp(destinationURL:) if the app goes to the background, and promotes offers in a destination outside of the app.
Use ExternalPurchaseCustomLink.ExternalPurchaseType.withinApp if the app promotes offers in a web view or native experience within the app.
Continue with the offer if showNotice(type:) returns ExternalPurchaseCustomLink.NoticeResult.continued; otherwise, don’t continue.
For example code that calls this method, see ExternalPurchaseCustomLink.