I needed to develop a website in .Net which can create event tickets that downloadable as passbook file (*.pkpass). I tried to use. Dotnet-passbook library available in Nuget. But any created passes are not open in iPhone. Have anyone faced this issue? Any other suggestions to do this task?
Asked
Active
Viewed 6,165 times
2
-
If you could compile the pass, it is more likely a certificate or other configuration or content problem (E.g. Missing icon file) and less likely to be the library. – PassKit Jun 15 '17 at 06:25
-
thank you for comment. yes it get compile and pkpass file is created. but not working inside iphone. is it possible to not open if image etc missing ? – Tharindu Jun 15 '17 at 06:31
-
“Not working” is insufficient to diagnose. What do the iPhone logs show when you try to add the pass? They should give you the reason it is failing. – PassKit Jun 15 '17 at 06:33
-
1:Invalid data error reading pass pass.com.cas.passbook/1212t. The passTypeIdentifier or teamIdentifier provided may not match your certificate, or the certificate trust chain could not be verified. :Failed to add pass:'Error Domain=PKPassKitErrorDomain Code=1 "The pass cannot be read because it isn’t valid."UserInfo={NSLocalizedDescription=The pass cannot be read because it isn’t valid., NSUnderlyingError {Error Domain=PKPassKitErrorDomain Code=1 "The passTypeIdentifier or teamIdentifier provided may not match your certificate, or the certificate trust chain could not be verified – Tharindu Jun 15 '17 at 06:58
-
Check that you are using the latest Apple WWDR certificate. The one bundled with the library may haveexpired in February 2016. – PassKit Jun 15 '17 at 07:00
-
i downloaded the certificate from here : https://www.apple.com/certificateauthority/ it will expired in 2023 – Tharindu Jun 15 '17 at 07:08
-
check that your team name and passTypeId are correctly set and match your certificate. – PassKit Jun 15 '17 at 07:21
-
Thanks @PassKit. i have solve it. i have another problem. i used mvc FileContentResult. but passes not get the *.pakpass extension. i used bellow code : byte[] generatedPass = generator.Generate(request); return new FileContentResult(generatedPass, "application/vnd.apple.pkpass"); – Tharindu Jun 19 '17 at 05:11
3 Answers
2
I also create .pkpass using C#, you may reference to my past question such this generate pkpass question.
The major problem I think, should be the pass.json file format is not correct. A easy method to test the .pkpass file must be using xcode and create a ios simulator, drop your .pkpass file in to simulator. The xcode log will display the reason why your file is not working, hope helpful.

Yuk_dev
- 318
- 1
- 6
- 16
2
This is solved. it worked after using "request.CertThumbprint" instead of location referring to the certificate. thanks. so error was validating the certification in passes.

Tharindu
- 71
- 1
- 13
-1
You need the xcode framework or apple build package, here the info.
here you can download, the visual studio full. https://www.visualstudio.com/en/downloads/

genife
- 24
- 6
-
thank you for commenting. i have VS full. and this is a web development not a mobile development. i need to create passes online. eg : https://github.com/tomasmcguinness/dotnet-passbook – Tharindu Jun 15 '17 at 04:17
-
-
I think, you can't inject a framework .net on a web app, because for do this u need make a preview app with this integration, and later build a function for make a new app with content mixed, ios and .net., maybe u need other answer!, good luck – genife Jun 15 '17 at 04:29
-
-
look, https://books.google.com/books?id=uDFVBQAAQBAJ&lpg=PA131&ots=NORPEXqyNd&dq=mixed%20.net%20and%20ios%20app&hl=es&pg=PA131#v=onepage&q=mixed%20.net%20and%20ios%20app&f=false – genife Jun 15 '17 at 04:33
-
Ok, sorry :( T_T .this need more than .net. this need a .cer self-signing cert. for build urapp. – genife Jun 15 '17 at 04:43
-
yes i have all the apple certificates. certificate for pass type id and AppleWWDRCA. – Tharindu Jun 15 '17 at 04:49
-
But the problem is, how you do a passbok app, without xcode or apple framework? – genife Jun 15 '17 at 04:50
-
sorry. i am not creating passbook. i am creating passes(like tickets) that readable using on apple passbook app(wallet). – Tharindu Jun 15 '17 at 04:57
-