Connect an iOS app to Windows / Linux apps

Background:

I am going to start development on a mobile and desktop application. They will both be connected to a local Wi-Fi network (without an Internet connection) and will need to communicate with each other. Initially, we focus on iOS and Windows as two platforms with the intention of adding support for Linux, OSX and Android in that order. The desktop application will mainly be a database server / notification center for receiving updates from iOS applications and sending data to other iOS applications. There may be a front end in the desktop application, but we could also include it in the iOS application, if necessary.

For now, we just want the iOS application to automatically detect when it is on the same network as the server, and then display the data that is sent by this server (for example, bonjour).

As far as I can see, there are two ways that we could take to implement this

  • Create your own application for each platform (Windows, Linux, OSX). Pro: We like the idea of โ€‹โ€‹having our own applications to increase productivity and ease of installation. Con: I know absolutely nothing about Windows or Linux development.

  • Build an application built using web technologies (possibly python), and create an easy-to-use installer that will create a local server from a desktop machine with which mobile applications can interact. Pro: Most of the development will be cross-platform, and the installer should be light enough for the port. Con: If we want to add an interface server to the server application, it will not be native to the platform and will use the css + html + javascript graphical interface.

Question:

My question is how to implement the connection between the iOS application and the server application in each case.

  • How to receive and send notifications on the local network.

  • How can I connect to the server using NSURLConnection if it does not have a static ip?


Hope this is clear. If not, ask me and I will clarify.

Update 09/06/2013

Hope this clarifies everything. I need to have a desktop application that will manage the database, this application will connect to iOS devices on a local wireless network that is not connected to the Internet. I can do this using the http protocol (preferably using a flash application) or using a direct socket connection between applications and the server. My question is which of these two options is better? My preference would be for a web application using Python + Flask, but I would not know how to connect an iOS application to a flash application running on the local network without a static ip. Any advice on this would be appreciated.

+4
source share
2 answers

Without any application details or frameworks, it's hard to be more than vague and point in the right direction. If you have already learned Bonjour / Zeroconf to connect your iPhone to the server, I would continue to look down this path.

The first thing you need to see PyBonjour for how to translate a server with Python. Although there are a few problems in how to configure this on Windows vs Mac vs Linux, this will be small. For windows, for example, the user would have to install Bonjour for Windows , where, since Linux users would need Avahi, but most of this can be configured by durin to install.

Secondly, check out the Bonjour documentation for iOS , which will be much simpler, since all of it is built into the system and API. From here, both the server and the client are discovered for each other.

The final issue is determining whether you want the iPhone to connect to the server or vice versa, and how to do it. However, these are fundamental network solutions that are more or less subjective.

Since you indicated your preference for web development, you can easily connect your iPhone to the Flask server and retrieve data from the server using HTTP / HTML technologies.

As for notifications, if a change in data by client A means that client B absolutely must know about the change in data, I would not worry. The next time, when client B connects to the server, the correct data can be pushed through this place rather than worrying about notification services. If another client really needs to be aware of the change, the other solution may be just a regular old email that recommends them and prompts them to open the application.

+1
source

I would definitely suggest webapp. The answer to your questions is given below:

How to receive and send notifications on the local network.

Use a REST-based web service to communicate with the server. You must use a survey to obtain data: - (

How can I connect to the server using NSURLConnection if it does not have a static ip?

  • If possible, configure a domain name on your network that points to the server ip. (Configure local DHCP to provide the same IP address to your server each time based on the MAC address!)
  • You have a range of IP addresses, and when the application starts, try accessing a specific URL and checking if it responds.
  • Ask the user to enter the IP address of the server each time the application starts.
0
source

Source: https://habr.com/ru/post/1498625/


All Articles