Skip to content

Instantly share code, notes, and snippets.

@gmYusuf
Created August 4, 2020 06:34
Show Gist options
  • Save gmYusuf/8fc868932ba6ed06c4da0d4db88baf95 to your computer and use it in GitHub Desktop.
Save gmYusuf/8fc868932ba6ed06c4da0d4db88baf95 to your computer and use it in GitHub Desktop.
public void ObtainProductConsumablesInfo(IList<string> productIdConsumablesList)
{
if (iapAvailable != true)
{
OnObtainProductInfoFailure?.Invoke(IAP_NOT_AVAILABLE);
return;
}
ProductInfoReq productInfoReq = new ProductInfoReq
{
PriceType = 0,
ProductIds = productIdConsumablesList
};
iapClient.ObtainProductInfo(productInfoReq).AddOnSuccessListener((type0) =>
{
Debug.Log("[HMSPlugin]:" + type0.ErrMsg + type0.ReturnCode.ToString());
Debug.Log("[HMSPlugin]: Found " + type0.ProductInfoList.Count + "consumable products");
OnObtainProductInfoSuccess?.Invoke(new List<ProductInfoResult> { type0});
}).AddOnFailureListener((exception) =>
{
Debug.Log("[HMSPlugin]: ERROR Consumable ObtainInfo" + exception.Message);
OnObtainProductInfoFailure?.Invoke(exception);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment