Skip to content

Instantly share code, notes, and snippets.

@mgwedd
Created July 16, 2019 15:37
Show Gist options
  • Save mgwedd/fae65225dcb3c738c5a85fd2dd0f9aed to your computer and use it in GitHub Desktop.
Save mgwedd/fae65225dcb3c738c5a85fd2dd0f9aed to your computer and use it in GitHub Desktop.
// Initialising AWS IoT And IoT DataManager
AWSIoT.register(with: configuration!, forKey: "kAWSIoT") // Same configuration var as above
let iotEndPoint = AWSEndpoint(urlString: "wss://XXXXXXXXXXXXX-ats.iot.your-region.amazonaws.com/mqtt") // Access from AWS IoT Core --> Settings
let iotDataConfiguration = AWSServiceConfiguration(region: you-region-here, // Use AWS typedef .Region
endpoint: iotEndPoint,
credentialsProvider: credentials) // credentials is the same var as created above
AWSIoTDataManager.register(with: iotDataConfiguration!, forKey: "kDataManager")
// Access the AWSDataManager instance as follows:
let dataManager = AWSIoTDataManager(forKey: "kDataManager")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment