App rejected for IPv6 network problem using Unity IAP service on Unity 5.4 iOS
As the question says - I'm using Unity 5.4 and the inbuilt IAP service for iOS ... but the binary has been rejected by iTunesConnect citing failure to work on an IPv6 network... From the other questions i've seen it seems to suggest that this was fixed by unity on 5.3.4 ... so.. confused as to why i'm getting this now. Anybody got any clues? Thanks
Answer by micktravels · Feb 24, 2017 at 07:46 PM
I just had my app rejected from the App Store for the same reason. I am using the latest Unity x5.5.1. I doubt it has anything to do with IPv6 specifically since Apple told me they didn't even try to test it on IPv4. Rather I think it's just a glitch with Unity's Purchasing agent that can happen to anyone at any time.
If you borrowed the sample Purchaser script from the Unity tutorial like I did, you will notice that there is no provision for an initialization failure. If OnInitializedFailed() is called, all it does is print a Debug.Log statement. Then that's it. The store is dead if you try to access it.
Instead of inadvertently giving up like that, I had the OnInitializedFailed() method call InitializePurchasing() again a few more times. Specifically I setup a watchdog counter and incremented:
public void OnInitializeFailed(InitializationFailureReason error)
{
// Purchasing set-up has not succeeded. Check error for reason. Consider sharing this reason with the user.
if (initFailWatchdog++ < 100) InitializePurchasing();
else Debug.Log("Tried 100 times to initialize IAP store without success.");
}
I don't know if 100 is the right number, maybe 10 would work. Maybe you could try every second forever instead of a fixed amount of times.
There's more to be done to make this solution robust (for example: what happens if there's no network connection, or the user turns on his network after all those initialization attempts), but it got me past the App Store approval.
Rejected from the same reason. I'm also using Purchaser script. Thanks for the solution. (It could be improved to be tried every X seconds, forever)
Thank you @micktravels I had the exact same problem and I implemented to retry every 0.2 seconds and it worked.
Answer by erika_d · Sep 02, 2016 at 01:41 AM
@Triggly_Glix,
This is also being discussed on this forum thread, which might be helpful: http://forum.unity3d.com/threads/ios-submission-failed-due-to-purchase-failed-on-ipv6-only-wifi.428044/#post-2767624
Your answer
![](https://koobas.hobune.stream/wayback/20220612091851im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Unity IOS IAP restore process 0 Answers
iOS Networking 1 Answer
I got an iOS iap bug 0 Answers
app store rejected my game ---> 64 bits devices crash... EXC_CRASH (SIGABRT) 0 Answers
Why does Apple think my Unity project is trying to access the camera? 6 Answers