davesters / rn-native-mqtt

An MQTT client for React Native that actually works and exposes a simple Javascript interface
MIT License
63 stars 43 forks source link

Update build.gradle #44

Open biaji opened 1 year ago

biaji commented 1 year ago

Use 1.2.1 instead to avoid following error:

MqttConnectOptions.setUserName in 1.2.0 has a empty string check(removed by commit ):

    public void setUserName(String userName) {
        if ((userName != null) && (userName.trim().equals(""))) {
            throw new IllegalArgumentException();
        }
        this.userName = userName;
    }

while the connect method in MqttClient will give "" as default value for username:

connOpts.setUserName(options.hasKey("username") ? options.getString("username") : "");

Which result to an IllegalArgumentException