-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mqtt Client iOS Sample #270
base: iot
Are you sure you want to change the base?
Conversation
This sample is an iOS application that launches the Mqtt Client and subscribes to the topic `test/topic`. | ||
|
||
## How to run the application | ||
1. Open project `Samples/MqttClient/MqttClient.xcodeproj` with XCode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Old readme?
## How to run the application | ||
1. Open project `Samples/MqttClient/MqttClient.xcodeproj` with XCode | ||
2. Signing. Signing is required for iOS application. Setup `Project > Signing & Capabilities > Team` to automatically manage signing. | ||
3. Update Dependency. The project depends on aws-crt-swift. Go to `File > Add package dependency > Add Local ... ` and select your local aws-crt-swift. Alternatively, you can also enter Package URL `https://github.com/awslabs/aws-crt-swift` for released versions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should always depend upon the release version and people can replace that with local version if desired instead of always adding it manually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sample is already setup to point to local version, so that the CI could test any local changes. The REAME is just there to make sure it provided detailed instructions for dependencies.
.gitignore
Outdated
@@ -7,3 +7,6 @@ cmake-build-debug | |||
.DS_Store | |||
.swiftpm | |||
.vscode | |||
|
|||
# Ignore XCode project local user data | |||
Test/**/xcuserdata |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a proper gitignore generated by some tool like https://www.toptal.com/developers/gitignore/api/xcode?
Is there any update on this PR getting merged? |
public var publishCount = 0 | ||
|
||
/// Print the text and pending new message to message list | ||
func printView(_ txt: String) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These UI updates need to happen on the main DispatchQueue. Wrap below in:
DispatchQueue.main.async {
let newMessage = Message(id: self.messages.count, text: txt)
self.messages.append(newMessage)
print(txt)
}
to resolve.
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.