When I click the button to remove ads and unlock a challenge, it does nothing. No google popup screen or anything.
As far as I know everything is set up correctly in the google developer console. The in-app product is set to active; I've input the Base64-encoded RSA public key in .java file. What am I missing?
void SetupIAP()
{
agk::InAppPurchaseSetTitle("Prove Your Worthiness");
agk::InAppPurchaseAddProductID("com.company.product",0);
agk::InAppPurchaseSetup();
return;
}
void PurchaseIAP()
{
agk::InAppPurchaseActivate(0); //the zero is the first product in the store that is listed
while (agk::GetInAppPurchaseState() == 0) //Return the current state of the attempt to activate content. A value of 0 indicates that the process is on going, while 1 confirms the process is complete.
{
agk::Sync();
}
if (agk::GetInAppPurchaseAvailable(0) == 1)
{
//insert code to unlock sensei challenge and set variable to hide adds
//ungrey the sensei button
senseibtn->SetColorOfSprite(255,255,255,255);
//write values to file
SHOWADS=0;
OPENSENSEI=1;
SENSEIOPTION=1;
WriteToGameFile();
if(senseipopup!=NULL)
{
senseipopup->SetPositionOfSprite(-200.00f,35.0f);
senseipopup->SetVisibility(0);
senseipopupOkBtn->SetPositionOfSprite(-100.00, 35.00f); senseipopupOkBtn->SetVisibility(0);
senseipopupOkBtnrollover->SetPositionOfSprite(-100.00f, 35.00f); senseipopupOkBtnrollover->SetVisibility(0);
}
gamemode=TITLESCREEN;
wchbtn=0;//this is here to keep it from going into the training screen when leaving main game
}
else if (agk::GetInAppPurchaseAvailable(0) == 0)
{
//process failed show message
agk::CreateText(3000,"Processed Failed");
agk::SetTextPosition(3000,40.0f,70.0f);
agk::SetTextColor(3000,255,1,1,255);
agk::SetTextDepth(3000,1);
agk::SetTextSize(3000,2.5f);
agk::Sync();
gamemode=SENSEIPOPUP;
}
return;
}
Prove Your Worthiness
KG2Entertainment.com