Closed rubyon closed 12 years ago
This is my code...
def sample
pass = Passbook::PKPass.new '
{
"passTypeIdentifier": "pass.rubyple.com",
"formatVersion": 1,
"organizationName": "Starbucks",
"teamIdentifier": "L3D8S93Z59",
"serialNumber": "1234567890",
"backgroundColor": "rgb(240,240,240)",
"logoText": "RubyOn Pass",
"description": "Demo pass",
"storeCard": {
"secondaryFields": [
{
"key": "balance",
"label": "BALANCE",
"value": "$99.99"
},
{
"key": "name",
"label": "NAME",
"value": "Han Seung Sik"
}
],
"backFields": [
{
"key": "id",
"label": "Card Number",
"value": "01062619801"
}
]
},
"barcode": {
"format": "PKBarcodeFormatPDF417",
"message": "1234567890",
"messageEncoding": "iso-8859-1",
"altText": "1234567890"
}
}'
pass.addFiles ['icon.png', 'icon@2x.png', 'logo.png', 'logo@2x.png', 'background.png', 'background@2x.png' ]
pkpass_path = pass.create
send_file pkpass_path, type: 'application/vnd.apple.pkpass', disposition: 'attachment', filename: "pass.pkpass"
end
Hello,
You can only add a background image with an eventTicket
pkpass
Instead of background.png
use strip.png
or change storeCard
to eventTicket
.
Table 3-1
Hope it help ;)
This is my site...
http://112.217.211.106:3000/passbook/sample
It works well when MacOS Safari...
but...
iPhone Safari does not print "background.png" ...
plz, help me
I'm Korean User... So my english is very poor... sorry