Easy way to keep track of Consumables via server?

I personally do not want to maintain a server just to keep track of some number for a device ID, or iTunes account name, etc etc regarding In App Purchases and the Consumable flag. Since consumable in app purchase types are not returned as transactions when restoring from the app store (store.restore()) then there has to be another easy way to maintain this.

Does anyone know of an easy existing service that I can use that would allow me to simply make HTTP calls to query a database for updates/inserts/selects to retrieve this information?

Does Urban Airship do something like this?

The corona virtual credits API is basically what I would want, but I would want to offer in app purchases instead of the SuperRewards ads, though I would love for SuperRewards to keep track of that as well somehow. [import]uid: 8541 topic_id: 13920 reply_id: 313920[/import]

I’m trying to come up with a similar solution.
I THINK if you OpenFeint, you can store it in the blob.
I’ve seen games that use OpenFeint to store currency. (Mega Jump).
Not sure if this is what is being used.
[import]uid: 40413 topic_id: 13920 reply_id: 51179[/import]

if you have a consumable, it should be easier to track, as a consumable would add some items to your app, like 3 ice-creamss or 50 bullets or 1 golden ticket and so on. So when the user purchases the consumable, add the redeemable item and save it to your device, now if the user changes devices, the consumable is not transferred which is what is expected.

cheers,

?:slight_smile: [import]uid: 3826 topic_id: 13920 reply_id: 51195[/import]

Doesnt OpenFeint rely on the user actually clicking the ‘yes I want to use OpenFeint’ at the start? If they say no, doesnt that prevent the OF features from working at all?

Or does OF still work if they choose no?

@jayantv
But if they have 10 virtual currency left that they bought, and have to restore a device, those 10 virtual currency is gone. Apple requires tracking of those remaining value upon restore somehow. [import]uid: 8541 topic_id: 13920 reply_id: 51205[/import]

Hi,
if it was any other thing, I could have suggested some way to save it on the device using a file on the device. CrawlSpaceLibrary has some good functions to do so.

However, Virtual Currency is a different kettle of fish, I have had no +ve experience with it as I have never gotten a response from the technical team, however the sales guys have been quite nice, but isn’t that how you sign off to a holiday in hell ? :wink:

cheers,

?:slight_smile: [import]uid: 3826 topic_id: 13920 reply_id: 51207[/import]

Apple doesn’t seem to enforce this too much.
And like i said, Mega Jump seems to be doing this with Openfeint.
yeah the user has to opt-in to openfeint for this to work.
[import]uid: 40413 topic_id: 13920 reply_id: 51227[/import]

I see how Mega Jump has done this via OpenFeint, they even warn you that your online progress will not be saved without it.

I guess if thats ok with Apple, then I can use it in a very similar fashion without another server. This pleases me…

Thanks for the tip! [import]uid: 8541 topic_id: 13920 reply_id: 51376[/import]

I haven’t tried it yet, but I plan on using Amazon’s SimpleDB cloud service to track my in App purchases.

You simply make restful HTTP calls to manage your database. For tracking in App purchases it should be free because managing purchases should consume so few machine hours (and storage space). Plus, if for some reason you go over Amazon’s free tier usage limits you probably can afford the service…

[import]uid: 60707 topic_id: 13920 reply_id: 53432[/import]

This is… perfect! I didnt even know this existed.

Thanks for the link to SimpleDB.

One last question due to recent events from Apple, as they no longer what you to try and use the iPhones UUID to uniquely identify the phone/user.

What other information can we actually track to know that XYZ has purchased ABC?
[import]uid: 8541 topic_id: 13920 reply_id: 53441[/import]

I am (sort of) going to answer my own question about the device ID.

It looks like apple does not want you to use the ID itself, as in, store the ID on a remote server, but if you take the ID and encrypt it some way, perhaps MD5, then you would be storing the hash of the ID and not the ID itself.

It still doesnt get around the problem of tracking one device only though.

I wish Apple gave us access to a unique ID that we could use that would be the unique id of their itunes account (not username, more like a string that looks like 234234234ASD234), so that the same itunes account across multiple devices could be used for store.restore() purposes.
[import]uid: 8541 topic_id: 13920 reply_id: 53588[/import]

If you’ve ever played Tap Zoo you see they use both in-app purchases and something like SuperRewards. The player can get new coins both ways.

But you’d still need some way to store the total they have (in-app + SuperRewards), so a remote DB would be needed.

As far as a unique ID goes, that’s a tough one, but you could require a registration with an email address. There are a lot of apps that do that, although not usually “pick up and play” games.

I’ll be following this thread in hopes someone comes up with a really cool method. :slight_smile:

Jay
[import]uid: 9440 topic_id: 13920 reply_id: 53638[/import]

I posted this in another discussion about the UDID. You should not tie a person to their device. When all these new iPhone 5’s hit the street, the 3GSs and some iPhone 4’s are going to hit the street and suddenly someone else now has their account information.

Have the user login with an email address so that their information is tied to them, not their phone. This also gives you the ability to create a web interface to their data so they can manage their account off line.
[import]uid: 19626 topic_id: 13920 reply_id: 53642[/import]

