Supporting IPv6-only Networks

@yaoqiang_cc not, websocket should be updated too. I think @dbest10 already updated websocets, and we didn’t update websockets since v3.11.1.

Edit: about websockets issue, you can trace the issue. And we created an issue in websockets official repo. I think currently, you can modify as you did.

I’ve tried the update, no more compiling error but the network still doesn’t work

@x10ng what did you mean network doesn’t work? Is there any error message or the same as before error message? But @yaoqiang_cc tried and could work.

There’s no error message or anything, just timed out.
Before, I was trying to connect to the game server through hardcoded IPv4, but I changed it to a domain that goes to the same IP as before, just as Apple suggested not to use hardcoded IP.

Did you test it yourself locally?

Before I submit again, I would like to check, did someone succeed with a new iOS App Store submission?

I submitted more than 3 times to the store … still got the same rejection message . I have sdkbox ( review , adColony , IAP , facebook , sdkboxPlay) implemented and i have updated with the 3rd party libraries (Curl Websockets) . I think I m just going to wait for version 3.12+

I’m sorry, it was my mistake after all. The library works fine, but I haven’t tried to submit to apple yet.

We certainly need a fix for this else cocos2dx is no longer cross platform

Hi, i been uploaded more than 5x to appstore since july but its always rejected, i already even updated my xcode using this http://blog.cocos2d-x.org/2016/05/ipv6-only-networks-now-supported/ but its still rejected, i only add apns push notification to the app and it working perfectly in development certificate. the problem is the same everytime its jectected. need a help. thanks

my code sending a token to server:
AppController.mm

  • (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData )deviceToken {
    NSString
    devToken = [NSString stringWithFormat:@"%@", deviceToken];
    devToken =[[devToken componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]componentsJoinedByString:@""];
    devToken= [devToken stringByReplacingOccurrencesOfString:@"<" withString:@""];
    devToken= [devToken stringByReplacingOccurrencesOfString:@">" withString:@""];
    [[NSUserDefaults standardUserDefaults] setObject:devToken forKey:@“devToken”];
    [[NSUserDefaults standardUserDefaults] synchronize];

    NSString *devID =[[UIDevice currentDevice] uniqueIdentifier];
    NSString *devOS =@"::iOS";
    devToken=[NSString stringWithFormat:@"%@%@%@%@", devToken,@"::",devID,devOS];
    NSLog(devToken);

    NSString *post = [NSString stringWithFormat:@“RegInfos=%@”,devToken ];
    NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
    NSString *postLength = [NSString stringWithFormat:@"%lu", (unsigned long)[post length]];
    NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@“http://m.sample.com/api/pntoken”]];
    [request setHTTPMethod:@“POST”];
    [request setValue:postLength forHTTPHeaderField:@“Content-Length”];
    [request setHTTPBody:postData];

    NSURLConnection *theConnection = [NSURLConnection connectionWithRequest:request delegate:self];
    }

Appstore rejection explanation:

Aug 11, 2016 at 10:18 AM
From Apple
2. 1 PERFORMANCE: APP COMPLETENESS
Performance - 2.1

We were unable to review your app as it crashed on launch. We have attached detailed crash logs to help troubleshoot this issue.

Next Steps

Please revise your app and test it on a device while connected to an IPv6 network (all apps must support IPv6) to ensure it will launch without crashing.

Resources

For additional information about supporting IPv6 Networks, please refer to Supporting IPv6 DNS64/NAT64 Networks and Supporting IPv6-only Networks.

For a networking overview, please see About Networking.

For information on how to symbolicate and read a crash log, please see Tech Note TN2151 Understanding and Analyzing iPhone OS Application Crash Reports.

If you have difficulty reproducing this issue, please try testing the workflow described in Testing Workflow with Xcode’s Archive feature.

