safari ios无法打开存折pkpass [英] safari ios cannot open passbook pkpass

查看:328
本文介绍了safari ios无法打开存折pkpass的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看过一些关于这个主题的主题,但还没有找到答案:

I've seen already some topics on this subject, but havent been able to find the answer:

Safari无法打开我发送的.pkpass文件作为电子邮件attachemnts

Safari cannot open .pkpass files that I am sending as email attachemnts

首先我认为它可能与我的设置有关,但后来我发现我也无法从这个网站打开示例.pkpass
http://www.tomttb.com/test/pass/full_sample/

first I thought it might have something do with my settings, but then I found out that I also cant open example .pkpass from this website http://www.tomttb.com/test/pass/full_sample/

我的文件和示例文件都将内容类型设置为
application / vnd.apple.pkpass

Both mine file and the example one have Content Type set to application/vnd.apple.pkpass

开Android我正在使用PassWallet应用程序,可以下载.pkpass并将其添加到存折。

On Android I am using PassWallet App, and it is possible to download .pkpass and to add it to the passbook.

任何想法?

推荐答案

看了你的.pkpass包后,你的问题是你的 pass.json 文件包含无效的JSON。

Having looked at your .pkpass bundle, your problem is that your pass.json file contains invalid JSON.

设备控制台日志在尝试添加传递时显示以下内容:

The device console log shows the following when attempting to add the pass:

Feb 12 00:31:58 pfr MobileSafari[236] <Warning>: Invalid data error reading pass
/var/mobile/Applications/AF19C13B-113D-44B9-9067-1228253C82ED/Library/Caches/com.apple.mobilesafari/com.apple.Passbook/5BE44BA0-7E7F-4DFA-92ED-D5E41A984F82.pkpass/pass.json. 
Could not read json from URL file:///var/mobile/Applications/AF19C13B-113D-44B9-9067-1228253C82ED/Library/Caches/com.apple.mobilesafari/com.apple.Passbook/5BE44BA0-7E7F-4DFA-92ED-D5E41A984F82.pkpass/pass.json: 
Error Domain=NSCocoaErrorDomain Code=3840 "The operation couldn’t be completed. (Cocoa error 3840.)" 
(Badly formed object around character 221.) UserInfo=0x148cca010 {NSDebugDescription=Badly formed object around character 221.}

之后添加逗号:

"foregroundColor": "rgb(255,111,15)"

并更改密钥:

"description" : '"totally cool party"',

到:

"description" : "\"totally cool party\"",

然后重新编译你的.pkpass包,你应该很好。

Then recompile your .pkpass bundle and you should be good.

** 更新 **

你的朋友ss现在失败了,因为你需要一个整数时为 formatVersion 键设置了一个字符串。

Your pass is now failing because you have set a string for the formatVersion key when it requires an integer.

Feb 12 11:04:22 pfr MobileSafari[1825] <Warning>: Invalid data error reading pass pass.com.ticketino/2677326. Value for key 'formatVersion' must be of class NSNumber, but is actually of class __NSCFString.
Feb 12 11:04:22 pfr MobileSafari[1825] <Warning>: PassBook Pass download failed: The pass cannot be read because it isn’t valid

更改密钥:

"formatVersion": "1",

收件人:

"formatVersion":1,

此外,它看起来像您的相关日期不属于 ISO8061格式,这也会导致通行证被拒绝。

Also, it looks like your relevant date is not in an ISO8061 format, which will also cause the pass to be rejected.

要修复,请将 relevantDate 键更改为:

To fix, change the relevantDate key to:

"relevantDate" : "2014-02-28T12:00:00Z",

关于如何您可以诊断这些问题,只需将手机连接到运行Xcode的Mac,然后从管理器窗口监控设备控制台即可。如果您需要更详细的信息,可以从设备上的开发人员设置菜单启用附加存折日志。

As to how you diagnose these issues, just connect your phone up to a Mac running Xcode and monitor the device console from the Organizer window. If you need more detailed information, you can enable Additional Passbook Logging from the Developer setting menu on the device.

** 更新2 **

现在您的通行证失败了,因为 webServiceURL 是安全的URL。对于生产通行证,您的Passbook Web服务必须通过 https 提供。

Now your pass is failing because the webServiceURL is a secure URL. For production passes your Passbook Web Service MUST be served over https.

如果您的设备配置为开发,那么您可以通过激活开发人员设置菜单的Passkit测试部分中的允许HTTP服务选项来绕过此功能。

If your device is configured for development then you can bypass this by activating the "Allow HTTP Services" option from the Passkit Testing section of the Developer Settings menu.

此外,您的通行证不包含 authenticationToken 键。指定 webServiceURL 时,这是必填项(阅读Passbook Web服务手册!

Also your pass does not contain an authenticationToken key. This is a mandatory key when specifying a webServiceURL (Read the Passbook Web Service Manual!)

调试无法访问Xcode的Passbook即使不是不可能也会非常棘手。建议购买Mac,或采用多种方式之一来 Virualise Mac OSX 在PC硬件上运行Mac OSX。

Debugging Passbook without access to Xcode is going to be extremely tricky, if not impossible. Would recommend either buying a Mac, or resorting to one of the many ways to Virualise Mac OSX or run Mac OSX on PC Hardware.

** 更新3 **

Feb 12 23:21:36 pfr MobileSafari[225] <Warning>: Invalid data error reading pass pass.com.ticketino/2678239. Unable to parse relevantDate 28-05-2014T12:00:00Z as a date. We expect dates in "W3C date time stamp format", either "Complete date plus hours and minutes" or "Complete date plus hours, minutes and seconds". For example, 1980-05-07T10:30-05:00.
Feb 12 23:21:36 pfr MobileSafari[225] <Warning>: PassBook Pass download failed: The pass cannot be read because it isn’t valid.

您的 relatedDate 键仍然无效ISO8601日期!

Your relevantDate key is still not a valid ISO8601 date!

要修复,请将 relatedDate 键更改为:

To fix, change the relevantDate key to:

"relevantDate" : "2014-05-28T12:00:00Z",

这篇关于safari ios无法打开存折pkpass的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