Announcement

Collapse
No announcement yet.

Testing in App Purchase - can't get "success" return

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Testing in App Purchase - can't get "success" return

    Hello,

    I'm working on adding an in app purchase to our game. I successfully added the purchase via iTunes Connect. And am able to successful query for available purchases. I created a test user as well, to test the purchases, logging out of my main iTunes account before opening the app. Using the delegate, and BeginPurchase, a pop up successfully happens, initially to enter a username and password, and then after successful entry, asking if I want to be charged for the purchase, with header "Confirm Your In-App Purchase" (it also includes a note that it's in [Environment: Sandbox]). If I hit cancel at this point, the "MTR_Canceled" value is returned to the purchase delegate, so it registered a non-completed purchase (by user cancelling). However, if I hit OK, the delegate is never called (presumably with MTR_Succeeded or MTR_RestoredFromServer). Any ideas on what may make those successfully return?... without it, I can't actually register a successful purchase so that the code can continue with the unreal side of the purchase (the code in UnrealScript that indicates the purchase).

    Thanks

    #2
    the way I check to see if the user has chosen to Confirm the purchase is with

    Code:
    function OnProductPurchaseComplete(const out PlatformInterfaceDelegateResult Result) //launches when player attempts to purchase a product 
    {
         if (Result.Data.IntValue == MTR_Succeeded) //if player successfully purchases item
         {
               //user bought the pack, what do they get in return?
         }
    
         if (Result.Data.IntValue == MTR_Canceled) //if player presses cancel button on apple pop up
         {
    	  //Don't give player any items
         }
    
         if (Result.Data.IntValue == MTR_Failed) //if purchase has failed
         {
              //purchase failed, best to display error message to player
         }
    
         if (Result.Data.IntValue == MTR_RestoredFromServer) //if player already has non- Consumable and is restored from server without getting charged. (DOES NOT CURRENTLY WORK)
         {
              //Restore the item specified
         }
    }
    MTR_RestoredFromServer does not appear to work so non-Consumables are essentially not usable in UDK games as Apple will reject the game for not being able to Restore purchases. Tried and tried to get working as well as a few other forum posters but no luck.

    You can check out my Kismet code for iAP here and see if you can find a solution to your issue that way if the above does not help. iAP is working correctly with this kismet firing off Succeeded events and Canceled.

    Hope this helps!

    EDIT
    Also if your code is the same, which id assume so since MTR_Cancelled is getting triggered for you. Make sure you have logged into the App Store in your device settings with a test account you setup in iTunes Connect. Otherwise you wont be able to receive the Succeeded event due to your personal account not being eligible to make the purchase in Sandbox mode.

    Comment


      #3
      Thanks for the response Mr. Random.

      My code is similar to yours. And we were using test account with iTunes connect (if I used my regular account, it returned a "Failed").

      An update on progress. Later on Saturday, using the exact same deploy, it started working. Our best guess is there were some connection issues or servers issues with the test users, as nothing in the code itself change from not-working --> working. But that's a guess. There are still some other issues, we're working out, but it is generally now returning the successful result for test users.

      Thanks.

      Comment

      Working...
      X