2

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"      
      }
    ]
  }
}
DMEM
  • 1,573
  • 8
  • 25
  • 43
  • Is the issue that push messaging is not triggering the update, or that no change message is shown, or both? – PassKit Aug 04 '17 at 05:43
  • @PassKit push messaging is not triggering the update. See my full solution below. – DMEM Aug 04 '17 at 23:56

2 Answers2

3

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.

DMEM
  • 1,573
  • 8
  • 25
  • 43
  • I'm facing the same problem. In my case, when pass header (Points) are changed, I send a push notification. I have checked After and before json files and its correct. Strangely, when I pull-to-refresh, my pass refreshes with new data, but I never get any notification. Can you explain first two line of your answer? I'm using JAVA code generate the pass.. – Vineet Ravi Sep 07 '17 at 09:43
2

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

PassKit
  • 12,231
  • 5
  • 57
  • 75
  • This is a reason why notification was not showing my text and instead showing "Store Card Updated" but not why the notification was not popping up on the screen and the card automatically updated. Vote up for solving part of the problem. Full solution in my answer. – DMEM Aug 04 '17 at 23:55