AI-generated Key Takeaways
-
There are four ways to add links to Generic passes: using
GenericClass.LinksModuleDatafor all passes of a class, usingGenericObject.LinksModuleDatafor a specific pass, usingGenericObject.appLinkDatafor an app link at the bottom of a specific pass, and usingGenericClass.appLinkDatafor an app link at the bottom of all passes of a class. -
App linking allows call-to-actions on Google Wallet passes to direct users to branded experiences, with links appearing at the bottom of the pass.
-
To set an app link, configure the
GenericObject.appLinkDatafield with the URI or package name of your app or website for a specific pass orGenericClass.appLinkDatafor all passes of that class. -
The
appLinkDatafield can includeandroidAppLinkInfofor Android apps andwebAppLinkInfofor websites, and thedisplayTextfield, limited to 30 characters, provides a label for the link. -
You can alternatively use
targetUriwithinandroidAppLinkInfoto link directly to your app's Play Store listing instead of opening the app directly.
There are four ways to add links to a Generic pass.
- Use
GenericClass.LinksModuleDatato add links to all Generic passes that are associated with theGenericClass. - Use
GenericObject.LinksModuleDatato add a link to a specific Generic passGenericObject. - Use
GenericObject.appLinkDatato place an app link at the bottom of that particular Pass. - Use
GenericClass.appLinkDatato place an app link at the bottom of all the passes of that class.
One benefit of app linking is that it empowers your call-to-action to navigate users to your branded experiences from Google Wallet. Links with this feature appear at the bottom of the Pass.
Feature example
|
| Issuer |
Set the app link on your Google Wallet pass
For a given Generic pass, set the field GenericObject.appLinkData
to the URI or Package name of your app or website.
See the format and context of the appLinkData field in the following source code:
The displayText field is limited to 30 characters.
{
"id": string,
"classId": string,
…
…
…
"appLinkData": {
"androidAppLinkInfo": {
"appTarget": {
"packageName": "com.google.android.gm",
}
},
"webAppLinkInfo": {
"appTarget": {
"targetUri": {
"uri": "https://mail.google.com/mail/",
"description": "Web link for Gmail"
}
}
}
"displayText": {
"defaultValue": {
"value": "Our awesome app!"
}
}
}
}
{
"id": string,
"classId": string,
…
…
…
"appLinkData": {
"androidAppLinkInfo": {
"appTarget": {
"targetUri": {
"uri": "https://play.google.com/store/apps/details?id=com.google.android.gm",
"description": "Play store link for Gmail app"
}
}
}
}
}