Skip to content
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

Include result in didNotSucceeedWithDeviceID: #50

Open
nmccann opened this issue Sep 16, 2016 · 1 comment
Open

Include result in didNotSucceeedWithDeviceID: #50

nmccann opened this issue Sep 16, 2016 · 1 comment

Comments

@nmccann
Copy link

nmccann commented Sep 16, 2016

For my use case, I'm only interested in configuring the WiFi credentials for my device (without changing it's ownership). Unfortunately in this case didFinishWithResult:device: always passes a nil device. This is understandable, however I need the device ID to pass to my backend, so I have to use didNotSucceeedWithDeviceID:. This method can be called in response to multiple states, so it would be nice if the status was passed as a parameter.

Alternatively I could assume that the method will never be called for a status other than "Succeed Not Claimed", or I could store the status that was passed to didFinishWithResult:device: with the assumption that didNotSucceeedWithDeviceID: will always be called second. Both of these seem like brittle solutions.

I can create a PR with this functionality. To avoid a breaking change I can introduce a new optional delegate method: didNotSucceedWithDeviceID:result: (note that this doesn't include the typo from the current method) or alternatively (and this is my preference): didFinishWithResult:deviceID:. The former option implies that "Success Not Claimed" is a failure, but that might actually be the desired result. The latter option is less opinionated about the result, but could be confusing alongside the similarly named didFinishWithResult:device:

@nmccann
Copy link
Author

nmccann commented Sep 16, 2016

Alternatively a single method could be used: didFinishWithResult:andID:device: or something similar.

For my use case it's a little odd that didFinishWithResult:device: is a required method, since I never expect to use it. But I admit my use case may not be common.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant