Comments (11)
I am also facing the same issue.
public static async Task Main()
{
var options = new PassKitOptions()
{
// See `how_to_create_pfx.md` to create your onw pfx file
PassCertificate = new X509Certificate2(File.ReadAllBytes("C:\\Users\\krishnakumar.k\\Downloads\\PassKitHelper-master\\PassKitHelper-master\\PassKitHelper.Demo\\images\\pass.pfx"),"password"),
AppleCertificate = new X509Certificate2(File.ReadAllBytes("C:\\Users\\krishnakumar.k\\Downloads\\PassKitHelper-master\\PassKitHelper-master\\PassKitHelper.Demo\\images\\AppleWWDRCAG3.cer")),
ConfigureNewPass =
p =>
p.Standard
.PassTypeIdentifier("pass.com.apple.devpubs.example")
.SerialNumber("PassKitHelper")
.TeamIdentifier("A93A5CM278")
.OrganizationName("PassKit")
.VisualAppearance
.LogoText("COVID-19 Vaccination Record Card")
.Generic
.AuxiliaryFields
.Add("github")
.Label("GitHub link")
.Value("https://github.com/justdmitry/PassKitHelper"),
};
// var passKitHelper = new PassKitHelper(options);
IPassKitHelper passKitHelper = new PassKitHelper(options);
await GenerateSamplePass(passKitHelper);
//// uncomment to send push notification
//// attention! your pass (you push update for) must already include WebService fields (auth.token and endpoint), and your web service/app must be up and running
//// var registrationPushToken = "1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef";
//// var ok = await passKitHelper.SendPushNotificationAsync(registrationPushToken);
}
public static async Task GenerateSamplePass(IPassKitHelper passKitHelper)
{
var pass = passKitHelper.CreateNewPass()
.Standard
.Description("PassKitHelper demo pass")
////.WebService
//// .AuthenticationToken("some-nonce")
//// .WebServiceURL("https://www.example.com/")
.VisualAppearance
.Barcodes("1234567890128", BarcodeFormat.QR)
.ForegroundColor("rgb(44, 62, 80)")
.BackgroundColor("rgb(149, 165, 166)")
.LabelColor("rgb(236, 240, 241)")
.Generic
.PrimaryFields
.Add("version")
.Label("Library version")
.Value(typeof(IPassKitHelper).Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion)
;
var package = await passKitHelper.CreateNewPassPackage(pass)
.Icon(await File.ReadAllBytesAsync("C:\\Users\\krishnakumar.k\\Downloads\\PassKitHelper-master\\PassKitHelper-master\\PassKitHelper.Demo\\images\\icon.png"))
.Icon2X(await File.ReadAllBytesAsync("C:\\Users\\krishnakumar.k\\Downloads\\PassKitHelper-master\\PassKitHelper-master\\PassKitHelper.Demo\\images\\[email protected]"))
.Logo(await File.ReadAllBytesAsync("C:\\Users\\krishnakumar.k\\Downloads\\PassKitHelper-master\\PassKitHelper-master\\PassKitHelper.Demo\\images\\logo.jpg"))
//.Strip(await File.ReadAllBytesAsync("C:\\Users\\krishnakumar.k\\Downloads\\PassKitHelper-master\\PassKitHelper-master\\PassKitHelper.Demo\\images\\strip.jpg"))
//.Strip2X(await File.ReadAllBytesAsync("C:\\Users\\krishnakumar.k\\Downloads\\PassKitHelper-master\\PassKitHelper-master\\PassKitHelper.Demo\\images\\[email protected]"))
.SignAndBuildAsync();
await File.WriteAllBytesAsync("Sample.pkpass", package.ToArray());
}
from passkithelper.
Some images are required. Try uncomment (return) Strip2x
image back.
from passkithelper.
Now the file generated in windows. Can I share the file through the mail and verify it in IOS?
from passkithelper.
Double-check that you put correct PassTypeIdentifier and TeamIdentifier and they matches your certificate. My demo works correct only after replacing this values to your own (it generates passes anyway, but pass opens on my iPhone only when correct values are provided).
from passkithelper.
Hi Dmitry ,
After generating a new pfx file, We can able to generate and preview the file in MAC, But I downloaded the same file in mobile and try to open it, I couldn't Add it.
Thanks
from passkithelper.
am also facing the same issue. I successfully generated the .pkpass file and able to see the preview in mac laptop. I shared it via email to my iPhone the pkpass file not added to my apple wallet.
from passkithelper.
When I make invalid passes - iPhone does not display them at all. So, if you can view pass on iPhone but can't add it to Wallet - it's something other, not file. Can you share generated file somehow?
from passkithelper.
I have attached the sample file here in zip format. Because .pkpass format not supported to attach. Please change the file format and verify.
Thanks
from passkithelper.
It's not opening on my phone. Double-check that you used correct PassTypeIdentifier and TeamIdentifier, and correct PFX, and so on. I never tried to build passes on Mac, so if you have some kind of VM with Windows - try build inside it.
from passkithelper.
Hi,
Now it's working after used the new AppleWWDRCA.cer file "2023". But the bar code does not generate like yours, Instead of added multiple lines. We are using "BarcodeFormat.Code128" format only.
How to change the font size. Because Secondary and Auxiliary fields are showing different sizes and styles.
Thanks
from passkithelper.
Oh, old/expired certificate can cause issues with signing and validating, good point.
Barcode - unzip pass and check pass.json - may be you put some "strange" (non-latin) characters into "message" ?
Font size - you can't change it. Apple asks only color, but layout management is done by your phone itself. Change texts (length) until you satisfied how it rendered.
from passkithelper.
Related Issues (20)
- Make PassPackageBuilder disposable HOT 1
- New Covid Vaccine Apple Wallet Option HOT 3
- Localization Support HOT 2
- Any guidance on updating? HOT 10
- Localization HOT 3
- How can we use the send push notification HOT 31
- How to Expire a Pass HOT 2
- Push notification text is the same when two updates occur HOT 2
- Password required in Azure to avoid "the specified network password is not correct" HOT 2
- PassKit for google pay passes HOT 3
- Pass File gets corrupted when updating multiple fields HOT 3
- Not receiving push notification HOT 3
- use of PassBuilderNfcKeysExtensions HOT 1
- Missing steps on how to install the pass HOT 2
- is there way to display barcode as an image HOT 2
- push notification does not work HOT 1
- support for personalize passes HOT 3
- Android Wallet HOT 1
- Instead of QR Code need to replace image HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from passkithelper.