Apple Wallet : notification « Nouveau solde » au lieu du message générique
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 <noreply@anthropic.com>
This commit is contained in:
parent
711dc9a3b3
commit
d2cb351070
1 changed files with 6 additions and 3 deletions
|
|
@ -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é.
|
||||
|
|
|
|||
Loading…
Reference in a new issue