Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Deploy app to AppsStore fail on IPv6


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 18 - Last Post: Jul 24, 2017 12:42 AM Last Post By: Bas Eshuis
Mikael Lenfors

Posts: 99
Registered: 3/6/01
Deploy app to AppsStore fail on IPv6  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 8, 2016 11:45 AM
Hello!

We are trying to deploy our new app (Delphi 10.1 Berlin) to Appstore but are getting rejected because of lack of IPv6 support!?

From Apple: "We discovered one or more bugs in your app when reviewed on iPad and iPhone running iOS 9.3.5 on Wi-Fi connected to an IPv6 network."

The only networking Component we use is a IdTCPClient. We are connecting to our host and sending/receiving data over the link.
In the IdTCPClient we have Id_IPv4 set for IPVersion and it works fine in our testing. If I try to change it to Id_IPv6 it fails to connect on our developement PC!

Any ideas what could cause this Apple reject?

Should we try to connect over both IPv4 and IPv6 in the app?

Best regards, Mikael
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Deploy app to AppsStore fail on IPv6  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 8, 2016 12:41 PM   in response to: Mikael Lenfors in response to: Mikael Lenfors
Mikael wrote:

We are trying to deploy our new app (Delphi 10.1 Berlin) to Appstore
but are getting rejected because of lack of IPv6 support!?

Which version of Delphi are you using? Which version of Indy?

The official release of Indy defaults to IPv4, but various components (including
TIdTCPClient) have an IPVersion property that you can manually set to IPv6
when needed.

In recent Delphi versions, Embarcadero's shipped copy of Indy defaults to
IPv6 on iOS platforms.

The default is specified by the ID_DEFAULT_IP_VERSION constant in the IdGlobal.pas
unit, which is set according to the IdIPv4 and IdIPv6 defines in IdCompilerDefines.inc.

In the IdTCPClient we have Id_IPv4 set for IPVersion

That is the root of your problem. It needs to be set to Id_IPv6 when your
device is connected to an IPv6-only network.

and it works fine in our testing.

You must be testing on an IPv4-capable network.

If I try to change it to Id_IPv6 it fails to connect on our developement
PC!

Then your test network clearly does not support IPv6.

Should we try to connect over both IPv4 and IPv6 in the app?

You can't use IPv4 at all when the device is connected to an IPv6-only
network.

One thing you might try is using Indy's GStack.GetLocalAddressList() method
to see if the device has any IPv4 and/or IPv6 addresses assigned to it, and
then set the IPVersion property to IPv4 or IPv6 accordingly. If any IPv6
address is present, and/or no IPv4 address is present, then use IPv6. Otherwise,
use IPv4.

Or, you could use an {$IFDEF IOS} block to hard-code the IPVersion property
to IPv6 when compiling your code for IOS. But this would only work on networks
that support IPv6, it would fail if a device were connected to an IPv4-only
network.

Apple's requirements are not that your app has to use IPv6 exclusively, only
that your app has to work on an IPv6-only network. iOS still supports IPv4-only
and mixed IPv4/IPv6 networks. The world is still transitioning to IPv6,
so IPv4 is still relevant. Apple also describe how you can setup an IPv6-only
test network on a OSX machine, so you might consider trying that before submitting
your app to Apple again.

--
Remy Lebeau (TeamB)
Mikael Lenfors

Posts: 99
Registered: 3/6/01
Re: Deploy app to AppsStore fail on IPv6  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 8, 2016 10:03 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Ok, thanks for your answer....

What do you Think about my new modified connect procedure below? Would it work?

I'm using Delphi 10.1 Berlin with the Indy that comes with that version.

Best regards, Mikael

Procedure TSocketClientForm.ConnectSocket(Var ErrorMsg: String);
Begin
ErrorMsg := '';
Try
Try
IdTCPClient.IPVersion := Id_IPv6;
IdTCPClient.Port := 50000;
IdTCPClient.Host := Server;
IdTCPClient.Connect;
Except
IdTCPClient.IPVersion := Id_IPv4;
IdTCPClient.Port := 50000;
IdTCPClient.Host := Server;
IdTCPClient.Connect;
End;
Except
On E: Exception Do
Begin
ErrorMsg := 'Connection error! (' + E.Message + ')';

End;
End;

Dave Nottage

Posts: 1,850
Registered: 1/7/00
Re: Deploy app to AppsStore fail on IPv6  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 9, 2016 5:46 PM   in response to: Mikael Lenfors in response to: Mikael Lenfors
Mikael Lenfors wrote:

What do you Think about my new modified connect procedure below? Would it work?

There's a function in IdStack:

function SupportsIPv6: Boolean;

It'd be way better to use that.

--
Dave Nottage [TeamB]
Hints, tips and tricks at: http://www.delphiworlds.com/blog
Mikael Lenfors

Posts: 99
Registered: 3/6/01
Re: Deploy app to AppsStore fail on IPv6  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 10, 2016 12:48 AM   in response to: Dave Nottage in response to: Dave Nottage
Hello!

