I created Apple passes file and uploaded to my web server. I have Pkpass files under my web server folders. I am hosting them under IIS.

  • I have added "application/vnd.apple.pkpass" MIME type on IIS.
  • I am hosting it under a subdomain (not an IP address) with HTTPS (with a valid up-to-date SSL certificate)

When I access the Pkpass files on my iPhone with Safari browser everything is working smoothly. The pass is previewing and add button appears.

However, when I access it with the Chrome browser, it is not being previewed, just downloaded the file to the download folder. Any idea will be appreciated to work correctly on Chrome?

1

There are 1 best solutions below

1
On BEST ANSWER

I fixed this problem by adding mime type to the file definition on a GET controller.

    var mimeType = "application/vnd.apple.pkpass";
    var fileBytes = await System.IO.File.ReadAllBytesAsync(filePath);

    return File(fileBytes, mimeType, fileName);