複数のパスをグループ化する
グループ ID を使用する
デフォルトでは、1 つのプロジェクトに複数のパスを
[Google ウォレットに追加] リンクを使用しても、これらのパスは
。ただし、パスをグループにまとめることで、
すべて同じグループ ID を持つようにしますグループ化されたパスが一緒に表示されます
Google ウォレット アプリで。パスのグループを選択すると、それぞれのパスが
カルーセル表示にするか
パスをグループ化できる状況は以下のとおりです。
グループにパスを追加するには、次の groupingInfo.groupingId
プロパティを使用します。
パス オブジェクトを設定する必要があります。すべてのパス オブジェクトを同じ
groupingId
の値は、次の場合でも自動的にグループ化されます
個別に追加されました。
次の例は、ポイントカードとクーポンをグループ化し、
次回の購入で両方を利用するよう促す。
loyaltyObject = {
"classId": "ISSUER_ID.GIFT_CARD_CLASS_SUFFIX",
"id": "ISSUER_ID.GIFT_CARD_OBJECT_SUFFIX",
"state": "ACTIVE",
"groupingInfo": {
# Note the same groupingId value
"groupingId": "combinedGiftCardAndOfferId",
"sortIndex": 1
},
"barcode": {
"type": "QR_CODE",
"value": "QR code"
},
"accountId": "Account id",
"accountName": "Account name",
"loyaltyPoints": {
"label": "Points",
"balance": {
"int": 800
}
}
}
offerObject = {
"classId": "ISSUER_ID.OFFER_CLASS_SUFFIX",
"id": "ISSUER_ID.OFFER_OBJECT_SUFFIX",
"state": "ACTIVE",
"groupingInfo": {
# Note the same groupingId value
"groupingId": "combinedGiftCardAndOfferId",
"sortIndex": 2
},
"barcode": {
"type": "QR_CODE",
"value": "QR code",
},
}
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-03-11 UTC。
[null,null,["最終更新日 2025-03-11 UTC。"],[[["Adding multiple passes to a single Google Wallet link will not group them by default, but you can group them using the same `groupingId`."],["Grouped passes appear together in the Google Wallet app and can be provisioned together or grouped later using the `update` or `patch` methods."],["To group passes, set the `groupingInfo.groupingId` property to the same value for all passes you want to group."],["Passes with the same `groupingId` will be automatically grouped, even if added separately, and displayed in a carousel when selected."]]],["Passes in Google Wallet can be grouped by assigning them a shared `groupingId`. This ensures they appear together as a carousel in the user's wallet. Grouping can occur during initial provisioning or via `update` or `patch` methods. The `groupingInfo.groupingId` property must be set within the pass object to establish the group. All passes with the same `groupingId` are automatically grouped. An example shows a loyalty card and an offer being linked with the same ID.\n"]]