- Home /
Ouya iap help BCE0017
I'm sorry gang,
I looked all over the web before coming here. Have been banging my head against the wall for two days trying to figure out how to implement iaps for the Ouya. Yes there are docs out there. I don't understand them at all, and from the looks of it, I'm not alone. There's a video, it might as well be in Martian. I admit, it might be me. That said, I've spent a year developing what is now a complete game. I can't turn back and give up now. So I don't mind looking stupid and asking what might very well be a noob question.
long and short, I'm getting BCE 0017 at line 34. My brain is nearly fried between searching for info on the iap system, and now how to properly fix the error in this particular context.
public class IAP extends MonoBehaviour implements
OuyaSDK.IPauseListener,
OuyaSDK.IResumeListener,
OuyaSDK.IFetchGamerInfoListener,
OuyaSDK.IGetProductsListener,
OuyaSDK.IPurchaseListener,
OuyaSDK.IGetReceiptsListener
{
//------------ SETUP ------------//
function Awake()
{
OuyaSDK.registerPurchaseListener(this);
OuyaSDK.registerFetchGamerInfoListener(this);
OuyaSDK.registerGetProductsListener(this);
OuyaSDK.registerGetReceiptsListener(this);
}
function OnDestroy()
{
OuyaSDK.unregisterFetchGamerInfoListener(this);
OuyaSDK.unregisterGetProductsListener(this);
OuyaSDK.unregisterPurchaseListener(this);
OuyaSDK.unregisterGetReceiptsListener(this);
}
//------------ INTERACTION ------------//
function Buy()
{
// This is the function you call when pressing the "BUY" button
// put here the identifier of the product you want to sell.
// There is another way to do it, and involves putting all product IDs in OuyaGameObject but I haven't tested it since this works ok for me.
OuyaSDK.requestPurchase("sample_product");
}
//------------ PURCHASE CALLBACKS ------------//
function OuyaPurchaseOnSuccess(product : OuyaSDK.Product)
{
// yay, success!! product purchased!!
// show feedback to the user, unlock the game, etc.
}
function OuyaPurchaseOnFailure(errorCode : int, errorMessage : String)
{
// something happened, purchase failed
}
function OuyaPurchaseOnCancel()
{
// user cancelled the purchase
}
}
The line throwing the error is:
OuyaSDK.requestPurchase("sample_product");
and the error: "Assets/IAP.js(34,40): BCE0017: The best overload for the method 'OuyaSDK.requestPurchase(OuyaSDK.Purchasable)' is not compatible with the argument list '(String)'."
I'll be incredibly grateful for any help. Thanks, and God bless.
Your answer
Follow this Question
Related Questions
Ouya IAP with Ouya Everywhere [javascript] 0 Answers
Game doesn't move to next scene on Ouya 1 Answer
Can't save script 1 Answer
Help understanding this generic list in JS. 1 Answer
Animation script error 0 Answers