I think I have done all the necessary steps to set up In-App Purchases to unlock levels (which they are considered "non-consumable products").
I have added the product on iTunes Connect (the status shows waiting for screenshot - I am only testing the app so I think it should be fine). I have also changed the product ID in my script to match the one on iTunes Connect. As shown in the below script
// Deriving the Purchaser class from IStoreListener enables it to receive messages from Unity Purchasing.
public class Purchaser2 : MonoBehaviour, IStoreListener
{
private static IStoreController m_StoreController; // Reference to the Purchasing system.
private static IExtensionProvider m_StoreExtensionProvider; // Reference to store-specific Purchasing subsystems.
// Product identifiers for all products capable of being purchased: "convenience" general identifiers for use with Purchasing, and their store-specific identifier counterparts
// for use with and outside of Unity Purchasing. Define store-specific identifiers also on each platform's publisher dashboard (iTunes Connect, Google Play Developer Console, etc.)
private static string kProductIDNonConsumable = "nonconsumable"; // General handle for the non-consumable product.
private static string kProductNameAppleNonConsumable = "com.CompanyName.ProductName.LevelUnlock2"; // Apple App Store identifier for the non-consumable product.
public string levelTag;
void Start()
{
// If we haven't set up the Unity Purchasing reference
if (m_StoreController == null)
{
// Begin to configure our connection to Purchasing
InitializePurchasing();
}
}
public void InitializePurchasing()
{
// If we have already connected to Purchasing ...
if (IsInitialized())
{
// ... we are done here.
return;
}
// Create a builder, first passing in a suite of Unity provided stores.
var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
// Add a product to sell / restore by way of its identifier, associating the general identifier with its store-specific identifiers.
builder.AddProduct(kProductIDNonConsumable, ProductType.NonConsumable, new IDs(){{ kProductNameAppleNonConsumable, AppleAppStore.Name } });// And finish adding the subscription product.
UnityPurchasing.Initialize(this, builder);
}
private bool IsInitialized()
{
// Only say we are initialized if both the Purchasing references are set.
return m_StoreController != null && m_StoreExtensionProvider != null;
}
public void ExitButton(){
GetComponent