-
Notifications
You must be signed in to change notification settings - Fork 877
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
fix(IoT): Adding completion callbacks for registerWithShadow
and unregisterFromShadow
methods
#5192
base: main
Are you sure you want to change the base?
Conversation
614cdb1
to
93e171a
Compare
- (BOOL) registerWithShadow:(NSString *)name | ||
options:(NSDictionary *)options | ||
eventCallback:(void(^)(NSString *name, AWSIoTShadowOperationType operation, AWSIoTShadowOperationStatusType status, NSString *clientToken, NSData *payload))callback | ||
completionHandler:(nullable void(^)(void))completionHandler { |
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.
Having the nullable
annotation in the interface method resulted in weird stuff when the method was translated to Swift and autocompletion was attempted.
While not an error itself, I rather just do this to avoid confusing consumers, i.e. having the completionCallback
declared as nonnull
and having an implementation-only method that can take nil
.
The same applies for the unregisterFromShadow
method
Issue #, if available:
Description of changes:
This PR adds the following methods to
AWSIoTDataManager
:registerWithShadow:options:eventCallback:completionCallback:
unregisterFromShadow:completionCallback:
They are basically just overloading the existing ones with the addition of the
completionCallback
argument, which is invoked when the subscription to all topics is done.The reasoning behind this is to provide a way for consumers to know when the subscription is actually done and they can get the shadow (see the referenced issue for more information).
Check points:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.