How to send UDP messages to devices on network?


#1

Hi again!
@mhartington @leob @mike I want to send UDP(User Datagram Protocol) messages to clients. Any Service exists in Angular Ionic like $http? Do let me know! Thank You…


#2

No experience with this, but I see 2 Cordova plugins which can do it apparently:



#3

its ok @leob . Do you have experience with socket.IO?


#4

No I don’t have experience with that yet …

I want to add realtime communication (chat function) to my app, but for now I’m planning to use Firebase for that.

When at some point it doesn’t perform well enough or it’s getting to expensive then I’ll look at setting up my own server with socket.io or a solution like that.


#5

@leob You have any idea of how to inject those UDP plugins into Angular applications?


#6

Sorry no, but you can look at how ngCordova does that, for instance the battery status plugin (arbitrary example):

battery

ngCordova is just an Angular wrapper around Cordova plugins, the code isn’t difficult to read.
As you see the code for this plugin is just 47 lines.

Bluetooth plugin (a bit longer but still jut 218 lines):

bluetooth