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.
Related
We are new to iOS apple development and iOS network extension but we do have general application development experience. We are wondering if there is a starter code available which we could utilize for our project.
We are looking for a virtual network interface in iOS so could monitor network traffic. Our goal is to monitor DHCP broadcast,m-DNS, DNS traffic.
If there are other methods, we would love to know.
There are different ways you can intercept DNS traffic in NE. However, if you are only interested in capturing DNS traffic, DNS Proxy Provider would your best option. Although, DNS Proxy Provider has limitation that it is only supported on managed devices.
Few discussions that would help:
https://developer.apple.com/forums/thread/81103?answerId=246229022
https://developer.apple.com/forums/thread/665480
How to use NEDNSProxyProvider in iOS 11
Few samples on GitHub:
https://github.com/pusateri/DNS-TLS
https://github.com/GroupeMINASTE/FMobile-iOS
You can search for NEDNSProxyProvider in developer forums to find quite a few discussions about it. This discussion also provides some good details. Also, this one.
You may also use Packet Tunnel Provider with match domains or empty match domains and full tunnel. This will allow you to support NE without MDM.
Few examples of Packet Tunnel Providers:
https://github.com/douxinchun/RabbitVpnDemo
https://github.com/OperatorFoundation/PacketTunnelExample
https://github.com/davlxd/NEPacketTunnelVPNDemo
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
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.
I want to scan for all devices in the local network. Then I want to further check if the discovered devices respond on a specific port, say #4000 for example. All that should happen on an iPad preferably using Swift (version 3).
Should I use a library for that job?
This document didn't help me and sadly I cannot find useful information on the internet.
Edit: I want to know how can you implement this in Swift/iOS libraries. Are there any examples, libraries, core classes where I should start?
I think I may know what you are trying to ask. Your device sees the router, but doesn't know who is connected.
Read about multicast IP and broadcast IP, which is usually the highest IP address in your subnet.
Example: 192.168.1.255
As example, you make all devices listen on broadcast/multicast IP. To discover, you send a UDP message to that IP. Your router, if not configured otherwise, will forward that to the other devices.
This message can be something like "I am Mr. John, Reply to me at this Port".
That is the general idea
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.