IAP iOS some user fail to trigger onSuccess listener but get charged

IAP iOS some user fail to trigger onSuccess listener but get charged

Hi @Zinitter did you solve the problem? i just release a game a week ago and a tiny percent of the buyers are telling me the same. I tell them to do the same you did but nothing works. There is a contradiction because if they try to restore the purchase, a message box appears telling them that there is nothing to restore. Also, If they try to buy the game again a messageBox tells them that the IAP was already buyed and ask if they want to buy it again for free. When the user accept this messageBox. The game stuck waiting for the onSuccess callback.

I still cant solve the problem.

My Apple id was stuck with the same issue with redeemed promo code and i contacted Apple Support, they cant help me clear the transaction.

But using another Apple id to purchase on same device do not has the issue.

You can ask your user to request refund and make the purchase with new / another Apple id.

Sorry for my bad english, this means that if Apple refund the purchase to the user and then, if he purchase again the problem isn´t fixed? He need a new Apple ID? Also promo code doesn´t work? That would be bad news;(

I found this here: (In the next comment he posted he claims that this solved his problem)

I have the same problem as described by @Seoptics with an app which is in production. Some users report to have paid for the premium feature, but not having these features unlocked. They can show us screenshot of the payment receipt in iTunes, but we don’t have any track of it in our system. I set up a lot of bug reporting regarding in-app purchase functions in my app, and everything seems to point to the fact that sometimes the buy function does not return any promise.

This bug is quite stressful as users can be very upset when they pay and don’t have their premium content unlocked. We received 5 complaints last week, for 40 sells, so this bug happens quite often !

As a workaround, I got inspired by @Seoptics’s idea. I validate the purchase in case I don’t have any news from iTunes, but unvalidate it in case I have an error a long time after that. This is necessary for instance if the user take a long time to type their iTunes password and decide to cancel the purchase. This way they could have their premium feature activated without any payment.

A simplified version of the code look like this :

solidBuy(productId:string):Promise< string >{

return new Promise((resolve,reject) => {

    let order =  this.inAppPurchase.buy(productId);

    order.then((data)=> {
            resolve("Purchase complete");
    .catch((err)=> {
            this.deActivateProduct(productId); // in case it would have been activated by the timeout below

    this.orderTimeout = setTimeout(() => {
        resolve("Purchase complete (maybe)");


As from my user, the issue is fixed after contact Apple to refund and purchase again.
Promo code is working, its just so lucky that my Apple id get stuck with the same issue.

New Apple id is just my suggestion as temporarily solution since i cant fixed the issue.

So your workaround code is working?
I using Cocos2d-JS and need convert it to JS version.

No, I just found that post 2h ago. I´m using cocos2dx and I´m not a good developer (i learn by myself). Seems like he put a timer but i don´t know where and how we could integrate in sdkbox.

May be on the IAP listener or try ask SDKBox support.

@yinjimmy, can you please help me on this issue?

Recently i receive a lot users feedback and complain about this issue, they stuck on the IAP but get charged.

I ask them to contact Apple Support and sometime they refuse to help or decline the request of refund so user cant repurchase the IAP.

SDKBOX version that i using and have the issue
v2.4.1.1 onesignal
v2.4.1.1 firebase
v2.4.1.1 iap
v2.4.1.1 googleplayservices

 v2.4.3.3 onesignal
 v2.4.3.3 firebase
 v2.4.3.3 iap
 v2.4.3.3 googleplayservices


let me check the IAP flow again.

Another IMPORTANT thing is: make sure IAP::init() is the first SDK initialization.

Did you use these function?
In my testing these function are buggy, use the default value will get less problem.

May be you can take a look in my question too.

yes, i do use


but didnt use this


my iap is non-consumable, haven’t use subscriptions type yet

My current sdkbox init sequence




i suspect the issue may related to firebase analytics as before this, i was using google analytics and the issue less chance to happen.

Not sure is it about the internet connection / delay on the response of IAP and firebase after init.

My Apple id that get stuck with the same issue happen when i init firebase first over IAP, but the issue never happen on sandbox mode.


if you still cant reproduce it, consider that some users may try to scam you.
(theyve received the items and got charged but want you to undo the payment so they didnt pay for it)

my apple id do have same issue, cannot repurchase and restore, no success callback.

i believe it is not about scam as i search, there are many people having same issue which not using sdkbox iap but other. its still a bug even i cant reproduce it.

so i try to find a solution to prevent and solve the issue but sdkbox is not open source.

@Zinitter your apple id still have the same issue, your transaction is “Pending”? how about let Apple canceled the transaction, and you try to repoduce this issue. and share the steps.

i have contacted apple support regarding my id issue, but the IAP is redeemed with promo code, they cannot canceled the transaction like you pay with money.

my id get stucked when i initialize Google Analytics / Firebase first over IAP, the purchased process is success just the success callback listener not trigger to complete the required code in app. the app didnt crash or switch to background / another app.

i fixed the initialize sequence and try restore / repurchase IAP, it get stuck after the message “Your purchase will be restore for free”.

so, you change invoke sequence like follow will fix this issue?

    onSuccess : function (product) {



it doesn’t complete fix the issue, the issue still will occur for some users.

i believe there are race conditions on the listener for getting IAP events between IAP and Analytics even init IAP plugin first, not sure about the device internet connection or Apple IAP server issue.

my temporarily solutions are as below although i havent test them yet, hope it can give you some idea.

  1. turn off analytics until user success purchased IAP

  2. init analytics after IAP listener initialized

    onInitialized : function ( success )

thank you.

We don’t have the source code for Google Analytics/Firebase. However, we’ll do some research on this to see if the analytics plugin stops the IAP event.

yes, googleanyalytics/firebase will register ios iap TransactionObserver, so, iap must register first of all.

I find error message when I compile in cocos creator.
Like as:
Simulator: AL lib: (EE) ALCmmdevPlayback_open: Device init failed: 0x80070490
I don’t know what it is mean?
Please help me in a short time.
Thank you for your reply.