MobileIAP: "Restore purchases" triggers purchase success even if product not owned (iOS)

0 favourites
  • 6 posts
From the Asset Store
25 high-quality orchestral fanfares divided in: Success, game overs, alerts, level ups, stingers
  • R210.2

    I have an app that is a "free" version by default. It is "upgraded" to the Full version via IAP on two conditions:

    - + MobileIAP: Has product PRODUCT_ID_1

    - + MobileIAP: On any purchase success

    Once they are considered to have the Full version, a LocalStorage flag is set.

    If the user has uninstalled/reinstalled the app, they can click a "Restore purchases" button to retrieve a prior purchase. MobileIAP will then execute a "Restore Purchases". Even if the user does *not* own the product, the "On any purchases success" condition is still met when they restore purchases. Consequently, my app will give them a free full version. So, a new user can install the app, click "restore purchases" and now they have the full app for free.

    Workaround: Only register the app as Full/purchased if the "has product" condition has been met. Do not assume the user bought bought the product via "on any purchase success".

    Curious:

    1. Why would "restore purchases" trigger a purchase success if the user hasn't purchased the app? Has anyone else seen that? I can't find any reports of it.
    2. I consequently have users currently running the "full version" but they don't own the product, they simply clicked "restore purchases". I'd like to release an app update that takes away the "full version" flag if they don't own the product, but I don't think there is a graceful way to do check ownership without bugging my legit paying users with a login prompt to the store. Any ideas there? I'm thinking I have to let this one go.

    Maybe this is a bug? The C2 guide described "on any purchase success" as

    Triggered after any purchase finishes to indicate whether it was successful (and the item is now owned)

    The C3 manual isn't this descriptive on the logic.. but I don't see where ownership is being checked as a pre-req for purchase success.

    Cheers, -Steve

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Are you on android? Either way the workaround is how you should've done this originally, not sure on that first bit of logic, unlock the full version on any purchase, that was your design?

  • This is happening specifically on iOS (just edited/added that to the original post).

    There is only one IAP available to purchase, which is a non-consumable "unlock" for the Full Version of the app, which expands features and disables a timer. For that reason, the app assumes that any successful purchase means the user owns that full version.

    What I did not anticipate was that the "restore purchases" action seems to be meeting the "on any successful purchase" condition, even when the user does not own any IAP.

    I should probably test "On purchase success" for the specific product ID and see if that also triggers on "Restore Purchases" as well when the user doesn't own anything. I would expect either "successful purchase" check to fail, though, if the user does not own the product.. unless the criteria for a successful purchase has changed in C3 to now only mean "successful purchase attempt". Maybe "on any successful purchase" is operating with the scope of any product ID at all.. e.g., another app vendor.

  • Yeah it is probably any product IDs, but you could've tested this in the sandbox environment before pushing it live. I would stick to the specific product ID, making it any purchase because you have only one product has caused some bugs. There's also no way to revert it because I don't think you can track who genuinely has the local storage flag set since both events triggered it.

  • Thanks. True. It was tested, but the restore function should have been retested more thoroughly before the last app update. The behavior changed at some point.

    Yeah. I can't tell who has a legit purchase flag unless I force a purchase check to make the user

    log in. Not doing that to my paying users' experience.

  • After a few more tests.. Just extra notes for anyone coming across this thread

    The takeaway is that I'm not sure what the use case is for "any purchase success" but I'm going to avoid it.

    On Restore Purchases

    When a user does not own the IAP in question

    - "+ MobileIAP: On any purchase success" = TRUE (weird)

    - "+ MobileIAP: On product <productID> purchase success" = FALSE

    - "+ MobileIAP: On any purchase failed" = FALSE

    - "+ MobileIAP: Has product <productID>" = FALSE

    When a user does own the IAP in question

    - "+ MobileIAP: On any purchase success" = TRUE

    - "+ MobileIAP: On product <productID> purchase success" = TRUE

    - "+ MobileIAP: On any purchase failed" = FALSE

    - "+ MobileIAP: Has product <productID>" = TRUE

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)