routing the network over ipv4 instead of ipv6 in iOS - ios

I am using the 3rd party library which only support ipv4.
Whenever there is ipv6 network in my iOs device 3rd party fail.Is there any way I can force or convert or create ipv4 network and do routineg of the application in ipv4 instead of ipv6.
I found the below link but don't know how to implement it or does apple will approve that. https://developer.apple.com/documentation/networkextension/neipv4route
Any help on this please

I think you’ve answered your own question. The library your using only supports ipv4. So either you need to find a library that supports ipv6 or write your own since you can’t control what the network is broadcasting.
Apple has a write up on this here : supporting ipv6

Related

Objective-C - itune app store rejected my app after review, main reason is IPv4 needs to be IPv6?

I have WebRTC framework for my iOS app.
But Apple iTune app store review team, rejected my app (even though it was working in my local hardware's, cost me 6 months of work). After waiting so long, they rejected, because its IPv4, has to be IPv6?
I cant simply change the whole WebRTC Framework that i have used in my app.
My target clients are only IPv4 (not IPv6, i am not even interested to use IPv6), is there no way to solve it? I am using this framework: https://cocoapods.org/pods/libjingle_peerconnection
Any advise/suggestion, has anyone tried the libjingle_peerconnection library to make compatible for IPv6?
EDIT: at 3.56AM
You need to add more details in your question to get an appropriate and correct answer.
My reason for putting an answer is not to answer your question as we need further information. My goal to answer is to make everyone aware how IPv6 functionality can be enabled when developing an Webrtc app.
Server side
Generally speaking primarily there are two main backend components the Webrtc clients connect to:
Signaling server : This is used to carry signaling information such as your sdp between Webrtc endpoints. Can be implemented using web sockets or http or other mechanisms
Stun and a relay/turn server: for obvious Udp hole punching through NAT traversal and if p2p not possible, to act as a relay between endpoints.
For IPv6 both of these servers should support IPv6 connections to it.
Client side
When apple tests IPv6, it must be disabling IPv4 network interface so that the iOS networking stack is forced to use IPv6. Hence you need to enable Webrtc stack to use IPv6 interface. This can be done by adding the constraint googIPv6 : true in the createpeerconnection constraints.
Other than this if you are using any other app servers in your code, you will have to make sure they accept v6 connections.

MultiPath TCP in iOS

How can I implement Multipath TCP in iOS.
I hope as per the MultiPath Apple documentation we do not need to enable MPTCP in iPhone.
Is there any Multipath TCP samples for iOS
You should not need to enable MPTCP on the phone. MPTCP is already in use by iOS applications, e.g., Siri.
What the document you linked to is referring to is enabling MPTCP on your network. MPTCP uses TCP option 30. Many firewalls will not pass unknown TCP options. In order for your iOS app to use MPTCP, tcp option 30 needs to make it unmolested through the network to your server.
Further, your server must support MPTCP for the phone to negotiate an MPTCP connection.
This paper on a socket API for MPTCP has a code sample for using MPTCP on iOS and provides links to opensource code released by Apple that contain examples of using the API.
Multipath TCP is now open for any app in iOS11 beta. See http://www.tessares.net/highlights-from-advances-in-networking-part-1/ for a summary of the announcements at WWDC17. Apple does not expose the socket API mentioned in the previous post.

Supporting IPv6-only Networks what things should be taken care?

Regarding apple's announcement regarding iPv6 -only networks, i have some queries.
https://developer.apple.com/news/?id=05042016a
1) What will happen if my apps are already uploaded without ipv6 support ?
2) I am using old Reachability class, will it create any issue?
3) I am using ASIHTTP library which is using NSURLConnection.
4) If i am not using any static iP in my code but my server is on iPV4 support then will it be create any trouble ?
Thanks
1) Already Uploaded apps are working fine, actually i have not used any static ip addresses in my app.
2) Make sure in old reachability class, you have not used any addresses like 0.0.0.0.
3)It won't create any problem.
4) Not any relation with server.So server may be iPv6 or iPv4, it won't affect your app.

IPv6 Apple updates

With the recent announcements by Apple regarding Supporting IPv6-only Networks. I have few queries:
1) I have code which uses NSURLConnection all over the place and I think it comes under CFNetwork APIs.
Do I need to update my code to NSURLSession mandatorily as mentioned on their website: https://developer.apple.com/news/?id=05042016a
2) IPv4-specific APIs or hard-coded IP addresses:
What does IPv4 specific APIs are there ? I dont see good documentation on Apple website about this. If anyone has any insights on this and can help me out it would be really helpful.
NSURLConnection is fine (see https://developer.apple.com/library/mac/documentation/NetworkingInternetWeb/Conceptual/NetworkingOverview/UnderstandingandPreparingfortheIPv6Transition/UnderstandingandPreparingfortheIPv6Transition.html#//apple_ref/doc/uid/TP40010220-CH213-SW21)
Apple lets you use BSD sockets directly, and it would be possible to implement code based on that which doesn't cope with IPv6. Hardcoded IPv4 addresses "123.123.123.123" won't resolve over IPv6, you should always be looking up IP addresses "www.stackoverflow.com"
In fact, it's probably a good idea to read the whole of the doc I linked to above. Amongst other things, it includes details of how to test IPv6 compatibility by sharing your regular internet connection using a El Capitan Mac as an simulated IPv6 access point.

iPv6 support for Application (objective-c)

Apple has mentioned in their document to eliminate some API for iPV6 support.
We are using below API in our application.
inet_ntoa()
inet_aton()
Is there any other API instead of above API for support both IPv4 & IPv6?
inet_ntoa(3N) interprets an IPv4 internet address and converts it to a character string.
instead of inetntoa function i used inet_ntop(3N) function.
This function perform the same operation for both IPv4 and IPv6 addresses
below link helped me lot to support iPv6 for my app.
http://uw714doc.sco.com/en/SDK_netapi/sockC.PortIPv4appIPv6.html

Resources