diff --git a/src/PKPass.ts b/src/PKPass.ts index 22f867c..197e321 100644 --- a/src/PKPass.ts +++ b/src/PKPass.ts @@ -217,14 +217,14 @@ export default class PKPass extends Bundle { } /** - * Allows accessing to iOS 18 new Event Ticket - * property `preferredStyleSchemes`. + * Allows accessing to iOS 18 new property + * `preferredStyleSchemes`. * - * @throws if current type is not "eventTicket". + * @throws if current type is not "eventTicket" and is not "boardingPass". */ public get preferredStyleSchemes(): Schemas.PreferredStyleSchemes { - if (this.type !== "eventTicket") { + if (this.type !== "eventTicket" && this.type !== "boardingPass") { throw new TypeError( Messages.PREFERRED_STYLE_SCHEMES.UNEXPECTED_PASS_TYPE_GET, ); @@ -235,7 +235,9 @@ export default class PKPass extends Bundle { /** * Allows setting a preferredStyleSchemes property - * for a eventTicket. + * for a eventTicket. Use this to select + * either the Poster Event Tickets (iOS 18+) or the Semantic + * Boarding passes (iOS 26+). * * @throws if current type is not "eventTicket". * @param value @@ -244,7 +246,7 @@ export default class PKPass extends Bundle { public set preferredStyleSchemes(value: Schemas.PreferredStyleSchemes) { Utils.assertUnfrozen(this); - if (this.type !== "eventTicket") { + if (this.type !== "eventTicket" && this.type !== "boardingPass") { throw new TypeError( Messages.PREFERRED_STYLE_SCHEMES.UNEXPECTED_PASS_TYPE_SET, ); diff --git a/src/messages.ts b/src/messages.ts index 0bc130b..f87d9fb 100644 --- a/src/messages.ts +++ b/src/messages.ts @@ -17,9 +17,9 @@ export const TRANSIT_TYPE = { export const PREFERRED_STYLE_SCHEMES = { UNEXPECTED_PASS_TYPE_SET: - "Cannot set preferredStyleSchemes on a pass with type different from eventTicket.", + "Cannot set preferredStyleSchemes on a pass with type different from eventTicket or boardingPass.", UNEXPECTED_PASS_TYPE_GET: - "Cannot get preferredStyleSchemes on a pass with type different from eventTicket.", + "Cannot get preferredStyleSchemes on a pass with type different from eventTicket or boardingPass.", INVALID: "Cannot set preferredStyleSchemes because not compliant with Apple specifications - %s", } as const;