From d2cb3510703ef55933f1e277b00827a48b5f4f3c Mon Sep 17 00:00:00 2001 From: Tony AVERTY Date: Wed, 7 Oct 2026 13:03:15 +0200 Subject: [PATCH] =?UTF-8?q?Apple=20Wallet=20:=20notification=20=C2=AB=20No?= =?UTF-8?q?uveau=20solde=20=C2=BB=20au=20lieu=20du=20message=20g=C3=A9n?= =?UTF-8?q?=C3=A9rique?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Deux champs à message (solde et prochaine récompense) changeaient ensemble : l'iPhone affichait « Carte de fidélité modifiée ». Seul le solde garde un message, qui annonce aussi la récompense devenue disponible. Co-Authored-By: Claude Opus 5.5 --- backend/src/wallet/apple-pass.service.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/backend/src/wallet/apple-pass.service.ts b/backend/src/wallet/apple-pass.service.ts index 8725cce..e641837 100644 --- a/backend/src/wallet/apple-pass.service.ts +++ b/backend/src/wallet/apple-pass.service.ts @@ -56,6 +56,8 @@ export class ApplePassService { const unit = unitLabel(card); const nextReward = nextRewardText(card); + // Seul champ à message de la face avant : il annonce aussi la récompense devenue disponible. + const balanceMessage = `Nouveau solde : %@ ${unit.toLowerCase()}${nextReward?.endsWith('disponible !') ? ` · ${nextReward}` : ''}`; const publicUrl: string = this.config.get('publicUrl')!; const webServiceURL = publicUrl.startsWith('https://') ? `${publicUrl}/api/wallet/apple` : null; const passJson = { @@ -75,14 +77,15 @@ export class ApplePassService { barcodes: [{ format: 'PKBarcodeFormatQR', message: card.serial, messageEncoding: 'iso-8859-1' }], storeCard: { headerFields: [{ key: 'balance-header', label: unit.toUpperCase(), value: card.balance }], - primaryFields: [{ key: 'balance', label: 'SOLDE', value: card.balance, changeMessage: `Nouveau solde : %@ ${unit.toLowerCase()}` }], + primaryFields: [{ key: 'balance', label: 'SOLDE', value: card.balance, changeMessage: balanceMessage }], secondaryFields: [ { key: 'program', label: 'PROGRAMME', value: design.programName }, { key: 'member', label: 'MEMBRE', value: card.customer.firstName, textAlignment: 'PKTextAlignmentRight' }, ], - // Face avant : la prochaine récompense ; la notification s'affiche quand elle devient disponible. + // Face avant : la prochaine récompense. Pas de message de notification ici : quand deux champs + // à message changent ensemble (solde + récompense), l'iPhone affiche « Carte de fidélité modifiée ». ...(nextReward && { - auxiliaryFields: [{ key: 'next-reward', label: 'PROCHAINE RÉCOMPENSE', value: nextReward, changeMessage: '%@' }], + auxiliaryFields: [{ key: 'next-reward', label: 'PROCHAINE RÉCOMPENSE', value: nextReward }], }), backFields: [ // Toujours présent : quand sa valeur change (nouvelle campagne), l'iPhone affiche le message sur l'écran verrouillé.