hasActiveSubscriptions

Quick check if the user has any active subscriptions.

iOS: Convenience over getActiveSubscriptions — returns true if the iterator yields at least one non-expired subscription. Apple docs. Android: Convenience over queryPurchasesAsync(SUBS) — returns true if any subscription is in PURCHASED state. Google docs.

Signature

swift
func hasActiveSubscriptions(_ subscriptionIds: [String]?) async throws -> Bool

React Native, Expo, and native promise APIs reject on failure. React Native and Expo hooks call onError before rethrowing. Handle that rejection separately from a valid false result.

Parameters#

  • subscriptionIds (optional, string[]) — If provided, only these SKUs are checked. Omit to ask "any active subscription at all?".

Returns#

Promise<boolean>true when at least one (matching) subscription is in an active state. Convenience over getActiveSubscriptions when you only need a yes/no answer.

Only a successful empty query resolves false. Godot entitlement code must use has_active_subscriptions_result(); Godot's compatibility boolean helper still maps failure to false and is not safe for granting or revoking access.

Example

swift
let isPremium = try await OpenIapModule.shared.hasActiveSubscriptions(nil)