Apple Wallet Store card expired before Expiry Date

445 Views Asked by At

In the application, we have a feature to download the wallet card into the Apple wallet as a contact card.

We have created this wallet contact card from the PHP code - below.

$data = [
                    'description' => 'MyApp',
                    'formatVersion' => 1,
                    'organizationName' => 'My app',
                    'passTypeIdentifier' => 'pass.test.test',
                    'serialNumber' => '12345678',
                    'teamIdentifier' => '*********',
                    'storeCard' => [
                        "headerFields" => [
                            [
                                "key" => "header-text",
                                "label" => "Let's connect",
                                "value" => "Together"
                            ]
                        ],
                        "auxiliaryFields" => [
                            [
                                "key" => "aux-text-two",
                                "label" => "",
                                "value" => ""
                            ],
                            [
                                "key" => "aux-text-one",
                                "label" => "www.abc.com",
                                "value" => ""
                            ]
                        ],
                        "primaryFields" => [],
                        'secondaryFields' => [],
                        'backFields' => [],
                    ],
                    'barcode' => [
                        'format' => 'PKBarcodeFormatQR',
                        'message' => 'https://abc.1-2-3-4-5.xyz/public/myapp/?id='.$userData->token.'',
                        'messageEncoding' => 'iso-8859-1',
                    ],
                    "backgroundColor"   => "rgb(255,255,255)",
                    'logoText' => '',
                    'relevantDate' => date('Y-m-d\TH:i:sP'),
                    "expirationDate" => "2030-01-01T23:00:00Z",
                ];

We are requesting an apple wallet card to be generated from the iOS code calling API for this - below.

if PKPassLibrary.isPassLibraryAvailable(){
            if let data = try? Data(contentsOf: url){
                if let pass = try? PKPass(data: data){
                    let passLibrary = PKPassLibrary()
                    if !passLibrary.containsPass(pass),
                       let passController = PKAddPassesViewController(pass: pass){
                        
                        passController.delegate = self
                        self.present(passController, animated: true)
                    }else{
                        
                        ShowAlert(message: "contact_card_already_exist".localize(), theme: .error)
                        
                    }
                }
            }
        }

As screenshots say - it’s valid till 1/1/30, PHP code we have given the expiry date as well, but still, the wallet card is gone to Expired in 2 days.

As the in the image date was set to expire the store card of apple wallet but it getting expired within 2 days of add in wallet app

You can see the card is showing in expired section of the wallet app

Any help is appreciated.

1

There are 1 best solutions below

0
On

It seems like the relevantDate field functions as a second expiryDate. If it's set in the past the pass is shown as expired. This isn't reflected in Apples documentation.