Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

IAP not working on IPv6 only

Discussion in 'iOS and tvOS' started by rexwaves, Jun 23, 2016.

  1. rexwaves

    rexwaves

    Joined:
    Jul 1, 2013
    Posts:
    16
    My publisher is currently testing my game for release on iOS and they reported this bug:

    [From publisher]
    Cannot buy coins using an IPv6 Internet connection. When the user attempts to buy coins when they are using an IPv6 connection, the prices disappear. When they tap on the purchase, they are shown the following error message: "Prime31: products have not yet been received. Did you call requestProductData and wait for return event?"


    The IAP flow works perfectly if not using an IPv6 connection.

    Info about the build:
    -Unity 4.7.2 Pro, OSX 10.11.4, Xcode 7.3.1, Prime31 plugin StoreKit_2.14
    -Scripting backend: IL2CPP
    -Architecture: Universal
    -API Complatibility level: .NET 2.0
    -SDK Version: Device SDK
    -Target iOS Version: 7.0
    -Stripping level: disabled
    -Script call optimization: slow and safe
    -I know Unity 4.7.2 and Prime31 whould be IPv6-ready, shouldn't they?

    Could this be a problem with IL2CPP stripping that is always enabled? If so, what can I put in link.xml so disable stripping?

    We are under pressure to release and this problem is holding the project so any help at all, suggestions or ideas to try are highly appreciated! Many thanks!
     
  2. DannyHellfish

    DannyHellfish

    Joined:
    Jan 20, 2014
    Posts:
    29
    @rexwaves Hey there, may I ask, have you fixed it? We also failed the submission due to IAP not working in with an IPv6 connection and we have no solution yet. Would be be very grateful for any advice!

    Thanks,

    Daniel
     
  3. rexwaves

    rexwaves

    Joined:
    Jul 1, 2013
    Posts:
    16
    @DannyHellfish

    Yes, Apple passed the game. I did a workaround for it, not an actual fix, but it was enough to pass.

    It seems the problem was that in IPv6, sometimes the request to retrieve the IAP products at the start of the game just failed. Other times it worked. I don't know why, but it has something to do with the inconsistency of the testing environment.

    So I made a watchdog that requests the IAP products from the server every 3 seconds. If the request is successful, it stops, if not, it goes on forever. This apparently was enough to go around the inconsistencies in the network (I suspect some of the requests still failed, but then one succeeded).

    So I suggest you do the same, it's easy to implement, just poll the servers in FixedUpdate of your game manager while the IAP products have not been received and stop it when they are.

    By the way, I was using Unity Pro 4.7.2, El Capitan 10.11.6, Xcode 7.3.1 and Prime31 StoreKit 2.14.

    Good luck!
     
  4. DannyHellfish

    DannyHellfish

    Joined:
    Jan 20, 2014
    Posts:
    29
    Thanks, we will try that! Although it seems that we have no problem retrieving the products it's just that sometimes with IPv6 purchasing fails and sometimes not... Seems like the apple tester just got unlucky... which means we got unlucky...
     
  5. rexwaves

    rexwaves

    Joined:
    Jul 1, 2013
    Posts:
    16
    I suggest you do the same when purchasing: when the purchase fails, don't display an error message right away, but try to purchase again (from the fail handler). Do this about 3-4 times and only it it fails 3-4 times in a row then you display an error message. All this time the user should see something like "please wait..." / "purchasing...". This will raise your chances of the purchase working and of the game passing. Come back to tell us if it passed :)
     
  6. DannyHellfish

    DannyHellfish

    Joined:
    Jan 20, 2014
    Posts:
    29
    We passed the submission. We made a video showing how the whole process works fine in our testing environment, resubmitted and passed. Although we didn't change anything compared with the previous version... game development never stops to surprise me...
     
  7. rexwaves

    rexwaves

    Joined:
    Jul 1, 2013
    Posts:
    16
    Well, that's great. It's interesting a video convinced them. It's probably because IPv6 is still a new technology and a lot of problems can occur with testing. Good to know!