I changed my Connect procedure as below, but on my developement PC SupportsIPv6 returns True. The problem is my routers at home does not support IPv6 so the connect fails!

If I check my network properties IPV4 and IPV6 are both enabled protocols, is this what SupportsIPv6 returns? Or is it checking if we are actually connected to an IP6 network?

Is there no "Best practise" how to do a socket connection from an IOS application?

Best regards Mikael

Procedure TSocketClientForm.ConnectSocket(Var ErrorMsg: String);
Begin
ErrorMsg := '';
Try
If Gstack.SupportsIPv6 Then
Begin
IdTCPClient.IPVersion := Id_IPv6;
End
Else
Begin
IdTCPClient.IPVersion := Id_IPv4;
End;
IdTCPClient.Port := 50000;
IdTCPClient.Host := Server;
IdTCPClient.Connect;
Except
On E: Exception Do
Begin
ErrorMsg := 'Connectionerror! (' + E.Message + ')';
End;
End;
End;

Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Deploy app to AppsStore fail on IPv6  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 12, 2016 11:15 AM   in response to: Mikael Lenfors in response to: Mikael Lenfors
Mikael wrote:

I changed my Connect procedure as below, but on my developement PC
SupportsIPv6 returns True.

As it should be, because most modern OSes support IPv6.

If I check my network properties IPV4 and IPV6 are both enabled
protocols, is this what SupportsIPv6 returns?

Basically, yes.

Or is it checking if we are actually connected to an IP6 network?

No.

Is there no "Best practise" how to do a socket connection from an IOS
application?

The "best practice" is to use Apple's own higher level socket API, and let
iOS handle the IPv4/IPv6 details for you. But that is not what Indy does.
Since Delphi is a "native" platform, Indy operates at the native layer that
is below iOS, accessing BSD socket APIs directly. That means more manual
work on native applications to get things right.

--
Remy Lebeau (TeamB)
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Deploy app to AppsStore fail on IPv6  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 12, 2016 11:10 AM   in response to: Dave Nottage in response to: Dave Nottage
Dave wrote:

There's a function in IdStack:

function SupportsIPv6: Boolean;

It'd be way better to use that.

That method indicates whether the underlying OS can create IPv6 sockets.
It does not indicate whether the device is connected to an IPv6 network.

--
Remy Lebeau (TeamB)
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Deploy app to AppsStore fail on IPv6  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 12, 2016 11:36 AM   in response to: Mikael Lenfors in response to: Mikael Lenfors
Mikael wrote:

What do you Think about my new modified connect procedure below?
Would it work?

I would try something more like this instead:

uses
  ..., IdIPAddress, IdStack;
 
procedure TSocketClientForm.ConnectSocket(Var ErrorMsg: String);
var
  IPAddr: TIdIPAddress;
begin
  ErrorMsg := '';
  try
    IPAddr := TIdIPAddress.MakeAddressObject(Server);
    if IPAddr <> nil then
    begin
      // Server is an IP address, use as-is...
      IdTCPClient.Host := Server;
      IdTCPClient.IPVersion := IPAddr.AddrType;
      IPAddr.Free;
    end else
    begin
      // Server is a hostname, resolve it...
      try
        IdTCPClient.Host := GStack.HostByName(Server, Id_IPv6);
        IdTCPClient.IPVersion := Id_IPv6;
      except
        IdTCPClient.Host := GStack.HostByName(Server, Id_IPv4);
        IdTCPClient.IPVersion := Id_IPv4;
      end;
    end;
    IdTCPClient.Port := 50000;
    IdTCPClient.Connect;
  except
    on E: Exception do
    begin
      ErrorMsg := 'Connection error! (' + E.Message + ')';
    end;
  end;
end;


--
Remy Lebeau (TeamB)
Mikael Lenfors

Posts: 99
Registered: 3/6/01
Re: Deploy app to AppsStore fail on IPv6  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 12, 2016 12:51 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Hello!

Thanks a lot for your example!

Just one thing, I don't have a GStack.HostByName function!? The closest I get is a GStack.HostByAddress....
Do I need a later Indy release? I'm using the default one shipped with Berlin.

Best regards Mikael
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Deploy app to AppsStore fail on IPv6  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 12, 2016 12:58 PM   in response to: Mikael Lenfors in response to: Mikael Lenfors
Mikael wrote:

Just one thing, I don't have a GStack.HostByName function!?

My bad. HostByName() is protected, you need to use the public ResolveHost()
method instead:

try
  IdTCPClient.Host := GStack.ResolveHost(Server, Id_IPv6);
  IdTCPClient.IPVersion := Id_IPv6;
except
  IdTCPClient.Host := GStack.ResolveHost(Server, Id_IPv4);
  IdTCPClient.IPVersion := Id_IPv4;
end;


--
Remy Lebeau (TeamB)
Mikael Lenfors

