我在Unity IAP遇到问题。我在Play商店中发布了我的项目的alpha版本。我已经在商店中设置了iap,并通过提供正确的服务API密钥激活了编辑器上的服务iap。问题是我无法在我的android构建中初始化iap。
初始化代码:
void Start() {
if (!IsInitialized()) {
var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
builder.AddProduct("test_product", ProductType.Consumable);
UnityPurchasing.Initialize(this, builder);
}
}
public void OnInitialized(IStoreController controller, IExtensionProvider extensions) {
Debug.Log("OnInitialized: PASS");
storeController = controller;
storeExtension = extensions;
}
public void OnInitializeFailed(InitializationFailureReason error) {
Debug.LogError("OnInitializeFailed InitializationFailureReason: " + error);
}