From 0ba9512ae1aaa29b830e937c5ffff9c765747bb9 Mon Sep 17 00:00:00 2001 From: Fred Brandt Date: Fri, 15 Nov 2024 12:12:11 -0800 Subject: [PATCH] added appLaunchURL mapping --- src/constants.ts | 5 +++++ src/lib/base-pass.ts | 15 +++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/constants.ts b/src/constants.ts index c01d59ac..372e70db 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -160,6 +160,11 @@ export const TOP_LEVEL_FIELDS: { type: Array, templatable: true, }, + appLaunchURL: { + required: false, + type: 'string', + templatable: true, + }, // Expiration Keys expirationDate: { type: 'string', // W3C date, as a string diff --git a/src/lib/base-pass.ts b/src/lib/base-pass.ts index 6e63c2bb..abce759d 100644 --- a/src/lib/base-pass.ts +++ b/src/lib/base-pass.ts @@ -191,6 +191,21 @@ export class PassBase extends PassStructure { else delete this.fields.associatedStoreIdentifiers; } + /** + * A URL the system passes to the associated app from + * associatedStoreIdentifiers during launch. + */ + get appLaunchURL(): ApplePass['appLaunchURL'] { + return this.fields.appLaunchURL; + } + set appLaunchURL(v: ApplePass['appLaunchURL']) { + if (!v) { + delete this.fields.appLaunchURL; + } else { + this.fields.appLaunchURL = v; + } + } + /** * Brief description of the pass, used by the iOS accessibility technologies. * Don’t try to include all of the data on the pass in its description,