Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated Passbook can be opened by safari #53

Open
rgranadosd opened this issue Dec 24, 2020 · 4 comments
Open

Generated Passbook can be opened by safari #53

rgranadosd opened this issue Dec 24, 2020 · 4 comments

Comments

@rgranadosd
Copy link

Hello, I used this to do a pkpass test, but although all seems to be ok (as you can see in the attached screenshot)
Captura de pantalla 2020-12-24 a las 8 53 23
passbook viewer and safari say that they can't open the file. I was looking for all around, with no success could anyone help me?

Here there is my sample file http://handbolsantquirze.cat/passbook/rafa.pkpass, please download using chrome but not safari because it's not downloading on safari

Thanks to all! and Merry Xmas

@mbaechtold
Copy link
Collaborator

I see the following log messages in the Console.app when I try to open your sample file:

error	15:22:11.139198+0100	Pass Viewer	Invalid data error reading pass pass.com.handbolsantquirze.cat/1234567. No entry in manifest for file mipkpass.pkpass

default	15:22:11.140677+0100	Pass Viewer	ERROR: 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=0x6000034cab50 {Error Domain=PKPassKitErrorDomain Code=1 "No entry in manifest for file mipkpass.pkpass" UserInfo={NSLocalizedDescription=No entry in manifest for file mipkpass.pkpass}}}

I'm wondering how the file mipkpass.pkpass did end up in your sample file. Was your sample file generated by this library?

@rgranadosd
Copy link
Author

Many many thanks !

Yes ... I don't understand anything ... how can I see this log ?

Here I put the original code

from passbook.models import Pass, Barcode, StoreCard

cardInfo = StoreCard()
cardInfo.addPrimaryField('name', 'John Doe', 'Name')

organizationName = 'Sww.L.'
passTypeIdentifier = 'pass.com.handbolsantquirze.cat'
teamIdentifier = 'WTE2LIEZ9C'

passfile = Pass(cardInfo,
passTypeIdentifier=passTypeIdentifier,
organizationName=organizationName,
teamIdentifier=teamIdentifier)

passfile.serialNumber = '1234567'
passfile.barcode = Barcode(message = 'Barcode message')
passfile.description = 'A Sample Pass'

Including the icon and logo is necessary for the passbook to be valid.

passfile.addFile('./images/icon.png', open('icon.png', 'rb'))
passfile.addFile('./images/logo.png', open('logo.png', 'rb'))
passfile.addFile('./images/[email protected]', open('[email protected]','rb'))

Create and output the Passbook file (.pkpass)

password = '123456'
passfile.create('certificate.pem', 'private.key', 'wwdr2030.pem', password , 'test.pkpass')

@rgranadosd
Copy link
Author

already created another pkpass from the scratch http://handbolsantquirze.cat/passbook/test.pkpass with same result

@isc-JianjieYu
Copy link

Many many thanks !

Yes ... I don't understand anything ... how can I see this log ?

Here I put the original code

from passbook.models import Pass, Barcode, StoreCard

cardInfo = StoreCard()
cardInfo.addPrimaryField('name', 'John Doe', 'Name')

organizationName = 'Sww.L.'
passTypeIdentifier = 'pass.com.handbolsantquirze.cat'
teamIdentifier = 'WTE2LIEZ9C'

passfile = Pass(cardInfo,
passTypeIdentifier=passTypeIdentifier,
organizationName=organizationName,
teamIdentifier=teamIdentifier)

passfile.serialNumber = '1234567'
passfile.barcode = Barcode(message = 'Barcode message')
passfile.description = 'A Sample Pass'

Including the icon and logo is necessary for the passbook to be valid.

passfile.addFile('./images/icon.png', open('icon.png', 'rb'))
passfile.addFile('./images/logo.png', open('logo.png', 'rb'))
passfile.addFile('./images/[email protected]', open('[email protected]','rb'))

Create and output the Passbook file (.pkpass)

password = '123456'
passfile.create('certificate.pem', 'private.key', 'wwdr2030.pem', password , 'test.pkpass')

Did you just put original code in test.passbook.py?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants