I am developing two apps in swift which should communicate with another iPhone device and waiting for their response over Global.
I am using remote push notification and it's working fine, but its not receiving notification while the app in foreground state and has some push notification related issues.
If I used web service for sending and receiving. My app gets struck due to the lag response
Is any method available for iPhone communication over internet without using APNs?
You can use MultipeerConnectivityFramework, which has support for discovering services provided by nearby iOS devices using infrastructure Wi-Fi networks, peer-to-peer Wi-Fi, and Bluetooth personal area networks and subsequently communicating with those services by sending message-based data, streaming data, and resources (such as files).
I am adding sample code here, it is an example application which builds on the Multipeer Connectivity framework for discovering, connecting, and sharing data between "nearby" peers. This application uses framework based UI for connecting to local peers and the framework convenience API for exhanging text messages and image resources between devices.
Related
How to connect BLE multiple devices at the same time in Swift
I'm working on iOS application project using BLE to transfer some data between them. The concept is one device is the main device that broadcast the data to other devices, then device that get data from bluetooth send data back to the main device.
How to connect multiple devices at the same time using core bluetooth? (1-to-many topology)
Is that possible to send and receive data in the same time?
There are two different roles: peripheral and central.
A peripheral typically has data that is needed by other devices. A central typically uses the information served up by a peripheral to accomplish some task.
The central can discover and connect to multiple peripherals.
See Core Bluetooth Programming Guide for details. Even it is archived, it has the good overview of the feature.
I want to have my application receive notifications without forcing the user to be logged in or authenticated. Thank you for your time!
Well, I'm using OneSignal to send notificaitions to the users of my Android app and it's working fine. Moreover, it uses FCM as its base. So, that shouldn't be a problem too. You can segment users thet way you want and send notifications to one or many - upto you. It's all for free and very easy to set up the basics of it. It's here: OneSignal
You can probably use Socket IO for your case to send messages from one device to another.
There are many good to have Socket IO frameworks which can consider for your requirement
Signal R in Android
SignalR is a new library used to add real-time web functionality to your applications. Signal R uses technology such as
web sockets
Event Source,
forever frame
long polling
Signal R is capable of selecting the best from those four technology depending on your internet connection and your application stability.
Signal R is used in application such as
Chatting application
Stock market application
Real-time gaming
Native Socket.IO
Socket.IO provides an event-oriented API that works across all networks, devices and browsers. Its incredibly robust (works even behind corporate proxies!) and highly performant, which is very suitable for multiplayer games or realtime communication.
I need to communicate my app with 2 devices. A restriction is that I can't use a server but all iOS devices will be in one Wi-Fi network. What options do I have? How I can send a message to another copy of my app running on another device?
I dont know whether its a correct approach or not but as you cannot use server,so the approach i can think of is we can create a socket connection using TCP/IP or UDP(based on reliability) for data exchange.
I dont think you can communicate between 2 devices running the same application without having some kind of server application in-between.
Even if you could find the other device over the WIFI I dont think you can tell if the other device is running the app or not.
I think you may be referring to MultipeerConnectivity
The Multipeer Connectivity framework provides support for discovering
services provided by nearby iOS devices using infrastructure Wi-Fi
networks, peer-to-peer Wi-Fi, and Bluetooth personal area networks and
subsequently communicating with those services by sending
message-based data, streaming data, and resources (such as files).
Source: https://developer.apple.com/library/ios/documentation/MultipeerConnectivity/Reference/MultipeerConnectivityFramework/
Apple Sample:
https://developer.apple.com/library/ios/samplecode/MultipeerGroupChat/Introduction/Intro.html
what should I do in my app to support sending data between two iphones in wifi or bluetooth?
for example I want to send text from one device and receive and open the text in the other device?
You could check out what Bump has to offer:
The Bump API uses the Bump matching
technology to identify another mobile
phone and then creates a messaging
channel between the two handsets. Your
users will be able to establish
connections, exchange data,
authenticate interactions...
Updated:
You could also have a look at Apple's GameKit which offers peer-to-peer connectivity.
How do apps like Apple's "Remote" app control mac applications and send data?
is this via php with exec() commands or some other method? and how would I do it in c?
Also, how fast is this rate of transfer (can I use it to send real-time data like streaming video or audio?)
thanks to anyone who cares to enlighten me on this issue :-)
Apps generally communicate using a TCP/IP based protocol and the wireless LAN connection (the iPhone also has Bluetooth). In the case of the Remote app the communication is via with the Digital Audio Control Protocol. iTunes implements DACP so the Remote app can control it. Other common protocols are HTTP and FTP. There are classes in the iPhone SDK to connect to noth HTTP and FTP servers. There is also the Cocoa HTTP Server project which allows the iPhone to act as a HTTP server.
iPhone apps can also use Bonjour/mDNS/zeroconfig (they're different names for the same technology) so that the user doesn't have to be concerned with configuring IP address'.
The data transfer rate of the wireless connection is faster enough to stream video.
many of these remote applications work by installing client software on the computer and establishing a network connection. In the case of Apple's remote software, the client software is built into the networking capabilities of iTunes. You must authenticate using your iTunes sign in and be on local wifi.
The third party app "intelliremote" works very similarly only has it's own client software to install and can work across a WAN with proper port forwarding enabled on your network.
I haven't encountered any realtime streaming options as most of these utilities are designed to pass control messages and meta-info on media files.