[WorkAround] Fixing infinite prompt user to "Login to iTunes Store"

POMPOM Member Posts: 2,599

If you are not familiar with the case, here is the original thread:
http://forums.gamesalad.com/discussion/73767/is-game-suppose-to-prompt-user-to-login-to-itunes-store-every-time-game-opens#latest

I made this simple workaround:

Make a new actor and add these 2 new integers:

Then add the following rules:
Looping over the table and consume all purchases, making sure they can be purchased again.
NOTE: all my purchases are consumable so I'm looping over the whole table, keep in mind you should 'reset' only the consumables, so you might need to change this in your project to loop over specific indices.

loop is finished, kill the actor.

Ive placed this actor in strategic scenes including the opening scene, this process is completely transparent to the user.

As of now, it works for me, finger crossed it will continue to work.
Hope it helps for you 2 :)
Roy.

Comments

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

    Insightful @POM! Thanks for sharing, Roy!

  • colandercolander Member Posts: 1,610

    What happens if it is still pending waiting for a parents approval?

  • POMPOM Member Posts: 2,599

    Can you explain the status "pending parent approval"? This is the first time I hear about such status.
    Can this status be recognIzed be gamesalad as "pending"?

    Roy.

  • colandercolander Member Posts: 1,610

    Under Apples new system the parent can setup the account so they have to approve any purchases the child makes. This means the purchase state remains in pending until the parent approves it or not which could take some time. In some cases it could be a day or more.

  • POMPOM Member Posts: 2,599
    edited November 2014

    Im not sure wheather making an item "consumed" will kill the current pending purchase,
    This needs to be tested and verified by someone who enabled this parent safety.

    Either way, you can do the following, first use the "In App Purchase - Request Purchase Data",

    If callback is '-1' so destroy the actor (cause user is not connected to the internet),

    if callback is 1, so loop over the table and "consume" those that are not in pending mode.
    (This of course in the case that the status returned is "pending" for the parent safety)

    Roy.

  • stevejstevej Member, PRO, Chef Emeritus Posts: 435

    @colander said:
    Under Apples new system the parent can setup the account so they have to approve any purchases the child makes. This means the purchase state remains in pending until the parent approves it or not which could take some time. In some cases it could be a day or more.

    Calling "consume item" on a pending purchase will effectively do nothing. An item has to be successfully purchased for it to be consumed.

  • POMPOM Member Posts: 2,599
    edited November 2014

    @stevej
    So are you saying my workaround is safe to do? Cause right now since I've made it I don't have any more issues..

    EDIT:
    @stevej I wonder why you suddenly posted here, its been 5 days since last post, have you encountered the issue in your QA, and searched the forums to see if its being discussed? or was it simply on your to do list?

    Roy.

  • ashtmjashtmj Member, PRO Posts: 405

    I'm getting this same pop up/login request every time I launch my app(using a ad-hoc) I just got my app rejected for this reason.
    It is not a consumable IAP and asks for the login right at launch, before the game reaches any scenes with IAP any rules.

    @stevej is there something I can do to prevent this login request?

    message from apple:

    We found that your app initiates the In App Purchase process in a non-standard manner.
    Specifically, the App prompts the user to log into iTunes upon launch.

  • Agent ArgyleAgent Argyle Member, PRO Posts: 188
    edited July 2015

    I am experiencing this problem now and the above workaround does not work for me.
    I used an a Loop Over Table and in the loop had a rule that only consumed the item if that particular row was both consumable (column 2 was true) and purchased (column 5 is purchased.)

    I suspect that this does not work because in order to run the consume item behavior one must be logged into the app store in the first place so that it must ask to log in in order to run the behavior.

    I also tried creating the actor with an IAP Request Purchase Data behavior and running the Loop Over Table with the IAP Consume Item behaviors only if the callback was not -1 but still got the login prompt either way.

    EDIT: I just tried putting running the consume behavior on all consumables both before and after logging in and I still get the login prompt if I double click the home button to leave the app and then tap the app icon to come back to it. This happens with or without any IAP behaviors on the scene. So I am afraid the workaround does not work for me and I am concerned this will happen with live accounts, not just sandbox accounts and will turn off users or get my app rejected.

  • Agent ArgyleAgent Argyle Member, PRO Posts: 188

    I just tried uninstalling the app, then re-installing (it's an adhoc build) and logging in with a non-sandbox iTunes account and still got asked for the sandbox login.

    Here is what I did:

    1. I deleted the app.
    2. I reinstalled the app.
    3. I logged out of iTunes in the system prefs. (I had been logged in with my sandbox account)
    4. I logged back into iTunes with my regular account. (I have used this account in sandbox mode and it seems to work.)
    5. I then launched the app and was asked to log in with the sandbox account.
    6. I cancelled login and made an IAP consumable purchase.
    7. It asked me to login with the sandbox account but I changed the account to the normal account and continued with the purchase. The purchase went through.
      8.I then double clicked the home button and put the app in the background.
    8. I Tapped the app icon and immediately it asked me to login with the sandbox account.

    It seems to me that when an app triggers IAP calls to iTunes, iOS associates the triggering app with the account that made the IAP calls. I've seen this login to iTunes message pop up when I have opened other non-GS apps as well, so it seems that somehow using test accounts is confusing iOS. Hopefully this problem goes away when users have just one account and are not in sandbox mode.

  • Agent ArgyleAgent Argyle Member, PRO Posts: 188

    Since I have seen this happen with other apps, I did a bit of Googling to see if anyone else has something to say about it.

    Here is someone on StackOverflow suggesting that finishTransaction: must be called after the item is purchased.
    http://stackoverflow.com/questions/17716128/keep-getting-the-uialert-which-ask-for-itunes-password

    Here is another that says the same thing. This guy's issue is pretty much exactly what I am experiencing:
    http://www.codeotel.com/0zzVUqWkjU/inapp-purchase-sandbox-continuous-prompt-for-apple-login.html

    So, my question now is: does the GS IAP Consume Item action call finnishTransaction?

    If not, it sounds like this may be a bug?

  • Agent ArgyleAgent Argyle Member, PRO Posts: 188

    Above I wrote:

    I used an a Loop Over Table and in the loop had a rule that only consumed the item if that particular row was both consumable (column 2 was true) and purchased (column 5 is purchased.)

    I have since tried running the consume item behavior on all the purchases as outlined in the workaround- still no luck.

  • Agent ArgyleAgent Argyle Member, PRO Posts: 188

    In the end, the only thing that worked for me was powering off the device. After turning it back on, the login messages disappeared.

Sign In or Register to comment.