Apprtc not working in public network iOS - ios

I am using Apprtc library for the real-time connection.
this is my server host URL #"https://appr.tc". Connection successfully established to any network, but in the audio/video sense
audio/video only works on same/private network iOS to iOS or iOS to Android
in public network audio/video only work in iOS to Android , Not working iOS
device to iOS device .
do you have any idea ?

TL;DR You need to bring up a TURN server, and configure the client with the addresses of your TURN server.
WebRTC attempts to connect two peers directly, but that's not always possible in all network configurations (e.g. when both sides are behind a NAT or a Firewall). In these cases, WebRTC will fallback to using a TURN server. It's basically a server that both peers can connect to, and it forwards packets from one to the other.

Related

How can I know if my app is communicating via VPN?

I am trying to create a flutter+swift app for iOS which could determine if there is an active VPN connection and which could determine if my app is communicating via VPN.
Currently, I am trying to check in my app, if there is any network interface like these (if there is, that would mean the VPN connection is active):
tap, tun, ppp, ipsec, ipsec0, utun1, utun2, pptp
Unfortunately, this doesn't work well. On some iOS devices, I see that there is an existing "ipsec" interface, but there is actually no VPN connection. And on some other devices, I see it working correctly (mostly iOS14+).
I read about it, and it seems that "ipsec" interface is often used for handling WiFi calls and to communicate between Apple devices. Is this right? Does it mean that it's not determinable if this interface will be set (because it can be controlled by the network provider or by the Apple ecosystem)?
I am also wondering if there is a reliable way to tell if the device has an active VPN connection, or at least tell if the given app is using a per-app VPN at the moment?
I think we should just check for tun, ppp, pptp for vpn connections. ipsec and others can be used in WebRTC for video and voice calls.
Future<bool> isVpnActive() async {
bool isVpnActive;
List<NetworkInterface> interfaces = await NetworkInterface.list(
includeLoopback: false, type: InternetAddressType.any);
interfaces.isNotEmpty
? isVpnActive = interfaces.any((interface) =>
interface.name.contains("tun") ||
interface.name.contains("ppp") ||
interface.name.contains("pptp"))
: isVpnActive = false;
return isVpnActive;
}

Linphone iPhone TCP/UDP not receiving incoming calls

I am using Linphone Coe 3.10.2 SDK. Server supports TCP and UDP. When TCP is enabled, I cannot call or receive calls at all, it does nothing. When I switch my phone to UDP, every time it says that User is busy, my screen goes to IncomingCallView for one second before connection is broken and it says "User is busy". On Android, it is working normally. And yes, I am not talking about background modes, we have implemented VOIP push services for iOS 10.
I recently have the same problem. All you need to do is set the corret codec. Ask your sip provider what codecs you should

OBD 2 iOS wifi swift communication

I want to create an iOS app to connect my Wifi OBD 2 to the iPhone. But i have no idea on how to do the peer connection with swift 2. I have the OBD doc to communicate with it (https://www.elmelectronics.com/wp-content/uploads/2016/07/ELM327DS.pdf - page 30).
I tried to search the same thing on android and windows but the problem is my knowledge on peer to peer iOS communication.
I see a lot of iOS app for OBD protocol on app store, I'm sure that anybody can help me !
Thank you !
You don't need to know about real wifi peer2peer communication. Once you attached your phone to the wifi network created by the obd2 wifi adapter, you will be able to establish a good old TCP-connection to it. By default most wifi adapters listen at 192.168.0.10:35000 for incoming connections.
After establishing the TCP connection you can communicate via AT and PIDs by writing/reading to/from the socket. The actual protocol is described in ELM327 manual and the ISO/SAE standard documents.

Is it possible to build socket connection between 2 iOS devices

Is it possible to build a socket connection between 2 iOS devices connected to the same network (Without net)?
if it's possible .. Is (CocoaAsyncSocket project) useful for me?
I just want to send a message from Device A to Device B which put the app in background .. when Device B receive the message should show notification to return the app to foreground.
It's not for the App Store, so I don't care if Apple would reject the app because of this behavior.
Yes, you can do it, and yes, CocoaAsyncSocket would be useful. If you don't have to worry about the carrier network's firewalls and filters, then you should certainly be able to build a client-server app running on two iOS devices. One opens the server socket to listen, and the other one (the client) connects, via the Wi-Fi network.
Trying searching on Google (e.g. "CocoaAsyncSocket iPhone iOS site:stackoverflow.com") or directly here on Stack Overflow.
Here's somebody who seems to have accomplished this
Another link
And a post from Robbie Hanson himself, referring you to the EchoServer projects in the github repository
EchoServer project
You may have to use a static IP address for the server device (I'm not sure how much control you have over the Wi-Fi network's configuration), or use some other mechanism for letting the two devices discover each other.

Force iOS device app to talk through the local WIFI network

I'm building an application that will run in a museum with a local area wifi network without internet access, for some strange reason I'm not able to fully "join" this network with an iOS device. Enabling internet access on this network solves the problem...
The network should provide only a web server and a DNS server, the access point has a DHCP server, android devices can connect to the network without problems.
When I try to join the network with the device it remains in a "spinning wheel" status, the DHCP server log on the debian server says it has assigned an address to the iOS device, and if I check for the wifi address with an application (like iSys o SBSettings) I see the WIFI DHCP assigned address.
But when my app (or safari) tries to connect to the web server the request is routed through the 3G connection and not completed.
In my app I'm using the standard "Reachability" framework from Apple to check the reachability of a provided host name through the wifi connection and I get 0 on the SCNetworkReachabilityFlags mask....
I'm quite sure the problem is due to the fact iOS (5.1 in my case) tries to check the reachability for some "standard" host in the network, before routing traffic through the WIFI connection.
Anyone knows what an iOS device do to "validate" a WIFI network? I can add hostnames or simple dummy services to the server machine if this can help me connect the device to a LOCAL-only network :)
It seems that iOS doesn't like to join networks without a gateway, also if the network is local you have to setup a correct gateway address.
Setting the gateway as the server itself did the trick and the device started to route TCP/IP over my local area wifi network.

Resources