JSONObject subscribeUUID = new JSONObject();
try {
subscribeUUID.put("uuid","383ff240-2bc0-4582-bb5d-1f04971c089c");
} catch (JSONException e) {
e.printStackTrace();
}
mSocket.emit("subscribe", subscribeUUID, new Emitter.Listener(){
@Override
public void call(Object... args) {
Log.i(TAG,args[0].toString());
}
});
My local meshblu reports error and crashed.
Because fn is a string ,not a function.
com.github.nkzawa.socketio.androidchat.MeshbluTest$1$1$1@424cdc60
TypeError: fn is not a function
at /home/dev/workspace/meshblu/lib/socketLogic.js:242:15
at /home/dev/workspace/meshblu/lib/simpleAuth.coffee:183:7
at /home/dev/workspace/meshblu/lib/simpleAuth.coffee:36:20
at UUIDAliasResolver.resolve (/home/dev/workspace/meshblu/src/uuid-alias-resolver.coffee:11:12)
at UUIDAliasResolver.resolve (/home/dev/workspace/meshblu/src/uuid-alias-resolver.coffee:1:1)
at /home/dev/workspace/meshblu/lib/simpleAuth.coffee:29:30
....
~/meshblu/lib/socketLogic.js
Do I need to add a judgment about the type of fn? I don't know how you avoid this.
I used a client with socket.io-android--- https://github.com/nkzawa/socket.io-android-chat to connect my local meshblu, when I try to emit a subscribe event:
My local meshblu reports error and crashed. Because fn is a string ,not a function.