If you have code-level questions after utilizing the above resources, you may wish to consult with Apple Developer Technical Support. When the DTS engineer follows up with you, please be ready to provide:

  • complete details of your rejection issue(s)
  • screenshots
  • steps to reproduce the issue(s)
  • symbolicated crash logs - if your issue results in a crash log

@definemc i think you should first find out where it causes crash.

This is the same error for so many of us now. Can you look in to this as a fix for all those impacted?

@dbest10 i would like to do some help, but i can not reproduce it in my local environment. And i don’t know what’s the issue:

  • somebody said it is rejected by network module(CURL or libwebsockets), but i tested as Apple documentation, it can work with IPV6-only network
  • somebody said it is caused by crash, and from the crash as @definemc mentioned, it just uses iOS network module(NSURLConnection), it is not about cocos2d-x.

About CURL, i have updated it to v7.50.0, it fixed the error that connect to ipv4 numerical IP address in NAT64 environment.

About libwebsockets error websocket receive package size > 1023 error is fixed in this github issue.

So i don’t know what other error caused by the network module. I haven’t met crash error.

The crash is not caused by network , I submitted to Apple and it was accepted today . I disabled Sdkbox play (game center) that was what was causing the crash . The other thing , to get where the crash is happening , change the scheme when you run the app for testing to Release mode , that way you can get what’s really causing the app to crash . Hope that helps

Thanks. So it is SDKBOX play. :frowning:

I am also using sdkbox (AdMob, GameCenter, Iap) and Apple rejected my app with this message:
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.

Specifically, your In-App Purchase to remove ads did not work.

The steps to reproduce are:

  • Launch app from Home screen
  • Start gameplay
  • Tap remove ads option
  • No action occurs

IAP button is entirely from sdkbox so is the skdbox at fault here?

not necessarily , it could be something else in your code . Try debugging it by change the scheme to release , that way you can catch errors that only occurring in release version rather than in the development version .

I solved my problem by just removing the iap button and the Apple team accept my app. Here is the link to both app store.
Android: https://play.google.com/store/apps/details?id=com.nbdStudio.Antimatter
Ios: https://play.google.com/store/apps/details?id=com.nbdStudio.Antimatter

@zhangxm Hi, my game runs with cocos2d-x v3.6 . Is it possible to get the IPv6 support? I tried to replace the curl and websockets folders with the latest version of cocos2d-x v3.13.1. But i got a lot of errors in WebSocket.cpp /.h. So i replaced the latest Version of WebSocket.cpp /.h and got more errors in FileUtils and StringUtils. So i replaced them to the latest versions. Now the compiler breaks at this point and i have no idea how to go on:

[armeabi] Compile++ thumb: cocostudio_static <= WidgetReader.cpp
[armeabi] Compile++ thumb: cocostudio_static <= FlatBuffersSerialize.cpp
[armeabi] Compile++ thumb: cocostudio_static <= WidgetCallBackHandlerProtocol.cpp
[armeabi] Compile++ thumb: cocostudio_static <= CCObjectExtensionData.cpp
[armeabi] Compile++ thumb: cocostudio_static <= CocoStudio.cpp
make: *** No rule to make target …/GameProject/proj.android/…/cocos2d/extensions/assets-manager/Downloader.cpp’, needed by obj/local/armeabi/objs-debug/cocos_extension_static/assets-manager/Downloader.o’. Stop.
make: *** Waiting for unfinished jobs…
make: Leaving directory `…/GameProject/proj.android’
Ndk build failed!
Traceback (most recent call last):
File “./build_native.py”, line 43, in
build(opts.build_mode)
File “./build_native.py”, line 28, in build
raise Exception(“Build dynamic library for project [ " + app_android_root + " ] fails!”)
Exception: Build dynamic library for project [ …/GameProject/proj.android/…/ ] fails!

@s1gh7 yep, it is possible. I think you just need to update CURL and fix compiling error caused by it because CURL itself breaks compatibility. I don’t think it is a good idea to update websockets folder.

1 Like