1

Passbooks をアプリに追加しようとしています。私は一日中それをいじっていましたが、まだ運がありません!

OSX ブラウザで動作

ローカル (OSX) で作業している場合、Chrome と Safari で通帳をダウンロードすると、問題なく開きます。

画像

iOS ブラウザで静かに失敗する

ただし、iOS シミュレーター + Mobile Safari を使用すると、エラー メッセージが表示され、ログ メッセージは表示されません

画像

iPad (iOS 8 および 9) を使用すると、同じ動作が発生します: エラー メッセージ + ログに何も表示されません。

クレイジーなこと1 つあります。iOS 9 を実行している iPhone で 1 回開くことに成功しましたが、それだけです。iOS 8 上の iPhone での以前の試みは成功しませんでした。

iMessage => iOS で動作

同僚がこの質問からファイルをダウンロードし、iMessage で自分のデバイスに送信して、正常にインストールしました。なんと!

サンプルファイル

サンプル.pkpassファイルは次のとおりです: http://rmosolgo.github.io/assets/rm_example.pkpass

私が試したこと

Content-Type ヘッダー

正しいコンテンツ タイプを使用していることを確認しました。Railsコードは次のとおりです。

  format.pkpass {
    # This is just for testing: visit .pkpass to download a pass file just like the
    # one that would be attached to the email
    pkpass = pass.to_pkpass
    send_data(pkpass.stream.string, 
      filename: pass.to_pkpass_filename, 
      content_type: "application/vnd.apple.pkpass"
    ) 
  }

そして、GETリクエストで出くわすようです:

画像

有効な JSON

を解凍し.pkpassて調べてみましたpass.json。すべてが順調でした!

今何??

これについて多くのSOの質問を見てきましたが、それらはすべて何らかのログ出力を伴います。ログ出力がありません。私に何ができる?何か提案はありますか??

本当にありがとう!

4

2 に答える 2

2

まず、ファイルをホストしている github サーバーが正しいContent-Typeヘッダーを送信していません。

$ curl -I http://rmosolgo.github.io/assets/rm_example.pkpass

HTTP/1.1 200 OK
Server: GitHub.com
Content-Type: application/octet-stream
Last-Modified: Wed, 16 Sep 2015 23:00:53 GMT
Access-Control-Allow-Origin: *
Expires: Thu, 17 Sep 2015 01:41:38 GMT
Cache-Control: max-age=600
Content-Length: 748362
Accept-Ranges: bytes
Date: Thu, 17 Sep 2015 01:31:38 GMT
Age: 0
X-Served-By: cache-iad2133-IAD
X-Cache: MISS
X-Cache-Hits: 0
X-Timer: S1442453498.285053,VS0,VE7
Vary: Accept-Encoding
X-Cache: MISS from liveandlearnatlanta.hotelwifi.com
Via: 1.1 varnish, 1.1 liveandlearnatlanta.hotelwifi.com (squid/3.3.2)
Connection: keep-alive

正しいヘッダーで提供されると、パスは正しく読み込まれ、取り込まれます。

ただし、ログは、登録 Web サービスが正しく設定されておらず404、予期されたのではなく応答を発行していることを示しています201

Sep 16 21:35:35 iPhone passd[140] <Warning>: Verifying structure and signature for pass pass.com.PlanningCenter.CheckIn/89709
Sep 16 21:35:35 iPhone passd[140] <Warning>: Signature validation: succeeded
Sep 16 21:35:42 iPhone passd[140] <Warning>: Verifying structure and signature for pass pass.com.PlanningCenter.CheckIn/89709
Sep 16 21:35:42 iPhone passd[140] <Warning>: Signature validation: succeeded
Sep 16 21:35:43 iPhone passd[140] <Warning>: Generating POST request with URL <https://check-ins-staging.planningcenteronline.com/v1/devices/b0d117f8963f3d5103637f4ca990e69a/registrations/pass.com.PlanningCenter.CheckIn/89709>
Sep 16 21:35:43 iPhone passd[140] <Warning>: Request contains header field <Authorization: ApplePass 2ece029fc4b7abe8aedfe95fe2375815e2504cc58ad3111689e29f08f8dbb689>
Sep 16 21:35:43 iPhone passd[140] <Warning>: Request contains body dictionary {
        pushToken = 5d1844d7403dfeca24f8a2275c3161a801515f94c1e07909de5ea6aa85f08479;
    }
Sep 16 21:35:43 iPhone passd[140] <Warning>: Verifying structure and signature for pass pass.com.PlanningCenter.CheckIn/89709
Sep 16 21:35:43 iPhone passd[140] <Warning>: Signature validation: succeeded
Sep 16 21:35:43 iPhone passd[140] <Warning>: Verifying structure and signature for pass pass.com.PlanningCenter.CheckIn/89709
Sep 16 21:35:43 iPhone passd[140] <Warning>: Signature validation: succeeded
Sep 16 21:35:43 iPhone passd[140] <Warning>: Verifying structure and signature for pass pass.com.PlanningCenter.CheckIn/89709
Sep 16 21:35:43 iPhone passd[140] <Warning>: Signature validation: succeeded
Sep 16 21:35:44 iPhone passd[140] <Warning>: Verifying structure and signature for pass pass.com.PlanningCenter.CheckIn/89709
Sep 16 21:35:44 iPhone passd[140] <Warning>: Signature validation: succeeded
Sep 16 21:35:44 iPhone passd[140] <Warning>: Verifying structure and signature for pass pass.com.PlanningCenter.CheckIn/89709
Sep 16 21:35:44 iPhone passd[140] <Warning>: Signature validation: succeeded
Sep 16 21:35:44 iPhone passd[140] <Warning>: Register task (for device b0d117f8963f3d5103637f4ca990e69a, pass type pass.com.PlanningCenter.CheckIn, serial number 89709; with web service url https://check-ins-staging.planningcenteronline.com) got response with code 404
Sep 16 21:35:44 iPhone passd[140] <Warning>: Register task (for device b0d117f8963f3d5103637f4ca990e69a, pass type pass.com.PlanningCenter.CheckIn, serial number 89709; with web service url https://check-ins-staging.planningcenteronline.com) encountered error: Unexpected response code 404
Sep 16 21:35:44 iPhone passd[140] <Warning>: Generating POST request with URL <https://check-ins-staging.planningcenteronline.com/v1/log>
Sep 16 21:35:44 iPhone passd[140] <Warning>: Request contains body dictionary {
        logs =     (
            "[2015-09-16 21:35:44 -0400] Register task (for device b0d117f8963f3d5103637f4ca990e69a, pass type pass.com.PlanningCenter.CheckIn, serial number 89709; with web service url https://check-ins-staging.planningcenteronline.com) encountered error: Unexpected response code 404"
        );
    }
Sep 16 21:35:44 iPhone passd[140] <Warning>: Register task (for device b0d117f8963f3d5103637f4ca990e69a, pass type pass.com.PlanningCenter.CheckIn, serial number 89709; with web service url https://check-ins-staging.planningcenteronline.com) will retry after 10 seconds
Sep 16 21:35:45 iPhone passd[140] <Warning>: Log task (pass type pass.com.PlanningCenter.CheckIn, web service url https://check-ins-staging.planningcenteronline.com) got response with code 200
Sep 16 21:35:54 iPhone passd[140] <Warning>: Generating POST request with URL <https://check-ins-staging.planningcenteronline.com/v1/devices/b0d117f8963f3d5103637f4ca990e69a/registrations/pass.com.PlanningCenter.CheckIn/89709>
Sep 16 21:35:54 iPhone passd[140] <Warning>: Request contains header field <Authorization: ApplePass 2ece029fc4b7abe8aedfe95fe2375815e2504cc58ad3111689e29f08f8dbb689>
Sep 16 21:35:54 iPhone passd[140] <Warning>: Request contains body dictionary {
        pushToken = 5d1844d7403dfeca24f8a2275c3161a801515f94c1e07909de5ea6aa85f08479;
    }
Sep 16 21:35:55 iPhone passd[140] <Warning>: Register task (for device b0d117f8963f3d5103637f4ca990e69a, pass type pass.com.PlanningCenter.CheckIn, serial number 89709; with web service url https://check-ins-staging.planningcenteronline.com) got response with code 404
Sep 16 21:35:55 iPhone passd[140] <Warning>: Register task (for device b0d117f8963f3d5103637f4ca990e69a, pass type pass.com.PlanningCenter.CheckIn, serial number 89709; with web service url https://check-ins-staging.planningcenteronline.com) encountered error: Unexpected response code 404
Sep 16 21:35:55 iPhone passd[140] <Warning>: Generating POST request with URL <https://check-ins-staging.planningcenteronline.com/v1/log>
Sep 16 21:35:55 iPhone passd[140] <Warning>: Request contains body dictionary {
        logs =     (
            "[2015-09-16 21:35:55 -0400] Register task (for device b0d117f8963f3d5103637f4ca990e69a, pass type pass.com.PlanningCenter.CheckIn, serial number 89709; with web service url https://check-ins-staging.planningcenteronline.com) encountered error: Unexpected response code 404"
        );
    }
Sep 16 21:35:55 iPhone passd[140] <Warning>: Register task (for device b0d117f8963f3d5103637f4ca990e69a, pass type pass.com.PlanningCenter.CheckIn, serial number 89709; with web service url https://check-ins-staging.planningcenteronline.com) will retry after 10 seconds

パスフロントを追加 パスバックを追加

于 2015-09-17T01:41:59.147 に答える
1

iPad で通帳をテストしないでください。うまくいかないようです。私にとっては、本物の iPhone が機能し、iPhone を使用すれば iOS シミュレーターが機能しました。

于 2015-09-17T18:43:07.510 に答える