Posts: 99
Registered: 3/6/01
Re: Deploy app to AppsStore fail on IPv6  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 12, 2016 9:56 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Ok, thanks. I'll try to deploy it on AppStore again.
I'll get back with the result.

MIkael
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Deploy app to AppsStore fail on IPv6  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 13, 2016 8:43 AM   in response to: Mikael Lenfors in response to: Mikael Lenfors
Mikael wrote:

Ok, thanks. I'll try to deploy it on AppStore again. I'll
get back with the result.

Did you run a IPv6-only test first? Like I said, Apple provides instructions
on how to setup an IPv6-only network for testing.

--
Remy Lebeau (TeamB)
Mikael Lenfors

Posts: 99
Registered: 3/6/01
Re: Deploy app to AppsStore fail on IPv6  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 23, 2016 2:55 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Didn't help. Apple still kicked me out on their IPv6 test.

But they also kicked me out because the app was not ment for the public but more like an "company app".
So I vill try to deploy it with an enterprise account instead so there will be no more deployments on appstore for this app.

Best regards, Mikael
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Deploy app to AppsStore fail on IPv6  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 23, 2016 12:17 PM   in response to: Mikael Lenfors in response to: Mikael Lenfors
Mikael wrote:

Didn't help. Apple still kicked me out on their IPv6 test.

But did they say why?

--
Remy Lebeau (TeamB)
Dave Nottage

Posts: 1,850
Registered: 1/7/00
Re: Deploy app to AppsStore fail on IPv6  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 24, 2016 1:14 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:

Didn't help. Apple still kicked me out on their IPv6 test.

But did they say why?

Being kicked out on the IPv6 test means that it didn't work on an IPv6 only network. I'm about to start diagnosing the
issue because I have a setup to test. I'll post again when I've discovered what the problem is.

--
Dave Nottage [TeamB]
Hints, tips and tricks at: http://www.delphiworlds.com/blog
Laurence LAJOU

Posts: 2
Registered: 8/30/14
Re: Deploy app to AppsStore fail on IPv6  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 4, 2017 7:35 AM   in response to: Dave Nottage in response to: Dave Nottage
Dave Nottage wrote:
Being kicked out on the IPv6 test means that it didn't work on an IPv6 only network. I'm about to start diagnosing the
issue because I have a setup to test. I'll post again when I've discovered what the problem is.

Hello

I have the same problem with my app, but with IdFTP component.
I have tried your solution but my app is rejected again.
Somebody have a solution ?
Bas Eshuis

Posts: 3
Registered: 11/14/07
Re: Deploy app to AppsStore fail on IPv6  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 4, 2017 9:03 AM   in response to: Mikael Lenfors in response to: Mikael Lenfors
Hello,

I managed to solve this a few weeks ago. And our app 'Octyx' passed the Apple IPV6 test.

How:
* Did a simple check in Delphi as I did before to check internet connection. But added ipv6 check on top. See code below.
* Created an Ipv6 network on our mac to test. There are standard Apple docs how to do this.
* And tested it for both IPv4 and 6.

Et voilĂ , and my app passed the tests. I did a further check to see in my app which kind of network was connected.

Kind regards,

Sebastiaan Eshuis
Belgium

function Tfm1000.Check_Internet_Connection(Sender: TObject) : boolean;
var
myversion : idglobal.TIdIPVersion;
begin
try
myversion := Id_IPV6;
IdTCPClient1.IPVersion := myversion;
IdTCPClient1.ReadTimeout := 30000;
IdTCPClient1.ConnectTimeout := 10000;
IdTCPClient1.Port:=80;
IdTCPClient1.Host:= 'www.google.com';
IdTCPClient1.Connect;
IdTCPClient1.Disconnect;
vgs_IP := 'IPv6';
result:=true;
except
try
myversion := Id_IPV4;
IdTCPClient1.IPVersion := myversion;
IdTCPClient1.ReadTimeout := 30000;
IdTCPClient1.ConnectTimeout := 10000;
IdTCPClient1.Port:=80;
IdTCPClient1.Host:= 'www.google.com';
IdTCPClient1.Connect;
IdTCPClient1.Disconnect;
vgs_IP := 'IPv4';
result:=true;
except;
vgs_IP := '-';
result:=false;
end;
end;
end;

Laurence LAJOU

Posts: 2
Registered: 8/30/14
Re: Deploy app to AppsStore fail on IPv6  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 24, 2017 12:34 AM   in response to: Bas Eshuis in response to: Bas Eshuis
Thank you Bas Eshuis, my app passed the tests.
Bas Eshuis

Posts: 3
Registered: 11/14/07
Re: Deploy app to AppsStore fail on IPv6  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 24, 2017 12:42 AM   in response to: Laurence LAJOU in response to: Laurence LAJOU
Laurence LAJOU wrote:
Thank you Bas Eshuis, my app passed the tests.

With pleasure. Glad I could help.

Kind regards,

Bas Eshuis
Belgium
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02