amazon-cognito - Amplify/Cognito 没有在 Pinpoint 中显示分析数据
问题描述
我的用户事件中的任何数据都没有精确显示。
我有一个前端反应原生应用程序,它使用配置为的 Amplify Auth 库:
Amplify.configure({
Analytics: {
AWSPinpoint: {
region: ENV.REGION,
appId: ENV.PINPOINT_APP_ID,
},
},
Auth: {
region: ENV.REGION,
userPoolId: ENV.USER_POOL_ID,
userPoolWebClientId: ENV.USER_POOL_CLIENT_ID,
authenticationFlowType: ENV.AUTHENTICATION_FLOW_TYPE,
oauth: {
domain: ENV.OAUTH_DOMAIN,
scope: ["email", "openid", "profile"],
redirectSignIn: appConfig.scheme,
redirectSignOut: appConfig.scheme,
responseType: "code",
urlOpener,
},
federationTarget: "COGNITO_USER_POOLS",
},
..
在后端,我将 Cognito 与 pinpoint 连接起来,并使用具有以下策略的 IAM 角色:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"cognito-idp:Describe*"
],
"Resource": "*"
}
]
}
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"mobiletargeting:UpdateEndpoint",
"mobiletargeting:PutEvents"
],
"Resource": [
"arn:aws:mobiletargeting:eu-west-1:73463623453:apps/my-pinpoint-project-id/*"
]
}
]
}
当我使用该应用程序登录时。精确无数据出现。
但是,当我使用 cli 执行相同操作时,数据确实会精确显示:
AWS_DEFAULT_PROFILE=novasport-dev aws cognito-idp initiate-auth --auth-flow USER_PASSWORD_AUTH --auth-parameters USERNAME=05ac342c-2134-48f9-b124-b1favc5d0bb1,PASSWORD=myPwd --client-id myWebClienId --analytics-metadata AnalyticsEndpointId=my-pinpoint-project-id
在我的 FE 应用程序中,Amplify 库似乎Auth
无法将数据发送到精确位置。当我跟踪网络请求时,我也没有看到正在执行的代表分析数据的调用。
如何将分析数据从我的 FE 应用程序获取到 Pinpoint?我错过了一些配置吗?
编辑
我们正在使用 Amplify 的模块化导入
import Amplify from "@aws-amplify/core";
package.json
:
"@aws-amplify/api": "4.0.3",
"@aws-amplify/api-graphql": "2.0.3",
"@aws-amplify/auth": "4.0.3",
"@aws-amplify/core": "4.1.1",
解决方案
推荐阅读
- gradle - 使用 Gradle Kotlin DSL 进行集成测试
- c - 使用计时器逐块读取文件
- c# - 将 2 个正则表达式简化为 1 个
- ios - 废话 UICollectionViewCell 高度将在运行时警告为 0
- ns-3 - 如何在提供的链接中从 github 为 NS3 构建和运行代码
- c# - Visual C# Windows 窗体应用程序不知道如何完成此问题
- java - DateTimeFormatterBuilder#appendText(TemporalField, Map
) 解析时抛出异常 - javascript - 使用 Laravel 在 JS 表单中发布令牌
- java - 如何在不被无限循环捕获的情况下重试/捕获输入不匹配异常
- reactjs - 在 Material-UI 中使用自定义主题时不推荐使用排版警告