I am working with socket io using AppCoda this Tutorial. connect to socket server using node.js and swift, working fine , But it was group chat if we send the message it is showing to all users available in the socket . But How can we send messages one to one I am using socketio/socket.io-client-swift till now I can able to connect the socket after that what I will follow to create one to one chat.
As per my search we need to create a chatroom for two persons,But I am not sure Please let me know.
Related
I'm working on sending and receiving messages via MQTT, I'm using mqttClient framework:
https://github.com/ckrey/MQTT-Client-Framework
Specifically this class: https://github.com/ckrey/MQTT-Client-Framework/blob/master/MQTTSwift/MQTTSwift/MQTTSwift.swift
So this is all working just fine using Xcode simulator, publish and subscribe and so receiving the data (messages) just as it should BUT once I connect my iPhone I could not see my data on the debug screen as it used to be and all I can get is this
nw_connection_get_connected_socket_block_invoke 1 Connection has no connected handler.
I was trying to solve this all day but no use,
You have to give proper IPAddress instead of "localhost" if used.
It solved my issue.
I'm just starting to get into app development and have just been learning the uses of Xcode and Objective-C language. Just wondering how an app like snapchat or any other app can send data from one user to another. General answers would suffice just to better my understanding.
How do they test this functionality?
How can they connect peer to peer and send data from one phone to another? Is it all accessed in one database that the app connects to everytime that it pulls down?
When you sign up for an app like this with a registered account is that information stored on the iphone?
Well there are two ways data can be sent to a device. One is the device polls the main server periodically. This can be seen in a pull to refresh scenario. The other is the server can send a push notification to the specific phone and app which causes the data to be received by the device and displayed however the programmer wants. So device to device is essentially one person sending something through a web service call to your server. Your server them packages that information into a Json payload and sends a push notification to the recipient. It seems like its device to device because its so quick, but it requires that you have a server in the middle and of course your server is really sending the push notification to Apple's push server, so there really are two servers involved.
How do they test this functionality?
I would try to do this with real devices, and/or using a network sniffer tool to inspect the send packets.
How can they connect peer to peer and send data from one phone to another? Is it all accessed in one database that the app connects to everytime that it pulls down?
Someones sends you a snap
your app will ask the database every ...min or when you reload if there's something new to load, and gets it from the database if there is something new
When you sign up for an app like this with a registered account is that information stored on the iphone?
Connect to snapchat
get a snap from someone and wait till you can view it
start airplane mode and see if it loads, if it does there are files (temporarily) stored on your iPhone.
I am looking to create a chat app so that two iphones/mobile can chat with each other.
Can someone please head me in the right direction ?
1. Should I try to connect two devices directly using HTTP or TCP
2. Or should the communication pass through a server i.e. one phone sends the message to the server and server then push the message to other phone ?
If you can tell me any libraries/api that I should use, that would be greatly helpful too.
Or should the communication pass through a server i.e. one phone sends the message to
the server and server then push the message to other phone ?
That's the usual approach. A server with a known address is easy to find; mobile phones that move from one network to another and frequently change their addresses are not. Also, you can keep a server running all the time, so that when one device sends a message, the server receives it and stores it until the other device becomes available. If you were to try to run your chat program on the phones all the time, you'd quickly deplete the batteries.
How do I send and receive network MIDI data in iOS? I am able to resolve the server using bonjour and apply the service to a MIDI connection, but I don't know where to go from there. The documentation seems to be lacking, and there's not much information online.
Essentially, you need to connect to the session via Bonjour as you have done, and within your iOS app:
Create a client using MIDIClientCreate
Create an input port using MIDIInputPortCreate
This takes a pointer to a C function that will be called when MIDI data is received
You need to connect it to the MIDINetworkSession's defaultSession using MIDIPortConnectSource - connect it to the sourceEndpoint
Create an output port using MIDIOutputPortCreate
You can send data to the network session using MIDISend - send the packets to to the MIDINetworkSession defaultSession's destinationEndpoint
I wrote a few blog posts about this a while back, see here for source code etc.
Part 1
Part 2
Part 3
I am developing a chat application where I am using the Ping/Pong protocol between client and server (XEP-0199). I tried to reply with the two methods decribed, the error and the get and didn't succeded till now. I am always getting disconnected by the server for reasons I dont know.
My code is writen in the parseIq() function, when I receive an iq with the next tag "ping", I send the pong, but that is not working.
Please help, thanks