Hi , I am creating a tcp socket connection that connects my ios device with raspberry pi commanicates via internal wifi without internet connections . I have to implement a bell ring feature when my app stays in background and someone press the bell on raspberry pi device.Kindly suggest how would i do or manage my connection??
Hi , I am creating a tcp socket connection that connects my ios device with raspberry pi commanicates via internal wifi without internet connections . I have to implement a bell ring feature when my app stays in background and someone press the bell on ra
What platform are you targeting? The basic strategy for this is the same for all of our platforms, but there are important differences between them. Specifically, your mention of background execution complicates things a lot if you’re targeting iOS.
My general recommendation is that you configure the service running on your accessory (the Raspberry Pi) to advertise itself via Bonjour [1]. Your app can then discover the service via the
NSNetService class. Once discovered you can create a TCP connection to the service via the
-getInputStream:outputStream: API.
A good place to start here is the WiTap sample code.
ps Please try to use a short summary of your question as your subject. Putting the entire question in the subject just makes everyone’s life harder.
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"[1] Bonjour being the Apple name for the following three technologies:
RFC 6762 Multicast DNS
RFC 6763 DNS-Based Service Discovery
HI,
I am working on IOS app creating tcp connection with no internet connection. If Bonjour service is not integrated in rasberry pi so is there any other alternative we can manage response of tcp sockets in background and handle those responses?
If Bonjour service is not integrated in rasberry pi … ?
Last I checked the Raspberry Pi runs Linux, and most Linux distributions include Bonjour (specifically, the Avahi implementation of those Internet standard protocols).
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"
Thanks a lot for your answer.
Hi all,
sorry for opening again this old topic but I'd like to ask you if there is an effective strategy to keep the app running even in the background when connected to the Rasperry Pi. I need to get events from the Rasperry through a TCP connection and show a local notification when something is happening (a trigger).
Thanks!
[is there] an effective strategy to keep the app running even in the background when connected to the Rasperry Pi.
No. This has become a bit of a FAQ, so I’ve put some general info in post entitled Maintaining a TCP Connection in the Background.
How you should proceed here really depends on your specific scenario. For example, if your accessory integrates with an existing Internet server, you could move the logic for deciding whether an event triggers a notification to that server, and then have the server send the user a push notification. Or if your accessory is typically deployed in the home, you could integrate with HomeKit.
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"
Good day Eskimo,
Thank you for the informative reply.
Sorry for bringing this old topic back up again. I know you got these questions on a regular basis.
We are developing a home entertainment device that is connected to a TV (hardware and software). A feature that we would like to add in our iOS app version -- that controls the entertainment device -- (already included in the Android app version) is for the entertainment device to soft mute when the user gets a phone call.
I have a couple of questions here:
1- Would the bonjour service continue to run when the app is in background. If not, how to approach this from the background modes perspective, especially since, AFAIK, this scenraio does not fall into any of the categories eligible for using background modes.
2- Is using HomeKit an option here ? if so, would you mind explaining that route.
The objective here is to get the entertainment device to respond to phone states whether the app is in foreground or background (of course as long as the user is connected to the home Wifi network).
All the best,