iOS in app purchase - no products received

后端 未结 9 1504
感情败类
感情败类 2020-12-13 10:29

I\'m trying to add in-app purchase to my app, following the techniques described here :

Introduction to In-App Purchases in iOS 6 Tutorial

I\'ve added a prod

相关标签:
9条回答
  • 2020-12-13 11:09

    I run into the exact similar problem. Here are some steps that needs to be adressed/checked after reading this technical note from Apple:

    • Create a unique App ID
    • Enable in-app purchasing for this App ID
    • Generate and install a new provisioning profile on your device
    • Update the bundle ID and code signing profile in Xcode
    • Check that your project’s .plist Bundle ID match your App ID
    • Complete your contract, tax, and banking Information. You need a VALID contract

    As mentioned by the official doc there is NO need to submit binaries neither submit screenshot of in-app purchase. I have seen a lot of missleading info about this on various blogs.

    After checking you have addressed each point in this list, delete your app and reinstall it.

    I was basically missing two things on my side: setting up correctly my contract for ios Paid app and i didn't install the new provisioning profile on my device. May be that was your issue?

    0 讨论(0)
  • 2020-12-13 11:09

    We were stuck a while with the same problem trying to run it on the simulator.

    After try it on a real Apple TV device (connected via USB) we started getting valid product IDs.

    Then you only have to request the payment of one of these products on your code and you should be able to be requested to authenticate (with a sandbox user) and approve your purchase on the Apple TV.

    0 讨论(0)
  • 2020-12-13 11:14

    Getting no valid products returned in productsRequest:didReceiveResponse is a well known issue. There are many reasons, some given in TN2259 especially FAQ#6. Usually the problem is that the app is not directing itself towards the sandbox. Often that is because the developer did not do these 3 things in order: 1) delete old builds of the app (delete, not overwrite) 2) log out of the app store on the device using the settings app 3) run the app from Xcode on a device (not a simulator) and log into the store using a test user only when asked by the app store.

    0 讨论(0)
  • 2020-12-13 11:19

    I think I may have found the answer here.

    This wording from the in-app purchase web page led me to it:

    The first In-App Purchase for an app must be submitted for review at the same time that you submit an app version. You must do this on the Version Details page. Once your binary has been uploaded and your first In-App Purchase has been submitted for review, additional In-App Purchases can be submitted using the table below.
    

    What you can do to get around the catch-22 of not wanting to submit an app for review when you haven't tested the in-app purchase code is to submit it for review, and then immediately reject it on your own. This gives it a status of "developer rejected".

    Than you can add your product, According to the blog,

    After saving the product, just choose the “Submit with app binary” option. This will tie the product to the app binary, so when you finally submit the 100% complete app binary, the product will be submitted as well.
    
    0 讨论(0)
  • 2020-12-13 11:25

    I had a similar problem. I used code that was working in another app for IAPs so it should have been working, but I was getting an Invalid Product ID error and no results received. It turned out that it was a timing issue. I was trying to process the returned products before they'd been returned to the app, so the error was terminating the app before the products had time to be loaded! My program logic was:

    • User opens store view & IAP products are loaded
    • A UITableView is loaded with a list of the products (but from a locally held array)
    • The user clicks the buy button on a table cell - if this happens too quickly, the actual products haven't been returned yet - app crashes

    Answer for me was to build the table from the returned products (should have been obvious to me in the first place!) so the user couldn't continue until they had been loaded correctly

    0 讨论(0)
  • 2020-12-13 11:31

    Answer for Swift projects with same error:

    My error was here:

    //identifiers: [String]
    let productIDs = Set(arrayLiteral: identifiers) as Set<NSObject>!
    let request = SKProductsRequest(productIdentifiers: productIDs)
    

    But this code will lead to an error with code = 0 message Cannot connect to iTunes Store. Let's look to the SKProductsRequest input argument type:

    SKProductsRequest(productIdentifiers: Set<NSObject>!)

    So, code above looks legit. But it doesn't! Swift Set is the problem, considering that in input argument we see Swift Set!

    Found the answer while iterating some IAP lesson. Here is the working code:

    let productIDs = NSSet(array: identifiers)
    let request = SKProductsRequest(productIdentifiers: productIDs as! Set<NSObject>)
    

    You must use NSSet for now, although Swift Set is already available and it's set as input argument type! Looks like a bug for me, I'll fire a bug.

    0 讨论(0)
提交回复
热议问题