1
votes

I followed Apple's instructions on implementing the option to update a pass on Apple Wallet.

I am able to push updates and they are received successfully on different devices however I can only see the updates after doing "pull-to-update". After using pull-to-update the fields on the pass are updated and the change message is shown in the notification panel, but the notification does not pop up on the screen.

I know the problem is not with the devices or the devices settings because I am able to get automatic updates from passes from other sources.

I saw some related questions like: 1 2 3 4

But the solutions mentioned there did not work for me.

Here is the example of the pass when it was originally generated and a pass after I made updates to it:

Before

{
  "formatVersion": 1,
  "passTypeIdentifier": "pass.com.domain.discountCoupon",
  "serialNumber": "422",
  "teamIdentifier": "ABCDEFGHIJKLMNOP",
  "organizationName": "Company",
  "webServiceURL" : "https://example.com/wallet/webServiceURL.php",
  "authenticationToken" : "ABCDEFGHIJKLMNOP",
  "description": "Card",
  "logoText": "",
  "foregroundColor": "rgb(1, 1, 1)",
  "backgroundColor": "rgb(255, 255, 255)",
  "labelColor": "rgb(1, 1, 1)",
     "locations" : [
      {
        "longitude" : 0,
        "latitude" : 0
      }
    ],
  "storeCard": {
      "headerFields" : [

     ...

    ],
    "backFields": [
      {
        "label": "MOBILE TERMS:",
        "key": "mobileterms",
        "value" : "mobile terms"      
      },
      {
        "changeMessage": "%@",
        "label": " ",
        "value": "I will change this soon",
        "key": "fieldToChange"
      }
    ]
  }
}

After

{
  "formatVersion": 1,
  "passTypeIdentifier": "pass.com.domain.discountCoupon",
  "serialNumber": "422",
  "teamIdentifier": "ABCDEFGHIJKLMNOP",
  "organizationName": "Company",
  "webServiceURL" : "https://example.com/wallet/webServiceURL.php",
  "authenticationToken" : "ABCDEFGHIJKLMNOP",
  "description": "Card",
  "logoText": "",
  "foregroundColor": "rgb(1, 1, 1)",
  "backgroundColor": "rgb(255, 255, 255)",
  "labelColor": "rgb(1, 1, 1)",
     "locations" : [
      {
        "longitude" : 0,
        "latitude" : 0
      }
    ],
  "storeCard": {
      "headerFields" : [

      ...

    ],
    "backFields": [
      {
        "label": "New Title",
        "key": "fieldToChange",
        "value" : "A New Message",
        "changeMessage": ""
      },
      {
        "label": "MOBILE TERMS:",
        "key": "mobileterms",
        "value" : "mobile terms"      
      }
    ]
  }
}
2
Is the issue that push messaging is not triggering the update, or that no change message is shown, or both? - PassKit
@PassKit push messaging is not triggering the update. See my full solution below. - DMEM

2 Answers

3
votes

Found the problem:

Missing header Last-Modified on pass generation. This is a requirement for iOS push notifications. After adding: header('Last-Modified: '.gmdate('D, d M Y H:i:s T'));

to my pass generation code, notifications showed up. In order to make the notification show the changeMessage text, I followed the answer by @PassKit and added changeMessage (including %@) in the new pass I'm pushing after the update.

2
votes

Your second pass change message is empty. It also needs to include %@