Search code examples
iosin-app-purchasestorekit

Do product IDs for in-app-purchase have to be globally unique per Apple ID (not just local per app)?


I want to define a new product for in-app-purchase in iTunes Connect, however I get this error message:

The product ID you entered has already been used. Enter a unique product ID and try again.

Does this mean that product IDs have to be globally unique per Apple ID (I am already using the same product ID in another app)? So far I was under the impression that local uniqueness per app is enough.


Solution

  • According to Apple's In-App Purchase Configuration Guide ProductIDs have to be globally unique:

    ProductID: The globally unique UTF-8 alphanumerical identifier for the product. The Product ID is any sequence of letters and numbers that uniquely identify the product. It can include periods and underscores and can be as long as 255 bytes, assuming single-byte characters. This value is used in the app to identify the product. It can’t be used for more than one product or the same product on Mac apps and iOS apps.

    That's why you usually define them using reverse domain notation:

    com.yourdomain.appname.productId
    

    You can use the productId part of this ID in boths apps doing something like this:

    com.yourdomain.appname1.productId
    com.yourdomain.appname2.productId