Actions on google 如何使用conv.user.rights?它返回一个对象,但不显示数据

Actions on google 如何使用conv.user.rights?它返回一个对象,但不显示数据,actions-on-google,Actions On Google,当我使用conv.user.authentications时,它会将[{authentications:[[Object]],packageName:'com.Company.ProjectName'}]返回到console.log-是否有方法在Object中搜索数据 我尝试了conv.user.authentications[authentications]、conv.user.authentications.authentications和conv.user.authentications[

当我使用conv.user.authentications时,它会将[{authentications:[[Object]],packageName:'com.Company.ProjectName'}]返回到console.log-是否有方法在Object中搜索数据


我尝试了conv.user.authentications[authentications]、conv.user.authentications.authentications和conv.user.authentications[0],认为我可以像数组一样读取它,但它不工作,返回时未定义。

您是否尝试序列化它以查看结构,例如

console.log(`entitlements: ${JSON.stringify(conv.user.entitlements)}`);
根据评论中发布的结构,访问特定属性需要在多个数组中导航,例如:

console.log(entitlements[0].entitlements[0].inAppDetails);

console.LogAuthentications[0]。权限[0]。inAppDetails.inAppPurchaseData.purchaseTime

谢谢,这确实管用。我可以访问我尝试过的单个元素吗?var test123=rights.inAppDetails.但它不起作用。这是返回的对象:[{权限:[{inAppDetails:{inAppPurchaseData:{purchaseToken:****,productId:premium,orderId:GAA.3308-9643-0749-88070,purchaseTime:1560638654200,packageName:com.company.product,purchaseState:0},inAppDataSignature:****,sku:premium,skuType:IN_APP}],packageName:com.company.product}]Try:console.logauthentications[0]。authentications[0]。inAppDetails;console.LogAuthentications[0]。权限[0]。inAppDetails.inAppPurchaseData.purchaseTime;