tinovyatkin/pass-js

NFC Datatype Mismatch

Closed this issue ยท 4 comments

The NFCField type does not match the datatype specified in the Apple documentation for the pass.json file.

According to Apple's documentation, the nfc top level attribute should be a single dictionary, with the required nfc fields (message and an optional public key). See: https://developer.apple.com/library/archive/documentation/UserExperience/Reference/PassKit_Bundle/Chapters/TopLevel.html#//apple_ref/doc/uid/TP40012026-CH2-DontLinkElementID_3

However, the NFCField type extends from Array<{message: string; publicKey?: string;}> (see: src/lib/nfc-fields.ts) which means that nfc properties are serialised as an array in pass.json, and that the generated pass file fails to be verified and added to a Wallet.

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.91. Please mark this comment with ๐Ÿ‘ or ๐Ÿ‘Ž to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

Thank you for reporting, fixed and published as 6.6.0

Wow - thanks for the quick turnaround. I was just starting to prepare a PR for this.
I'll give it a test shortly.

@bbbates Please let me know if it works well now.