Closed fishkingsin closed 5 years ago
ok. does it work on Android?
it is ios specific issue have not tried on android
Please test version 2.1.4
I found that in txtRecordData is raw byte data to translate it to dictionary it need a proper key,value pair format
but some of my device boardcasted
Optional("\u{0E}isPaired=false\u{0C}serialNumber\rmodel=MODEL_NAME")
serialNumber(key) was wrong format "=" is missing "value" is missing
so txtRecordData returns some data but it is malformed key/value pairs?
are you able to do a quick check on android too? that would be nice.
Does it still crash the app by the way?
it will crash seem NSDictionary could not parse the malformed data
NetService.dictionary fails an assertion if txtData cannot be represented as an NSDictionary object
failed assertions terminate the app in debug for sure, but maybe not in production. @fishkingsin , does it crash in production?
if it does, the problem is in Swift you cannot catch a failed assertion. that means we need to parse ourselves the data. I do not want to do that.
@becvert thanks for the comment, I will trying to fix that
What's the status on this @fishkingsin
I think it only happen from my case, ios + melform txtData I have no idea how to fix that
No worries. I'll have another look later on.
some finding https://stackoverflow.com/questions/40193911/nsnetservice-dictionaryfromtxtrecord-fails-an- assertion-on-invalid-input
any news on that?
Nope. Closing old issue. Feel free to reopen.
I have a device broadcasting null value dictionary cause crashed in https://github.com/becvert/cordova-plugin-zeroconf/blob/master/src/ios/ZeroConf.swift#L354