Is there a setting that disables native alert from pausing/freezing my game?

EDIT: It looks like this behavior of the native alert manifests itself only when IAP returns “Confirm Your In-App Purchase” alert message. It doesn’t seem to do this with other alert messages during the IAP purchase/transaction process. So… it may very well be how IAP is implemented and cannot be easily worked around. Any ideas, thoughts, etc…? (Hey, Peach, maybe this post should be moved to IAP subforum? If so, I’d appreciate your help in moving it. Thx.)


My game has runtime listeners, uses physics, etc., but all (physics objects, runtime listeners, and whatever else is in progress) come to pause (i.e., freeze on screen) when native alert message popups up. It might even be pausing timers (but I cannot be sure.) Is there a simple way to disable this pause? Does native alert have a pause-disable property?

I don’t mind the physics engine pausing, but the real problem is, when the alert pops up right at a time a function is being processed – i.e., when event.phase has already started, but before the event.phase ended. What the function does is, at the event.phase began, it creates runtime listener, and when event.phase ends, it removes the very same runtime listener (using a slight delay with a timer).

After the alert is dismissed, physics engine resumes, and all objects start moving again – but this one object with the runtime listener attached gets stuck in limbo because the event.phase never reaches the end (or, maybe because timer that removes the runtime listener never gets fired)…

I’d so appreciate any tip, hints, suggestions, etc., that may help resolve this. (It would be so awesome if I can simply set the native alert not to freeze everything…)

Naomi [import]uid: 67217 topic_id: 20472 reply_id: 320472[/import]

Moved :slight_smile:

I believe this is simply how IAP works, however I will ask around about it and see if there’s anyway around it. If so, I’ll update the thread - although I suspect it’s unavoidable.

If I might ask, why is the pausing a problem for you? (I’m purely curious as I’ve not seen IAP implemented in a scenario where the pause would be obvious as it is usually off a menu screen or the like.)

Peach :slight_smile: [import]uid: 52491 topic_id: 20472 reply_id: 80305[/import]

Hey, Peach, thank you for moving the thread and investigating if there’s a possible workaround.

With my IAP, I allow users to leave the purchase screen after user clicks on buy button. Sometimes, it takes too long for the iTunes Connect to process the purchase, and I can’t wait around for it to get processed (and I imagine, users wouldn’t want to wait around either). So, while waiting, users can resume the game (if the users decided to buy a consumable item during a game session), or start another game (if it’s the non-consumable item such as unlocking the premium levels, or purchasing consumable item before starting a game).

IAP alert pausing the game isn’t always a problem, but there’s one instance that results in an error. This error is likely to happen sometimes but not too often. (And if it’s too often, that means users are buying lots & lots & lots of non-consumable items, and that is super good thing despite the error.)

The error occurs when IAP alert pauses the game when the game is in the middle of processing a function. It appears this pause interruption causes the event.phase end not to occur, causing this error.

Oddly enough, not all IAP alert do this. So far, I noticed only one IAP alert that pauses my game in progress, and it’s the “Confirm Your In-App Purchase” alert.

Thanks again.
Naomi
[import]uid: 67217 topic_id: 20472 reply_id: 80473[/import]