Код: Выделить всё
public function get_apple_pass() {
$CONFIG = $GLOBALS['CONFIG'];
$pass = new PKPass($CONFIG["PKPASS_CERTIFICATE_FILE_PATH"], $CONFIG["PKPASS_CERTIFICATE_PASSWORD"]);
global $dbconnection;
$sql = "SELECT * FROM customers WHERE customer_id = ?";
$stmt = $dbconnection->prepare($sql);
$stmt->execute([$this->customer_id]);
$customer = $stmt->fetch();
if (!$customer) {
Utils::print_error("Customer not found.", true);
die;
}
// Pass content
$data = [
'description' => 'MY_DESCR',
'formatVersion' => 1,
'organizationName' => 'MY_ORG',
'passTypeIdentifier' => 'MY_PASS_TYPE_IDENTIFIER',
'serialNumber' => $customer['customer_number'],
'teamIdentifier' => 'MY_TEAM_IDENTIFIER',
'foregroundColor' => 'rgb(7,29,73)',
'backgroundColor' => "rgb(195, 215, 238)",
'barcode' => [
'format' => 'PKBarcodeFormatCode128',
'message' => $customer['customer_number'],
'messageEncoding' => 'iso-8859-1',
'altText' => $customer['customer_number'],
],
'logoText' => 'Love My Style',
"generic" => [
"primaryFields" => [
[
"key" => "full_name",
"label" => "Cliente",
"value" => $customer['first_name'] . " " . $customer['last_name']
]
]
]
];
$pass->setData($data);
// Add files to the pass package
$pass->addFile(__DIR__ . '/../../assets/logo/apple/icon.png');
$pass->addFile(__DIR__ . '/../../assets/logo/apple/icon@2x.png');
// Create and output the pass
return $pass->create(false);
}
< /code>
Когда я пытаюсь запустить скрипт через Safari на iPhone (iOS 18.3.1) ошибка «Safari не может загрузить этот файл». https://developer.apple.com/account/res ... passtypeid.
Что я могу сделать?
См. Выше что я попробовал. У меня нет iPhone (физически), чтобы попытаться проверить ошибку из приложения консоли Mac. />https://1drv.ms/u/c/80518cd6e386bd99/eq ... a?e=sgylsf ploordsf plorse/an -ancome/an -antailin окно Incognito
Спасибо
Подробнее здесь: https://stackoverflow.com/questions/794 ... php-pkpass
Мобильная версия