Skip to content

fix: introductoryOfferEligibility should use compactJWS instead of Bool #68

@hyochan

Description

@hyochan

Summary

The introductoryOfferEligibility property in RequestSubscriptionIosProps is currently defined as Boolean, but the actual StoreKit API Product.PurchaseOption.introductoryOfferEligibility(compactJWS:) requires a JWS string.

Current Implementation

# packages/gql/src/type-ios.graphql
input RequestSubscriptionIosProps {
  # ...
  introductoryOfferEligibility: Boolean  # INCORRECT
}

Expected Implementation

The API should accept a server-generated compact JWS string, similar to promotionalOfferJWS:

input IntroductoryOfferJWSInputIOS {
  jws: String!
}

input RequestSubscriptionIosProps {
  # ...
  introductoryOfferEligibility: IntroductoryOfferJWSInputIOS  # CORRECT
}

References

Tasks

  • Update GraphQL schema to use JWS string type
  • Regenerate types for all platforms
  • Update Swift implementation
  • Update documentation
  • Consider migration path for existing users

Related

Discovered during PR #67 review by @coderabbitai

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions