Question

I'm currently designing passes using passkit4j. Apple passes crop out the excessive characters in the field value. For example if i give 25 chars, and if the limit is 20 the last 5 chars gets cropped out.

I looked around Apple Passbook documentation and PassKit documentation for this detail but no luck. Then i tried myself in passkit.com website and identified the char limit as 20 for primary fields.

But it would be nice if i get some documentation around the convention/constraint of field length for all the fields in a pass.

And also is there any workaround for this? Like reducing the font size if the characters are big?

Was it helpful?

Solution

Unfortunately there is no workaround for this. The sizing and truncation of fields are controlled by proprietary algorithms in the Passbook app. The rendering you see on PassKit.com is our best attempt at reverse engineering these algorithms. The actual number of characters that any one field can contain varies from pass type to pass type, and is affected by the content of adjacent fields. Our service allows allow our users to quickly visualise what a pass will look like on a device, although we will never be 100% accurate so you should always test on a device.

The problem with truncation becomes more acute when you are dealing with user inputted data of variable length, such as names. In these cases, it is often better to validate or process your data before using it in a pass, otherwise you will have little control over what gets shown and what gets cut.

I don't expect that there will ever be any official word from Apple with regard to these limits. The best I could recommend is to file a bug against the documentation, and include as much detail as possible as to why this information is essential for developers.

I also recommend testing any pass designs you may be working on with iOS7, since the rendering algorithms are significantly different. This post in the developer forums gives more insight into the differences. (Apple Developer account required).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top