首页 > 解决方案 > 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.

标签: androidiosamazon-web-services

解决方案


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

推荐阅读