Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Posts: 828
Registered: ‎10-16-2012
My Device: Red Z10
My Carrier: Rogers

Re: In-app purchases to remove advertisements

yes just add that same code to a buttons onClicked function.


the adds will come back unless the variable you set during purchase is restored when you open the application


onCreationCompleted: {
paymentControl.getExisting(true); root.removeAdds = parseInt(cpp.getValueFor("mySavedValue","")) console.log("remove adds is: " + removeAdds) }

 that should check for existing payments, restore any saved variable from qsettings and output it to console.log as well so you can see what the value was set to.  if it isn't coming back as what you saved it, maybe it's not being saved correctly




Posts: 386
Registered: ‎07-20-2012
My Device: Blackberry Z10 (White), BlackBerry Dev Alpha C
My Carrier: O2 UK

Re: In-app purchases to remove advertisements

Just added this, 


onCreationCompleted: {
                    root.removeAdds = parseInt(cpp.getValueFor("removeAdds", "100"))
                    console.log("remove adds is: " + removeAdds)

 And now every time I install the app from the IDE the adverts are not there because the app is saving and getting the value of 


("removeAdds", "100")

Now, should I put it back into production mode, upload the update to BlackBerry World and then test it from sandbox? 


Thanks again Smiley Very Happy