google-wallet / google-wallet/android-codelab

textModulesData[] is not being displayed

Open
#26 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
48
Forks
31
PR merge metrics
No merged PRs in 30d

Description

I have followed the codelad example but when viewing the pass in the wallet the textmoduledata information is not displayed.
this is my code:
`const genricClass = {
"id": ${issuerId}.${classSuffix},
"classTemplateInfo": {
"cardTemplateOverride": {
"cardRowTemplateInfos": [
{
"twoItems": {
"startItem": {
"firstValue": {
"fields": [
{
"fieldPath": "object.textModulesData['points']",
},
],
},
},
"endItem": {
"firstValue": {
"fields": [
{
"fieldPath": "object.textModulesData['contacts']",
},
],
},
},
},
},
],
},
},
}
const genericObject = {
'id': ${issuerId}.${order.nanoId},
'classId': ${issuerId}.${classSuffix},
"logo": {
"sourceUri": {
"uri": "https://storage.googleapis.com/wallet-lab-tools-codelab-artifacts-public/pass_google_logo.jpg"
},
"contentDescription": {
"defaultValue": {
"language": "en-US",
"value": "LOGO_IMAGE_DESCRIPTION"
}
}
},
"cardTitle": {
"defaultValue": {
"language": "en-US",
"value": "[SOLO PARA PRUEBAS] Google I/O"
}
},
"subheader": {
"defaultValue": {
"language": "en-US",
"value": "Attendee"
}
},
"header": {
"defaultValue": {
"language": "en-US",
"value": "Alex McJacobs"
}
},
"textModulesData": [
{
"id": "points",
"header": "POINTS",
"body": "1112"
},
{
"id": "contacts",
"header": "CONTACTS",
"body": "79"
}
],
"barcode": {
"type": "QR_CODE",
"value": "BARCODE_VALUE",
"alternateText": ""
},
"hexBackgroundColor": "#4285f4",
"heroImage": {
"sourceUri": {
"uri": "https://storage.googleapis.com/wallet-lab-tools-codelab-artifacts-public/google-io-hero-demo-only.png"
},
"contentDescription": {
"defaultValue": {
"language": "en-US",
"value": "HERO_IMAGE_DESCRIPTION"
}
}
}
}

const claims = {
  iss: credentials.client_email, 
  aud: 'google',
  origins: ['https://dev-api.hifumi.com'],
  typ: 'savetowallet',
  payload: {
    genericObjects: [genericObject],
    genericClasses: [genricClass]
  }
}`

and this is my result:
IMG_3026

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the textModulesData and classTemplateInfo payload shown in the issue, then compare it with the codelab example and how the pass is rendered in Google Wallet. Verify the field paths and payload structure; the issue is done when the points and contacts text modules appear in the displayed pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.