Detect in-app purchase failure without using scene change

ArmellineArmelline Member, PRO Posts: 5,327

Hey all,

I'm working on a single scene game at the moment and it includes in-app purchases. I wanted to avoid having GameSalad trigger a scene change to the success and failure scenes, and keep the game to literally one scene.

Monitoring for the changes that would mean successful purchases is easy, and I can avoid the scene change there without a problem, but finding out when a purchase has failed is something I've not yet worked out how to do. Does GameSalad offer any kind of failure feedback other than triggering a scene change?

By this point the benefits of skipping the scene change are so minor it isn't really worth the time trying, but since I started and hit this wall I want to know if there's a way past it, even if I don't end up using it.

So, how do people handle IAP without triggering scene changes?

Comments

  • Braydon_SFXBraydon_SFX Member, Sous Chef, PRO, Bowlboy Sidekick Posts: 9,271

    I've done it many times, and this is a question I ask myself every time I plan on doing it.

    There is no way to tell if an IAP has failed if it's on one scene. What happens is the user taps the IAP, it loads and all of a sudden...nothing happens. There is no error that pops up (unless there really is an error, like they aren't connected to the internet).

    It is pretty easy to handle IAP that are successful -- there are a variety of ways you could go about doing it.

    Here's an example of one that I used:

    I have an IAP that increases the coins in the game. I have it set up so an attribute checks the current amount, and when that amount is increased it plays a sound. I can additionally have my own pop up appear to inform the user that they've successfully purchased. The IAP increases the coins, which triggers that rule.

  • ArmellineArmelline Member, PRO Posts: 5,327

    @Braydon_SFX said:
    I've done it many times, and this is a question I ask myself every time I plan on doing it.

    There is no way to tell if an IAP has failed if it's on one scene. What happens is the user taps the IAP, it loads and all of a sudden...nothing happens. There is no error that pops up (unless there really is an error, like they aren't connected to the internet).

    It is pretty easy to handle IAP that are successful -- there are a variety of ways you could go about doing it.

    Here's an example of one that I used:

    I have an IAP that increases the coins in the game. I have it set up so an attribute checks the current amount, and when that amount is increased it plays a sound. I can additionally have my own pop up appear to inform the user that they've successfully purchased. The IAP increases the coins, which triggers that rule.

    Hey Brandon, thanks for the response. If you re-read my post though you'll see that I worked out how to do the successful purchases, but - for the reasons you mentioned - couldn't figure out any way to identify a failed purchase. I was just hoping I'd overlooked something obvious - like a trigger GameSalad has but doesn't necessarily advertise much - or something deviously clever that someone came up with.

    Sounds like I didn't, though :D

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    If you're using a Boolean purchase you can check and see if it changed by using a Boolean the is changed when they press the button for purchase. Compare the two. Use a timer to allow for the IAP menu to pop up and such.

  • ArmellineArmelline Member, PRO Posts: 5,327
    edited April 2014

    @The_Gamesalad_Guru said:
    If you're using a Boolean purchase you can check and see if it changed by using a Boolean the is changed when they press the button for purchase. Compare the two. Use a timer to allow for the IAP menu to pop up and such.

    I debated using timers but concluded that if the timer is long enough to give the purchase time to attempt and fail it's going to be long enough for the user to be bored by the wait. Also, if the purchase is very slow and the timer runs out but the purchase eventually goes through, it'll be a very undesirable situation. Ultimately, and primarily for the second reason, timers just can't be precise/reliable enough. Good suggestion though.

    Would be good if GameSalad could pass the success/failure to a variable of some kind - they must have the information to trigger the scene change.

    Maybe one for the future!

Sign In or Register to comment.