How to set MIME type of application/vnd.apple.pkpass in order to share pass by link or email

前端 未结 2 1064
慢半拍i
慢半拍i 2020-12-03 11:43

I just created an app and a pass, so I can add the pass to the PassBook in iPod, but I cannot share the pass by email or link from web server. From the documentation I read

2条回答
  •  一个人的身影
    2020-12-03 12:34

    Apache

    Add the following line to either:

    • the .htaccess in the directory serving your .pkpass, or
    • to the mime.types file, or
    • to your appache httpd.conf or virtuatl server .conf file

    Then restart Apache (not required if adding to .htaccess)

    AddType application/vnd.apple.pkpass    pkpass
    

    nginx

    Add the following line to your mime.types file and restart nginx

    application/vnd.apple.pkpass    pkpass;
    

    IIS

    1. Open IIS Manager and navigate to the level you want to manage.
    2. In Features View, double-click MIME Types.
    3. In the Actions pane, click Add.
    4. In the Add MIME Type .pkpass
    5. Type application.vnd.pkpass n the MIME text box
    6. Click OK
    7. Restart IIS

    If you are serving your file via a script and are not able to edit your web server config you could add the following line before any content is sent:

    PHP

    header('Content-Type: application/vnd.apple.pkpass');
    

    C#

    WebClient client = new WebClient();
    client.Headers.Add("Content-Type", "application/vnd.apple.pkpass");
    

提交回复
热议问题