Ios PKPass错误“;无法读取通行证,因为它不是’;无效。”;
获取错误信息 BOM无法提取存档:无法读取PKZip签名 错误可选(错误域=PKPassKitErrorDomain代码=1“传递 无法读取,因为它无效。“ UserInfo={NSUnderlyingError=0x1570e200{Error 域=pkpasskiterrodomain代码=1“(空)”}, NSLocalizedDescription=无法读取过程,因为它不是 有效。}) 检查此代码Ios PKPass错误“;无法读取通行证,因为它不是’;无效。”;,ios,iphone,swift,swift3,passbook,Ios,Iphone,Swift,Swift3,Passbook,获取错误信息 BOM无法提取存档:无法读取PKZip签名 错误可选(错误域=PKPassKitErrorDomain代码=1“传递 无法读取,因为它无效。“ UserInfo={NSUnderlyingError=0x1570e200{Error 域=pkpasskiterrodomain代码=1“(空)”}, NSLocalizedDescription=无法读取过程,因为它不是 有效。}) 检查此代码 var myPass : PKPass? self.myPass = PKPass(da
var myPass : PKPass?
self.myPass = PKPass(data: pageData, error: &errorPass)
这是我的密码
if PKPassLibrary.isPassLibraryAvailable()
{
DispatchQueue.main.async {
do {
let pageData = try Data.init(contentsOf: URL(string: mainURL)!)
var errorPass : NSError?
self.myPass = PKPass(data: pageData, error: &errorPass)
MBProgressHUD.hideAllHUDs(for: self.mainScrollview, animated: true)
if errorPass == nil
{
let passview = PKAddPassesViewController(pass: self.myPass!)
passview.delegate = self
self.present(passview, animated: true, completion: nil)
}
else
{
print("Error \(errorPass)")
}
} catch let e as NSError {
print(e.localizedDescription)
MBProgressHUD.hideAllHUDs(for: self.mainScrollview, animated: true)
self.view.makeToast("Something went wrong with error : \(e.localizedDescription)")
}
}
}
我的PKPass格式是
{
"formatVersion" : 1,
"passTypeIdentifier" : "pass.com.pek.pek",
"serialNumber" : "'.$booking_id.'",
"teamIdentifier" : "ABC00001",
"webServiceURL" : "https://peek.com/ba/pass/",
"authenticationToken" : "kjghadsfgghjgjhfadisfgyfgdsyfuya",
"barcode" : {
"message" : "123456789",
"format" : "PKBarcodeFormatQR",
"messageEncoding" : "iso-8859-1"
},
"organizationName" : "Peek Inc.",
"description" : "Room",
"foregroundColor" : "rgb(255, 255, 255)",
"backgroundColor" : "rgb(0, 200, 83)",
"eventTicket" : {
"primaryFields" : [
{
"key" : "event",
"label" : "Name",
"value" : "'.$restaurant_name.'"
}
],
"secondaryFields" : [
{
"key" : "eventtime",
"label" : "Date",
"value" : "'.$slot_date.'"
}
],
"auxiliaryFields" : [
{
"key" : "bookingid",
"label" : "BOOKING ID",
"value" : "'.$booking_id.'"
},
{
"key" : "noofperson",
"label" : "NO OF TICKETS",
"value" : "'.$no_of_tickets.'",
"textAlignment" : "PKTextAlignmentCenter"
}
]
}
}
提前感谢我在PKPass上工作,面临另一个问题。但我在这里提到了通过拉刷新和推通知生成pass和updatepass的所有步骤
希望这有帮助 我在PKPass上工作过,面临着另一个问题。但我在这里提到了通过拉刷新和推通知生成pass和updatepass的所有步骤
希望这有帮助 您是否尝试下载PKPASS文件并直接解压,只是为了检查文件是否正确压缩和打包?您是否采用PKPASS格式并将其编译成签名、压缩的.PKPASS包?传递到PKPass函数的数据应该是一个pass bundle(这是一个扩展名为.PKPass的zip文件)是的,我将@passkit您是否尝试下载PKPass文件并直接解压缩,只是为了检查文件是否正确压缩和打包?您是否采用了PKPass格式并将其编译成一个签名、压缩的.PKPass bundle?传递到PKPass函数中的数据应该是一个pass bundle(它是一个扩展名为.PKPass的zip文件)yes i will@PassKit