您可以通过四种方式向通用卡券添加链接。
- 使用
GenericClass.LinksModuleData可添加与GenericClass关联的所有通用卡券的链接。 - 使用
GenericObject.LinksModuleData添加指向特定通用卡券GenericObject的链接。 - 使用
GenericObject.appLinkData将应用链接放置在相应卡券底部部分的第一项。 - 使用
GenericClass.appLinkData将应用链接放置在相应类别的所有卡券底部部分的第一项。
应用关联的一项优势在于,它可让您的行动号召将用户从 Google 钱包引导至您的品牌体验。具有此功能的链接会显示为卡券底部部分的第一项。
功能示例
|
| 颁发者 |
在 Google 钱包卡券上设置应用链接
对于指定的通用卡券,请将字段 GenericObject.appLinkData 设置为您的应用或网站的 URI 或软件包名称。
在下面的源代码中可以查看 appLinkData 字段的格式和上下文:displayText 字段的字符数限制为 30。
{
"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"
}
}
}
}
}