Comments (10)
That has nothing to do with the file itself but with the webserver that serves it.
from jpasskit.
Hi drallgood,
Thanks for quick reply.
I'm using Eclipse and coding portlet with Liferay open source. I have tried many way to write file from byte[], but the content type always is "application/octet-stream".
Do you have any example or demo source to write file with content type "appication/vnd.apple.pkpass" in java?
Thanks again!
from jpasskit.
I am not familiar with portlet programming, but using "portlet set content
type" as keywords, one of google search results provide me with this:
public void serveResource(
ResourceRequest req, ResourceResponse res)
res.setContentType("application/pdf");
The whole long post is here:
http://www.liferay.com/community/wiki/-/wiki/Main/Generate+PDF+File+in+Portlet
On Thu, Oct 25, 2012 at 11:17 AM, hnthuan [email protected] wrote:
Hi drallgood,
Thanks for quick reply.
I'm using Eclipse and coding portlet with Liferay open source. I have
tried many way to write file from byte[], but the content type always is
"application/octet-stream".
Do you have any example or demo source to write file with content type
"appication/vnd.apple.pkpass" in java?
Thanks again!—
Reply to this email directly or view it on GitHubhttps://github.com//issues/3#issuecomment-9764735.
from jpasskit.
You are using liferay? My condolences ;)
The code looks okay to me.
The one thing you should make sure, is that you are also sending the .pkpass file extension (not .pkpass.zip or something like that). iOS seems to need the extension to determine the App to use (rather than the content-type)
from jpasskit.
Thanks all for reply!
This is my mistake :)
The problem is not from content type, just because of the number of parameters passing to PKPass object.
@drallgood: There is one problem with Barcode when creating pkpass file .
When I call function "setMessageEncoding( Charset.forName( "utf-8" ) )",I receive a string {"register":"true"} in pass.json file , so PassBook can't read pkpass file .
I fix this by editing your code, replying Charset by String, rebuilding project and creating new pkpass file that PassBook read successfully.
I'm not sure the message which will be encode to UTF-8, so I hope you can check this bug for everyone can use your code easier.
Thanks for great project!
from jpasskit.
Let me check that. I'll create a new issue for it and close this one, if that's okay for you?
from jpasskit.
hmm.. It's not happening here... Is it possible to get a full code example?
from jpasskit.
Okay, you can close this issue :)
from jpasskit.
This is my code:
- package de.brendamour.jpasskit:
public class PKBarcode implements IPKValidateable {
...
// private Charset messageEncoding;
private String messageEncoding;
// public Charset getMessageEncoding() {
// return messageEncoding;
// }
//
// public void setMessageEncoding(final Charset messageEncoding) {
// this.messageEncoding = messageEncoding;
// }
public String getMessageEncoding() {
return messageEncoding;
}
public void setMessageEncoding(String messageEncoding) {
this.messageEncoding = messageEncoding;
}
...
}
- package de.brendamour.jpasskit;
public class PKBarcodeTest {
...
// private static final Charset CHARSET = Charset.forName("UTF-8");
private static final String CHARSET = "UTF-8";
...
}
That's all. Hope this help.
edited by drallgood: Just formatting stuff
from jpasskit.
No, sorry. I meant, whether you could sent my the actual code you were using to create the pass and maybe the generated pass.json.
I'm not seeing this issue, but maybe there is something else happening.
Also: Let's use issue #6 for this.
from jpasskit.
Related Issues (20)
- missing parent pom on Maven Central Repository HOT 2
- Version missing when trying to resolve HOT 2
- Tutorial is outdated HOT 2
- Error in url
- cannot open created .pkpass with valid certs HOT 3
- DepShield Deprecation Notice
- AppleWWDRCA.cer is expired, what certificate now? HOT 4
- Jackson needs to be updated to 2.15
- Missing release of jpasskit-parent on Maven Central HOT 3
- Using .p8 certificate HOT 4
- Dropping Java 8 support HOT 3
- Switch to gradle HOT 1
- FileNotFoundException in rest.ssl.keystore.path HOT 1
- I have a pkpass that doesn't open HOT 5
- `de.brendamour.jpasskit.signing.PKSigningUtil` is deprecated HOT 5
- Foreground color does not work if background image is set HOT 5
- How to add a QR code? HOT 1
- Create multiple passes at once HOT 2
- PKPassTemplateFolder - unable to load template path from .jar file HOT 1
- About PKPass and pass.json HOT 8
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 jpasskit.