SimpleDB has a free tier which is 25 machine hours and 1GB of data per month. I have no idea what 25 machine hours works out too, but they say many people could live there and ever exceed those limits.

But also, if you have you’re web hosting, you typically have your own database and its really not that hard to whip up you’re own RESTful services to handle your needs. A simple Ruby on Rails setup and you’re good to go. I’m sure there are PHP frameworks that can provide you a RESTful interface to your own databases.

You make HTTP GET requests and you get JSON data back. Corona is very happy with this setup.
[import]uid: 19626 topic_id: 13920 reply_id: 53646[/import]

SimpleDB has a free tier which is 25 machine hours and 1GB of data per month. I have no idea what 25 machine hours works out too, but they say many people could live there and ever exceed those limits.

But also, if you have you’re web hosting, you typically have your own database and its really not that hard to whip up you’re own RESTful services to handle your needs. A simple Ruby on Rails setup and you’re good to go. I’m sure there are PHP frameworks that can provide you a RESTful interface to your own databases.

You make HTTP GET requests and you get JSON data back. Corona is very happy with this setup.
[import]uid: 19626 topic_id: 13920 reply_id: 53647[/import]

oops sorry about the double post. [import]uid: 19626 topic_id: 13920 reply_id: 53648[/import]

Would anyone be willing to post some sample SimpleDB code? [import]uid: 1560 topic_id: 13920 reply_id: 57023[/import]

I’m working in an OpenFeint solution to VC storage. But I would like for Corona to have the option, in the upload and download Blob, for listeners for both failed and succeeded actions.

I use the propertybag( http://developer.anscamobile.com/code/propertybag-class-coronasdk ) for local storage and create this default values:

[lua]propertyBag:getProperty ( “OFVC_first”, “true” ) --false after making the first OF connection
propertyBag:getProperty ( “VC_in”, “0” ) --the VC to be added at sync.
propertyBag:getProperty ( “VC_out”, “0” ) --the VC to be taken at sync. [/lua]

And then I just call my OFVC() function to sync.

[lua]--------------------------------------
– OFVC OpenFeint Virtual Currency

function OFVC()

if propertyBag:getProperty ( “OFVC_first” ) == “true” then --First time of device using OFVC

local check_OFVC_firstListener = function(event)

if event.blob ~= 0 then – if there’s previously saved online VC

propertyBag:setProperty ( “FP”, event.blob ) – replace local VC. I call it FP. I think there’s going to be some problems if users play a lot and then they have their local VC replaced. A window asking which one of the states is preferred mabe? Showing the VC and items in each account?
propertyBag:SaveToFile()

end

propertyBag:setProperty ( “OFVC_first”, “false” )
propertyBag:SaveToFile()

notification.notify(“FP From the Cloud”,“OFVC_first = false”); --just for simple device debugging

return true
end

gameNetwork.request( “downloadBlob”, “ofFP”, check_OFVC_firstListener ) – download to see if there’s any previously saved online VC

elseif propertyBag:getProperty ( “OFVC_first” ) == “false” then – Not first time using OFVC

local function cleanVC_in_out() --resets VC so we don’t double upload. Could really use the listeners for failed upload
propertyBag:setProperty ( “VC_in”, “0” )
propertyBag:setProperty ( “VC_out”, “0” )
propertyBag:SaveToFile()

end

–We use updatedINOUT to added it to our downloaded VC.
local updatedINOUT = propertyBag:getProperty ( “VC_in” )-propertyBag:getProperty ( “VC_out” )

local updateOFVCListener = function(event)

local updatedOFVC = event.blob + updatedINOUT --We add(in) and take(out) VC to end up with the same local and online VC.

if updatedINOUT > 0 then

gameNetwork.request( “uploadBlob”, “ofFP”, updatedOFVC )

performAfterDelay( 0.2, cleanVC_in_out, 1, true, “cleanVC_in_out”) – This should only be called if the upload was succesful. Which is very likely to happen when updateOFVCListener is only called once the downloadBlob is done.

notification.notify(“OpenFeint saved”,“your VC is saved in your OF account!”);
end

return true
end
gameNetwork.request( “downloadBlob”, “ofFP”, updateOFVCListener ) --1. Download total VC from OF. I call it ofFP.

end–OFVC_first

end --OFVC function[/lua]

So imagine this scenario:

  1. You download the game, login into OF and make VC=250.
  2. You delete the game, lose local info and then reinstall.
  3. You login into OpenFeint, download.Blob updates your local VC to 250.
    – I realize here we should maybe ask the user if they want to recover VC from online backup and lose everything else.
  4. You play offline, and get VC_in=200 from playing or IAP, and VC_out=150 (saved with propertybag) from buying items.
    So your localVC= 250 +200-150 =300
  5. OFVC function downloads the previous VC=250 and adds up 200-150=50. Then uploads.Blob the new 300VC. We don’t upload the total local VC, so we don’t lose VC gained from other devices(Pad). I still don’t update the localVC if this happens, we need the option to set listeners for both failed and succeded uploads of blobs.
    I’m missing many scenarios, It would be really helpful if I could get feedback on several problems that may occur given certain actions.

PS. Using http://developer.anscamobile.com/code/notification-popup for notifications
[import]uid: 10426 topic_id: 13920 reply_id: 58492[/import]