justdmitry / PassKitHelper

Helper library for all your Apple PassKit (Apple Wallet, Apple Passbook) needs.
MIT License
26 stars 6 forks source link

use of PassBuilderNfcKeysExtensions #23

Open MagTek-PaulDeignan opened 12 months ago

MagTek-PaulDeignan commented 12 months ago

Can you show the expected usage of the PassBuilderNfcKeysExtensions?

I am trying to add nfc message content to the pkpass

justdmitry commented 12 months ago

I never tried that because I have no required access/certification in Apple Dev. Program.

I guess desired sequence should be like

var pass = passKitHelper.CreateNewPass()
    .Standard
        .SerialNumber("PassKitHelper")
        .OrganizationName("PassKit")
    ...
    .Nfc("message", "key")
    .Build()

But it seems I missed extension method, so for now you need additional variable:

var builder = passKitHelper.CreateNewPass()
    .Standard
        .SerialNumber("PassKitHelper")
        .OrganizationName("PassKit")
    ...;

var nfcBuilder = new PassBuilder.PassBuilderNfcKeys(builder);
nfcBuilder.Nfc("message", "key");

var pass = builder.Build();

Can you please try this and respond does it works as desired or not? I have no any way to validate this NFC workload myself.