1

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?

1 Answers1

2

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

PassKit
  • 12,231
  • 5
  • 57
  • 75
  • Can you confirm that passes with unencrypted NFC payloads can be scanned? I have enabled the developer setting "NFC Pass Key Optional" but if I add a pass created without the nfc `encryptionPublicKey` json key, it does not show the contactless symbol in the wallet. – Aranda Feb 17 '20 at 09:00
  • 2
    Yes they can be read, the payload will be returned in plaintext but you’ll still need an Apple VAS compatible reader as the dialog to extract the payload is proprietary. But these cannot be used for production as public devices will reject a pass without a public key. – PassKit Feb 17 '20 at 09:02
  • 2
    Also, if the contactless symbol is not showing, you either are not using an NFC certificate, or you haven’t enabled the developer setting. – PassKit Feb 17 '20 at 09:05
  • Great, thank you!. Just to confirm, if I have supplied an NFC encryption key in the pass, enabling the iOS developer setting will cause it to be sent in plain text by default? Or is there some other step to get that working?. I personally do not have a VAS enabled reader but am supplying passes to someone who does, and they are requesting the NFC message in plain text. – Aranda Feb 18 '20 at 00:22
  • 2
    No. Enabling the developer setting allows you to install a pass without a public key. If a public key is not set, but an NFC certificate is used and the developer setting is set then a pass will load as an NFC pass. I can not disclose the decryption algorithm as it is given under NDA from Apple, but we do provide a decryption API if your client is unable to decrypt themselves. – PassKit Feb 18 '20 at 00:49
  • Hello @PassKit, Will you please tell me what do you mean by NFC Certificate? Is it provided by Apple after Requesting for Certificate with NDA sign? or We can create it directly from Apple Developer Account? I highly appreciate your help... – RedPanda0147 Feb 03 '23 at 12:14
  • You need to apply for permission to use the NFC functionality in Wallet. If granted, then the certificates used to sign your passes carry an extra property that enables NFC. http://developer.apple.com/contact/passkit. – PassKit Feb 08 '23 at 06:33