becvert / cordova-plugin-zeroconf

Cordova ZeroConf Plugin
MIT License
81 stars 57 forks source link

Add "unregister" success callback (IOS) #68

Closed LabDeve closed 5 years ago

LabDeve commented 6 years ago

This doc is wrong: unregister(type, domain, name, success, failure)

success or failure callback are never called...

ZeroConf.swift : public func unregister(_ command: CDVInvokedUrlCommand) {

    let type = command.argument(at: 0) as! String
    let domain = command.argument(at: 1) as! String
    let name = command.argument(at: 2) as! String

    #if DEBUG
        print("ZeroConf: unregister \(name + "." + type + domain)")
    #endif

    if let publisher = publishers[name + "." + type + domain] {
        publisher.unregister();
        publishers.removeValue(forKey: name + "." + type + domain)
    }

    >> let pluginResult = CDVPluginResult(status:CDVCommandStatus_OK)                 <<
    >> self.commandDelegate?.send(pluginResult, callbackId: command.callbackId)   <<
}
becvert commented 6 years ago

success should be called but not failure indeed

becvert commented 5 years ago

Closing old issue. Feel free to reopen.