in app purchase - from paid to gratis with iAd

Discussion in 'iOS Programming' started by kikko088, Oct 29, 2012.

  1. kikko088 macrumors member

    Oct 13, 2010
    Hi at all, I have a question, i have from 1 year a paid app on app store, now i want to convert the app to gratis app with iAd and possibility to remove iAd with in-app purchase...the problem is that I want to disable iAd for who have buy the app before now.

    There is a way for do this?
    thank you!
  2. Reason077 macrumors 68020


    Aug 14, 2007
    There's a few ways you can do this.

    - You could release a new, free version of the app, and maintain it in parallel with the old one.

    - You could have the current version save a secret key/value which identifies it as having been purchased in the past. You could do this via a server, or iCloud, if you wanted to make it more robust/secure. If the new version sees this value then it removes ads just as if the IAP had been purchased. This relies on all your current users first upgrading to (and running) an intermediate version, however.
  3. ArtOfWarfare macrumors G3


    Nov 26, 2007
    Further, if the user uninstalls the app, then reinstalls it, they'll lose that key.

    My suggestion:
    Release an update to your paid app that stores a value to the user's iCloud account that says the app has been purchased.

    Seperately, release a new, free app, which can read that value from iCloud but will only write to it in the event of an IAP.

    In your old app, tell the user that an update is available as a free download from the App Store and provide them with the link. Inform them that a code is on their iCloud account that makes it so the IAP is already purchased for the update, and that they should contact you if they find that they're seeing ads anyways in the update.

    This is all just theoretical... I believe I've read some iCloud documentation talking about how to allow your apps to share data amoungst themselves on iCloud, so I do believe its possible to do what I've described.

    A small possible security issue: if users can directly access data on iCloud somehow, they might be able to take that secret value and share it with other people, who might be able to insert it directly into their own iCloud storage... I don't know whether its actually possible... I suspect Apple has securities in place with iCloud storage that would thwart efforts to do this.
  4. dejo Moderator


    Staff Member

    Sep 2, 2004
    The Centennial State
    Art, what happens if the user has disabled iCloud?
  5. Reason077 macrumors 68020


    Aug 14, 2007
    Yes, this should work. Alternatively, you can share data like this between apps via shared Keychain, too.

    - Keychain is supposed to be secure - only your apps can read it.
    - Works if iCloud not enabled

    - Key would not be automatically shared between different devices
  6. ArtOfWarfare macrumors G3


    Nov 26, 2007
    Both apps can generate a secret key that is reproducible only by the user. In the paid update, it tells the user what that secret key is and gives them a link to download the free app. Then the free app generates this same key, and asks the user what it is. If the user is correct, the free app unlocks.

    Since UUID isn't allowed anymore, this secret key might be generated from some combination of the following data (I'm not sure how much of this is accessible, these are just some ideas: )

    - The current date / time. Maybe the key is only good for an hour.
    - The current location. Maybe the key is only good within a few feet.
    - The device's name (it's accessible, isn't it? Maybe not...)
    - The names of nearby wifi routers
    - The carrier
    - The model of device
    - The version of iOS the device is running

    A slight variation on this idea... I believe apps are allowed to communicate with each other through special URLs. You might have the paid version send the secret key directly to the free app via a special URL without having to harass the user as much. This probably requires that the user installs the free app before upgrading from the paid app.

    Edit: One other variation: email the secret key. Put the key in a document type you create and your free app can open. Have the paid version of the app present the user with an email prefilled with the attachment and ask them to hit the send or save as draft button, then open the email and open the attachment in the free app.
  7. kikko088 thread starter macrumors member

    Oct 13, 2010
    thank you for all, I try to get this way, I study a bit and then if I have some problem I post in this thread the news.


Share This Page