Safari is throwing a error while downloading .pkpass

334 Views Asked by At

I have a web-server with node.js backend, which builds up a .pkpass files (certified and everything is ok).

In pass.json webServiceURL = 'addressToBackEndpoint' for pass update and a authenticationToken (just a random 32 letters).

When I try to install produced pass to walletpasses (on android), it works just fine with no errors. But downloading the same pass from same URL on IPhone brings me a error from safari

Download Failed - Safari cannot download this file.

No logs, no way to find out whats is wrong. PkPassValidator says that there is no issue found in this pass.

Any ideas whats wrong and how to make it work?

2

There are 2 best solutions below

0
Konstantin Mironov On BEST ANSWER

Solved:

After taking a closer look at pass.json, found out that 'o' letter in url (was copied and pasted into pass.json) was in another encoding (while looking pretty similar)

To make sure that everything is okay you may use some encoding valitators.

Tip: with apple its better not to play a lottery but to install an iOS simulator from mac os (in my case Mac OS in VMWare), then launch a simulator with a MAC console(not phone's), then search for 'pass' logs at connected device

3
Nauman Ilyas On

Have you set the header to of download requests. I was facing the same error that was fixed with setting the request header. Here is the same PHP code but the issue seems like the same

    $response->headers->set('Content-Description',' File Transfer');
    $response->headers->set('Content-Disposition',' attachment; filename=' . $quoted);
    $response->headers->set('Content-Transfer-Encoding',' binary');
    $response->headers->set('Connection',' Keep-Alive');
    $response->headers->set('Expires',' 0');
    $response->headers->set('Cache-Control',' must-revalidate, post-check=0, pre-check=0');
    $response->headers->set('Pragma',' public');
    $response->headers->set('Content-Length', $size);
    $response->headers->set('Content-Type', mime_content_type($filename));
    $response->setContent($content);