在应用程序中,我们有一个功能,可以将钱包卡下载到苹果钱包中作为联系人卡。
我们已经创建了这个钱包联系人卡从PHP代码-下面.
$data = [
'description' => 'MyApp',
'formatVersion' => 1,
'organizationName' => 'My app',
'passTypeIdentifier' => 'pass.test.test',
'serialNumber' => '12345678',
'teamIdentifier' => '*********',
'storeCard' => [
"headerFields" => [
[
"key" => "header-text",
"label" => "Let's connect",
"value" => "Together"
]
],
"auxiliaryFields" => [
[
"key" => "aux-text-two",
"label" => "",
"value" => ""
],
[
"key" => "aux-text-one",
"label" => "www.abc.com",
"value" => ""
]
],
"primaryFields" => [],
'secondaryFields' => [],
'backFields' => [],
],
'barcode' => [
'format' => 'PKBarcodeFormatQR',
'message' => 'https://abc.1-2-3-4-5.xyz/public/myapp/?id='.$userData->token.'',
'messageEncoding' => 'iso-8859-1',
],
"backgroundColor" => "rgb(255,255,255)",
'logoText' => '',
'relevantDate' => date('Y-m-d\TH:i:sP'),
"expirationDate" => "2030-01-01T23:00:00Z",
];
我们正在请求从iOS代码调用API生成一个苹果钱包卡,如下所示。
if PKPassLibrary.isPassLibraryAvailable(){
if let data = try? Data(contentsOf: url){
if let pass = try? PKPass(data: data){
let passLibrary = PKPassLibrary()
if !passLibrary.containsPass(pass),
let passController = PKAddPassesViewController(pass: pass){
passController.delegate = self
self.present(passController, animated: true)
}else{
ShowAlert(message: "contact_card_already_exist".localize(), theme: .error)
}
}
}
}
正如截图所说-它的有效期到1/1/30,PHP代码,我们已经给出了到期日以及,但仍然,钱包卡是去过期2天。
任何帮助都很感激。
1条答案
按热度按时间nukf8bse1#
relevantDate
字段看起来像是第二个expiryDate
。如果它是在过去设置的,则通行证显示为过期。这在苹果文档中没有反映。