android - How to get AWS Pinpoint Analytics to use Wifi or Cellular data
问题描述
I'm using AWS Pinpoint to upload Analytics from iOS and Android clients. I've googled this for a couple of hours but come up with nothing.
How do I specify that Pinpoint should use WiFi only or Wifi & Cellular when uploading analytics events?
I know in normal AWS configurations there is an allowsCellularAccess property that allows you to specify this - but I can't see how you can apply this to Pinpoint.
In the old MobileAnalytics there was a different property called something like useDataNetwork.
解决方案
UPDATE:
Currently the AWS SDK for Android - Pinpoint doesn't support this feature but I'm taking this request to the team for prioritization.
For AWS SDK for iOS - Pinpoint:
You can use the AWSServiceConfiguration
object and set the allowsCellularAccess
flag to TRUE/FALSE.
let credentialProvider = AWSCognitoCredentialsProvider(regionType: .USWest2, identityPoolId: "us-west-x:xxx")
let configuration = AWSServiceConfiguration(region: .USWest2, credentialsProvider: credentialProvider)
configuration?.allowsCellularAccess = false
AWSServiceManager.default().defaultServiceConfiguration = configuration
推荐阅读
- python - 如何在python中转换字典中的多个列表
- mysql - 如何使用另一个表中的新列更新现有表?
- visual-studio-code - 更新 vscode v1.53 后 vscode Prettier 不工作
- javascript - Bootstrap Modal Reactjs 中的 Mapbox 渲染问题
- html - 调整文本以适合背景图像以打印 A4
- postman - 如何使用预请求脚本在 Postman 中发送 POST 请求(注册)
- php - 如何修复这个未定义的数组键?
- javascript - 在移动设备上禁用整页 js
- c# - 如何从 SQL 数据库表中选择随机行?
- java - Spring JPA规范转换根类型比较成功