Conversation
…ady initialized Fixed bug in zeroConf scan method; as say in docs, it was emitting update method instead start(). Added second verification in Java onServiceResolved method, to ensure that hostAddress has been provided in the object Now, in every "update" emit, updated service name is provided. New method getResolvedServices added, to get only fully resolved services. Stop method converted to async method; now waits until process finishes. Docs fixed and updated.
…unction that was only accepting Objects. Added support in the same method for both types.
balthazar
reviewed
Sep 11, 2018
| if (errorString == null){ | ||
| reactContext | ||
| .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class) | ||
| .emit(eventName, params); |
Owner
There was a problem hiding this comment.
You could use a simple ternary here to avoid repeating the same code, and send the errorString instead of the params if it's defined.
From my understanding, the errorString couldn't work because it was a String instead of an Object?
Author
There was a problem hiding this comment.
Yes, sorry this block is wrong. I´m going to upload a fix for this ;)
| "version": "0.9.0", | ||
| "description": "A Zeroconf discovery utility for react-native", | ||
| "main": "dist", | ||
| "main": "src", |
|
|
||
| if (Object.keys(this._dListeners).length) { | ||
| return this.emit('error', new Error('RNZeroconf listeners already in place.')) | ||
| return this.emit('error', 'RNZeroconf listeners already in place.') |
Author
There was a problem hiding this comment.
I only want to know if an error has ocurred (string is enough). If you pass an Error, you will get a red screen in debug mode, and an app crash in release mode
…nd this is not possible.
…resolvedServices.
…uces an app crash in release (bundled) mode. Now, the error event has a different key that can be correctly handled with a listener. It fixes "Uncaught, unhandled 'error' event (-72000)" issue.
|
Thanks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi there Balthazar!
First of all, thank you so much for the module, has been very useful for my project!
I´ve made some changes and bugfixes to the module, be free to make the changes you desire. I´m sending to you to be shared with Github´s community ;)
Thanks!