LoginSignup
0
0

More than 3 years have passed since last update.

PassKitのpass.jsonについて

Last updated at Posted at 2020-01-20

仕事で調べる必要があったため、この機会にpass.jsonの中身の定義はなんなのかを残しておく。
ただし、pass.jsonの中身の定義は扱う種類によって変動するため下のpass.jsonを元に説明を入れます。

余裕があれば、もっと詳しく書きます。

pass.json
{
  "formatVersion" : 1, // 必須。バージョン数値。
  "passTypeIdentifier" : "pass.com.hoge.app", // AppleDeveloperで登録したpass名
  "serialNumber" : "p69f2J", // シリアルナンバー
  "teamIdentifier" : "h0GeTEsT", // AppleDeveloperで登録されたチームID
  "webServiceURL" : "https://example.com/passes/", // WebサービスのURL
  "authenticationToken" : "vxwxd7J8AlNNFPS8k0a0FfUFtq0ewzFdc", // 認証トークン
  "locations" : [ // 位置情報(ビーコンで使用する場合に必須)
    {
      "longitude" : -122.3748889,  //経度
      "latitude" : 37.6189722 //緯度
    }
  ],
  "barcode" : { // バーコード情報
    "message" : "123456789", // 必須。バーコードと一緒に表示する文字列
    "format" : "PKBarcodeFormatQR", // 必須。バーコードのフォーマットで今回はQRコードのフォーマットを指定。
    "messageEncoding" : "iso-8859-1" //必須。messageのエンコーディング。
  },
  "organizationName" : "Organic Produce", // 必須。組織名。
  "description" : "Organic Produce Loyalty Card", //必須 パスの説明。
  "logoText" : "Organic Produce", // ロゴの文字列
  "foregroundColor" : "rgb(255, 255, 255)", // パスの表の色
  "backgroundColor" : "rgb(55, 117, 50)", // パスの背景の色
  "storeCard" : {
    "primaryFields" : [ //フィ-ルドデータリスト
      {
        "key" : "stampcard", // 文字列。パスデータ全体でユニークな値
        "label" : "Stamp Card", // 文字列。表示するラベルの文字列
        "value" : 21.75, // 文字列およびISO 8601形式のDateの文字列、数値。必須項目。このフィールドの値。
        "currencyCode" : "USD" // 通貨単位。
      }
    ],
    "auxiliaryFields" : [ //フィ-ルドデータリスト
      {
        "key" : "deal", // 文字列。パスデータ全体でユニークな値 
        "label" : "Deal of the Day", // 文字列。表示するラベルの文字列
        "value" : "Lemons" // 文字列およびISO 8601形式のDateの文字列、数値。必須項目。このフィールドの値。
      }
    ]
  }
}

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0