3

我正在开发一个应用程序,它将为不同的商店(例如公司 A、公司 B、公司 C 等)分发优惠券通行证。由于通行证将用于不同的商店/公司,因此理想情况下,每个通行证都将使用各自商店的徽标和徽标文本,而不是我的应用程序的徽标和徽标文本。

如果有的话,我的应用程序如何分发带有不同徽标和徽标文本的通行证?

另外,我可以通过应用程序分发多少个不同的通行证是否有限制?

提前致谢!

4

2 回答 2

2

The logo and text used on a Passbook pass are not related to the certificate supplied by Apple used to sign the pass, or the passTypeIdentifier registered with Apple. For each different company, just use a different logo.png, icon.png, logo@2x.png, and so forth.

The only parts of the coupon visible to the user are specified in the content of the pass as you create it.

We've used a single Passbook type for order statuses for a white-label tee shirt website, and the appropriate label branding is inserted depending on which site the product was ordered through.

You could also use localization, although it would be a slight abuse of the feature. Each company could have a different .lproj with their own strings and images. Check the PassKit Programming Guide ("Localizing a Pass" section) for details.

于 2012-09-26T13:16:08.953 回答
2

您的通行证不应在应用程序本身内生成,而应在服务器上生成然后下载到应用程序(或直接下载到 Passbook,然后从应用程序访问)。

这是因为为了在设备上生成和签署通行证,passTypeIdentifier 证书和私钥需要嵌入到应用程序中,这会带来安全风险。

此应用程序使用第三方Pass Creation 服务从设备生成 Pass,然后通过 API 将其拉入。使用此服务,您理论上可以使用任意数量的通行证设计和生成任意数量的通行证,前提是您已授予您的应用访问每个证书的权限。

我看不出@gid 建议的本地化黑客如何不起作用,因为 .lproj 内容只会在用户的设备区域设置与 .lproj 区域设置匹配时覆盖通行证默认值。

免责声明:我与人共同创立了 PassKit,但是需要生成和签署设备传递(并展示可以完成的示例)是我想在这个答案中表达的要点

于 2013-01-08T13:22:47.067 回答