Skip to content

Instantly share code, notes, and snippets.

@mobilequickie
Created September 6, 2018 23:16
Show Gist options
  • Save mobilequickie/5a1e97d655ff5d750653f9b2a4a6bacc to your computer and use it in GitHub Desktop.
Save mobilequickie/5a1e97d655ff5d750653f9b2a4a6bacc to your computer and use it in GitHub Desktop.
Function inside of AWSAnalyticsService class that updates custom attributes for collecting demographics in Amazon Pinpoint
// Send custom model and platformVersion for this device to Amazon Pinpoint
func recordCustomProfileDemographics() {
let profile: AWSPinpointEndpointProfile = (pinpoint?.targetingClient.currentEndpointProfile())!
// Call our DeviceUtility class for readable Apple model type and iOS version for this device
profile.demographic?.model = UIDevice.current.modelName
profile.demographic?.platformVersion = UIDevice.current.systemVersion
pinpoint?.targetingClient.update(profile)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment