Offline Message - connection

I have been thinking about this for a while. We know some games can be played through hotspots. While playing the games we can even send message. An example is the Doodle army mini militia. I was thinking of building an app where only my friends can send messages at a short distance if they are connected to the hotspot.
I did an experiment today. I set up a hotspot. I connected two phones to the same hotspot with the internet. (three phones. one phone only to open the hotspot. The other two just to connect to the hotspot) So, now I tried to send a message to the other phone through what's app. I sent the message through the second phone to the third phone. The message was successfully sent to the third phone. We knew this would work. It is a very simple process. Now my question is below.
When I disconnected the data connection on the first phone. Remember the hotspot is still on. The only thing is that there is no internet. Now I sent a message again from the second phone to the third phone. This time the message did not go through. I knew the message would not go through. The question is why does there have to be a proper data connection with the internet for the message to go through? Well, there is already a connection where phones have the path to send the message. We also know some games can send messages while connected to hotspots without the internet.

No, your assumption regarding sending of messages through Whatsapp is completely wrong.
When you send a message from one device to another device, the message is first send to Whatsapp Databases. It will be stored there unless the device which you've sent to has got an internet connection (There's a limit for the storage on database, like 1 year or something.)
The thing is that Whatsapp is not connecting devices directly, they are being connected together under Whatsapp , Whatsapp is the Intermediate in the Process of messaging.

Related

Building a simple control panel for an array of Chromecast devices

Background: My company is moving into new offices and we would like to control all of the LCD TVs on our walls (around 50 screens) using Chromecast Ultra devices, such that each will display a different webpage. So that's 50 Chromecasts that will be connected via Ethernet to our local network.
I reviewed the Cast SDK documentation on how to build a custom receiver application, but to my understanding this is for sending a message to a single device every time. I wish to build a simple control panel (can be either a web app or an Android app), where I can select a number of Chromecast devices and send all of them a message (with a URL to load).
Can a message be sent to multiple Chromecast devices at once, without having to send the message to each device manually?
No; using the Cast SDK, you have to send a message to each device manually by establishing a connection to that device and sending your message. Alternatively, your receiver running on your chromecast devices can communicate with your backend server and you can use a PUSH mechanism to send messages to your receivers from your server; that, however, is outside of the Cast SDK.

Send data from an iOS app when connection is restored

I'm creating an app that allows the user to work without internet connection. When he wants to publish his progress to the web server it gets stored in the device's database. If he isn't connected to the internet I have to send it when he gets internet connection back.
How can I run the code to send the data to the database when internet connection is available again?
In Android I used a broadcast receiver to listen for a "connection changed" event to accomplish this but I don't seem to find a way in iOS to do the same.
You could try to check if the device has an active internet connection (3G and/or Wi-Fi for iPhone, Wi-Fi for iPad/iPod Touch), there are many ways to do that but the simplest in my opinion is to use Reachability.
Check this similar question for more informations about Reachability and how to implement it in your project. It can even be used in a if statement so you can make the user able to publish or not depending on his internet connection.

iPhone app development. How does an app like snapchat send data from user to user?

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.

Chat between two iphones

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.

Receive Notification for SMS using iPhone

I have been searching for this on Google for a while and maybe I'm not wording it right because I'm not an expert iPhone developer, but what I'm wondering is if there is some kind of notification or system event that my iPhone application I'm developing can "hook into" that will get raised whenever a text message arrives on my phone. I don't need to be able to read the message. I just need to know when a text message has arrive on my phone. If possible, I'd like to be able to get the phone number of the person sending the message. Is this possible in Objective-C/Cocoa?
No, you can't do this with the public iOS APIs.

Resources