Is it possible to mark more than one socket to keep them open in background in an iphone voip app?
According to Apple's documentation, only one socket should be configured for VoIP usage. You are free to configure multiple sockets for VoIP usage, but only one socket will be managed by the operating system when your application is suspended.
Related
I am wondering about an iPhone application called Call Recorder - IntCall.
Can anybody explain how a number can be dialed via an application without using the device numberpad and cellular network? What API provides this service? I have seen many third-party click to call services, but is there an API available for mobile apps on iOS or Android?
You can't make calls on the cellular network, only the default dialer app can do this.
The app in your link is a VoIP app and uses its own VoIP client to record the conversation.
We are the developers of this app. As rckoenes said, it's a VoIP app and uses a VoIP library and our VoIP server to implement the recording.
There are a few VoIP libraries, some free, but we have purchased a library (expensive).
In general VoIP is not that easy to implement. You need to understand the protocol and you need to have a server that supports what your apps need to do.
My online app runs on iPhone-3GS iOS 4.3, use NSStream to communicate with server.
When I minimize the app, lock phone, and relaunch my app the streams will end.
So my app loses connection to server.
Anyone knows how to keep the connection after locking phone? Is it a feature of iOS multitask?
This is a feature of iOS. Networking connections of backgrounded apps are cut off. You need to request "VoIP" treatment: for this, you need to set the "voip" value for the Info.plist key UIBackgroundModes and then mark your socket as being a VoIP socket setting the kCFStreamNetworkServiceType of your socket to kCFStreamNetworkServiceTypeVoIP using CFReadStreamSetProperty.
See also the Apple iOS App Programming Guide, section Tips for Developing a VoIP App.
I'm updating one voip application and one of my issue is supporting multitasking.
I don't know how I should manage multitasking. Specially I need define connection as VoIP, to receiving incoming call when app is in background, but I don't know how do that.
I searched and found This tutorial and a lot of other pages, but I could not found how those work.
Is any one able to explain me it?
Apple only allows you to set up a TCP connection that you can handle with a CFNetworkStream. You need to bind the socket to a CFNetworkStream and then set the handler to the kCFNetworkStream value that enables VoIP. You'll need to support TCP to handle the socket as Apple doesn't support backgrounding over UDP. The documentation provided by Apple is quite clear on what you can do.
I would like to be able to discover other iOS devices over Bluetooth while my application is in the background. Is it possible to use Bonjour or Game Kit to do this discovery while my application is not in the foreground?
Would it be possible to do this and fire off a notification if a compatible device is discovered?
Also, would I be able to run in the background while playing audio and do this detection?
This is not possible while your application is suspended. From the iOS Application Programming Guide:
Cancel any Bonjour-related services before being suspended. When your
application moves to the background,
and before it is suspended, it should
unregister from Bonjour and close
listening sockets associated with any
network services. A suspended
application cannot respond to incoming
service requests anyway. Closing out
those services prevents them from
appearing to be available when they
actually are not. If you do not close
out Bonjour services yourself, the
system closes out those services
automatically when your application is
suspended.
Be prepared to handle connection failures in your network-based
sockets. The system may tear down
socket connections while your
application is suspended for any
number of reasons. As long as your
socket-based code is prepared for
other types of network failures, such
as a lost signal or network
transition, this should not lead to
any unusual problems. When your
application resumes, if it encounters
a failure upon using a socket, simply
reestablish the connection.
However, if your application is streaming audio, it would be necessary for it to maintain network connections, so you should be able to do Bonjour discovery while in the background for an application continuously playing audio. Make sure you don't abuse this by playing a silent audio clip in a loop just so that you can stay in the background, or your application will be rejected.
Is interprocess communication relevant on the iPhone or iPad? Because there's NSPipe available...
The stock iOS sandbox does not allow an app to start another process or communicate with any other process on the device directly (except using a public API).
You might be able to use pipes for communication between threads within an apps single process space.
Not for the current iPad (which I'm typing this on), but iOS4 supports multi-tasking so presumably it is more relevant there?