How do I understand what Mobile IAP actually thinks its doing? EDIT: Kind of 2/3 solved

1 favourites
  • 11 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hello dear C3 community,

    I have some issues making my IAP work. Therefore I'm doing a lot of tests trying to figure out some questions I have. I would be so happy if anybody could help me with those:

    Question 1:

    Since it is important to add the IAPs product ID and then "complete product registration" on start of layout - I did so. Now I want to trigger events once this is finished. Is "On store registration success" not the event that fires once "complete product registration" ? (The one being "product-" the other "store registration")

    The documentation seems a bit slim on its Mobile IAP page.

    I don't understand the whole sequence of Mobile IAP as well.

    Question 2:

    It seems like "has product" (inverted) is always true at the beginning - aka. does not have product.

    "Has product" triggers some time afterwards, if true. But it seems not to be "on store registration success"

    My goal...

    ... is simply to have two possible outcomes of my intro screen.

    1. Sign into Google Play Services

    2. Setup IAPs using add product ID and Complete product registration

    3. Once all this is finished: check if user has product or hasn't

    4. Depending on has or hasn't either show freemium pop-up or let the user straight to the main app.

    I can't make this work :D

    Something like this:

    I'ld appreciate any tip, help or advice :)

    Have a great weekend!

    Chris

    PS: Question 3:

    (Why) do I actually need the whole Sign in GooglePlay and request player details stuff? Since this is an Android Native Project, aren't the users signed into Google Play anyway? Or is this Google Play sign in this additional Google Play SERVICES thing not the regular Google Play Account sign in?

  • By using my debug text I was able to further understand the sequence.

    Answer to Question 1:

    Q: Is "On store registration success" the event that fires "complete product registration"?

    Is Store and Product Registration the same?

    A: Mobile IAP's documentation seems very confusing on this topic: construct.net/en/make-games/manuals/construct-3/plugin-reference/mobile-iap

    "If registration succeeds then On Registration Success triggers."

    "Store Registered

    True if the registration stage successfully completed."

    "Complete product Registration

    Ends the registration stage. After this has been called you will no longer be able to register products. This must be called before you can purchase products. On registration success will trigger if successful."

    Answer to Question 2:

    Q: It seems like "has product" (inverted) is always true at the beginning - aka. does not have product.

    "Has product" triggers some time afterward, if true. But it seems not to be "on store registration success".

    A: This is true. It indeed seems like "has product" is returning 0 on and some time after "store registration success" fires until "has product" finally returns 1 (if the user has the product).

    Answer to Question 3:

    Q:(Why) do I actually need the whole Sign in GooglePlay and request player details stuff? Since this is an Android Native Project, aren't the users signed into Google Play anyway? Or is this Google Play sign in this additional Google Play SERVICES thing not the regular Google Play Account sign in?

    A: I still don't know.

    Do I need "Google Games Services" for Mobile IAP to work? Do I need to configure OAuth for this, really??

  • Up for question 3. In my game I have to sign in in everytime the game start. If I don't find a solution I will just disable it since it can be quite annoying for someone to wait 2/3 seconds before the game start. I tried to make an event checking if the user is already signed in. But I guess the google plugin in order to work must check if the player is signed in. I might be wrong anyway. I did these testing a month ago and I quite don't remember all the test I did.

  • Hi Ribis,

    I did some more testing.

    " it can be quite annoying for someone to wait 2/3 seconds before the game start"

    you mean each game? Like each round?

    I am pretty sure you only have to sign the user in once the app starts, or when the user loses internet (many people do "on signed out > sign in" in that case).

  • Regarding my overall problem of my in-app purchases not working:

    I think it all comes down to X (inverted) Has product "myIAP_product" is first true and only after a couple of ms turns true if Has product "myIAP_product" is being detected.

    Therefor my app starts reacting though the IAP has not been purchased and then gets mixed up when it changes.

    I thought when On store registration success fires only one state is returned. Not first 0 then 1.

    Has anybody have any experience beyond all this guess work?

  • Hi Ribis,

    I did some more testing.

    " it can be quite annoying for someone to wait 2/3 seconds before the game start"

    you mean each game? Like each round?

    I am pretty sure you only have to sign the user in once the app starts, or when the user loses internet (many people do "on signed out > sign in" in that case).

    Yeah, I mean only at the beggining of the app. it is still annoying in my opinion.

    Regarding my overall problem of my in-app purchases not working:

    I think it all comes down to X (inverted) Has product "myIAP_product" is first true and only after a couple of ms turns true if Has product "myIAP_product" is being detected.

    Therefor my app starts reacting though the IAP has not been purchased and then gets mixed up when it changes.

    I thought when On store registration success fires only one state is returned. Not first 0 then 1.

    Has anybody have any experience beyond all this guess work?

    To sell a product, you have to make an action saying "Purchase product "product name" that you loaded earlier".

    then, you make an event to check the condition of the purchase. On product "product name" Purchased success, or on failed....etc

    But first of all, you have to register all your products when you start the game.

    You can even have a condition to check if the product were registered successfully or not. I always double check this before an user buy a product. if for some reason the product were not registered on start of layout (missing internet for example) before buying it I have a function that first register the product, and on registration complete, then buy the product.

  • Hi Ribis,

    thank you so much for your help!

    I just made a pretty interesting test.

    If I do:

    Condition: Google Play is loaded

    Action: "Add product ID" with type and "Complete product registration

    it does fire on every tick (as expected)

    BUT if I do:

    Condition: Google Play on loaded

    Action: same as above

    it doesn't fire... I do not understand why.

    How is this even possible :D

  • Hi Ribis,

    thank you so much for your help!

    I just made a pretty interesting test.

    If I do:

    Condition: Google Play is loaded

    Action: "Add product ID" with type and "Complete product registration

    it does fire on every tick (as expected)

    BUT if I do:

    Condition: Google Play on loaded

    Action: same as above

    it doesn't fire... I do not understand why.

    How is this even possible :D

    On the screenshot I posted, the event run under On start of layout and it works good.

  • Thank you so much for your help so far Ribis!

    I understand the principle behind what to do when, and am doing pretty much what you described:

    This is my current state:

    Short explanation:

    I have an Intro Screen.

    If you don't have the IAP you get a Pop-Up.

    The Pop-Up lets you either choose "still testing" if you are still within the free testing period

    or lets you purchase.

    Since I know that "has product" returns 0 "on store registration success" even we the user has the product and only returns 1 after some ms, my most recent question is, how do I know how long to wait if the user has the product before triggering the freemium pop-up if not "on store registration success" :P

    I could upload my project file but I doubt anyone feels like looking into it, since I don't have like a "minimum version of it", even though everything is kind of well commented and sorted :D

    Maybe you see like an obvious mistake from my screenshots?

    Have a great week!

    Best,

    Chris

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • THANK YOU

    its works perfectly..

  • balajis1311

    :D it ended up not working for me :D:D:D so I'm glad it works for you. I still couldn't figure it out and my IAP / Freemium Version is still not finished. It actually frustrated me this much that I took a break from it -.-

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