複数のパスをグループ化する
グループ 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。"],[[["By default, multiple passes added to Google Wallet are not grouped; however, you can group them using a `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, ensure the `groupingInfo.groupingId` property is the same for all passes you want to group."],["Setting the same `groupingId` for different pass types like loyalty cards and offers allows you to create combined experiences for users."]]],["Passes in Google Wallet can be grouped by assigning them a shared `groupingId`. This can be done during the initial provisioning or later using `update` or `patch` methods. Setting the `groupingInfo.groupingId` property in each pass object ensures they are grouped. Passes with the same `groupingId` appear together in the user's wallet and are shown on a carousel when selected. The example shows a loyalty card and an offer using \"combinedGiftCardAndOfferId\" to be grouped.\n"]]