Hi,
I did few month ago a cocos2d-x ios app with in-app coded in pure objC. Now I try to use the sdkbox for a new app that will be on ios and android.
In objC I did:
If you are using SDKBOX IAP plugin,
then you must have overrided the onSuccess() on the class where you have used your IAP.
once the IAP purchase is successful, then it will come inside onSuccess() function and you can access the product like this -
if(p.name == “REMOVE_ADS”)
// do something
Let me know, if it answers your question after trying.
yes, it is for hosted content and you just gave me the answer I was afraid to receive. So I guess I have 2 choices: first I will dig into the sdk to see if I can add this functionally for my ios app, or I just forget about sdkbox
That might work, not sure though, I’m thinking about how are you going to handle in-app content download in android version? If you’re going to host the content on your own webserver for the android version, maybe you can reuse the same logic?
That is a good point! I was more concerned about the ios version that I’m working on now and did put aside android. Having Apple host my in-app content was an easy solution. I will not postpone it any more and will switch to my server.
Thanks for your help @nite !
if I call objC function in onSuccess() to ask Apple to send me back the last transaction, wgat is the parameter i should use inside transaction.payment.downloads
-(void) download:(StoreTransaction *)transaction
{
NSAssert(transaction.payment.transactionState == SKPaymentTransactionStatePurchased ||
transaction.payment.transactionState == SKPaymentTransactionStateRestored, @"The payment transaction must be completed");
if ([transaction.payment.downloads count])
{
[[SKPaymentQueue defaultQueue] startDownloads:transaction.payment.downloads];
}
}