Fatih
Fatih

Reputation: 41

Chrome is not rendering/previewing Apple pass whereas Safari previewing the pass when I click the download link

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.

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?

Upvotes: 0

Views: 669

Answers (1)

Fatih
Fatih

Reputation: 41

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);

Upvotes: 1

Related Questions