Apostolos Apostolidis
Apostolos Apostolidis

Reputation: 189

Generate & Sign an NFC-enabled .pkpass file without encryptionPublicKey

I am trying to enhance my .pkpass files with NFC functionality. I know that for public use a certificate is required from Apple to allow the readers to access my iPhone NFC but I have seen this setting in Developer Options: NFC Pass Key Optional and I take it as that for developer testing I can in fact have an NFC pass without a signed key (?)

If this is so, how I do that? I ve added the following in my pass.json:

  "storeCard": {
    "primaryFields": [
      {
        "key": "XXX",
        "label": "XXX",
        "value": "---"
      }
    ],
    "secondaryFields": [
      {
        "key": "XXX",
        "label": "XXX",
        "value": "---"
      }
    ],
    "nfc" : {
      "message" : "MY_NFC_MESSAGE"
    }
  }

But when I try to read the pass with an Android NFC reader I get no result. The same Android app succeeds to read my Apple Wallet credit cards so I guess I am not implementing it right... Do I need to use the signpass script in any special way?

Upvotes: 1

Views: 7049

Answers (1)

PassKit
PassKit

Reputation: 12581

Your pass.json looks correct. If you have set the option in the developer menu and you see a pass with the contactless symbol, then you know that your pass has been created successfully.

You will not get any result with any regular reader as Apple VAS uses a proprietary protocol. If you already have access to an NFC certificate, you should be able to request the documentation from your Apple Pay country representative.

Core NFC in iOS 13 has an NFCVASReaderSession class that can be used to read unencrypted payloads, but this will require you to develop your own reader app.

https://developer.apple.com/documentation/corenfc/nfcvasreadersession

Upvotes: 2

Related Questions