Add additional fields using Google Wallet Android SDK

56 views Asked by At

I am trying to integrate google wallet into my react native expo app. I have implemented it using expo modules and it all works fine so far. There is one issue, I am trying to include additional row/fields of information on the card itself. When I include the info in textModulesData, this info shows up on the details of the pass (when it is clicked to see more) and not on the actual generated pass.

I am not sure how to include fields on the pass visually. I have tried a few things but it does not work.

this is the payload I am using as unsigned jwt. and this does not work. the generic pass by itself works fine. How do I add additional row or fields so that they are visible on the pass? Right now, they are only visible when you click the pass and view it, they are not on the pass.

{ iss: '[email protected]', typ: 'savetowallet', aud: 'google', origins: [], payload: { genericClasses: [ { id: 'issuer-id.className', classTemplateInfo: { cardTemplateOverride: { cardRowTemplateInfos: [ { twoItems: { startItem: { firstValue: { fields: [ { fieldPath: "object.textModulesData['company']" }, ], }, }, endItem: { firstValue: { fields: [ { fieldPath: "object.textModulesData['job']" }, ], }, }, }, }, ], }, }, }, ], genericObjects: [genericPass], }, };

Generic Pass is

{ id: issuer-id.${objectSuffix}, classId: issuer-id.${classSuffix}, genericType: 'GENERIC_WALLET_UNSPECIFIED', cardTitle: { defaultValue: { language: 'en-GB', value: 'Profile', }, }, header: { defaultValue: { language: 'en-GB', value: ${fullName ?? ''}, }, }, logo: { sourceUri: { uri: 'https://some-valid-link', }, contentDescription: { defaultValue: { language: 'en-GB', value: 'Union', }, }, }, textModulesData: [ { id: 'job', header: 'Job Title', body: ${jobTitle ?? ''}, }, { id: 'company', header: 'Company', body: 'Google', }, ], hexBackgroundColor: '${common.white}', barcode: { type: 'QR_CODE', renderEncoding: 'UTF_8', value: some-valid-link, }, };

1

There are 1 answers

0
grundyoso On

It's a bit hard to read your JSON, if you clean it up I can try to give some guidance. Otherwise, consider using an API like PassNinja to issue your pass!