Use this page with AI

Copy this into your coding assistant and add your request.

Read https://openiap.dev/docs/apis/is-external-purchase-link-available and https://openiap.dev/llms.txt. Follow the reading instructions, detailed reference, and linked guides relevant to my task before making changes.
Inspect my existing project and reuse its framework and conventions. Ask me for missing product decisions. Implement the requested behavior and run the applicable checks.
Show the working result, the commands and actual test results, and any remaining limitations. Keep your explanation brief.

My request: [describe what customers should be able to do]
See an example request →

isExternalPurchaseLinkAvailable

Check whether this device and storefront may link out to an external purchase with openExternalPurchaseLink.

Available in Client Protocol 1.5.0 / openiap-apple 4.2.0 / openiap-google 4.2.0 (requires iOS 17.4+ or Play Billing 8.2.1+).

  • iOS: true when ExternalPurchaseCustomLink.isEligible (iOS 18.1+) or ExternalPurchase.canPresent (iOS 17.4+) is true.
  • Google Play: true when the external offers program is enabled with enableBillingProgramAndroid and available to this user.
  • Amazon, Meta Horizon, Vega OS, macOS, watchOS, iOS before 17.4: always false.

Signature

swift
func isExternalPurchaseLinkAvailable() async throws -> Bool

Returns#

true when openExternalPurchaseLink can show the store disclosure. It returns false instead of throwing when the program is not enabled or the user is not eligible. A connection failure still throws, except in Godot, which has no exceptions and returns false for any failure.

Example

ts
import { isExternalPurchaseLinkAvailable } from 'expo-iap'; // or 'react-native-iap'

const showWebCheckout = await isExternalPurchaseLinkAvailable();