Skip to main content
Inspiring
April 7, 2014
Question

InApp purchase really basic question

  • April 7, 2014
  • 1 reply
  • 1286 views

Hi there,

I'm setting up inapp purchasing for the first time and have got a really basic question :-

After a purchase (via an ANE) do you normally save a flag somewhere to indicate that a particular item has been purchased and then check this flag at startup ? i.e. you only go near the actual purchase ANE when buying/restoring.

Aaaand assuming this is the case where do you normally save the flag ?

I would normally use a SharedObject - but there is a bug floating around the place whereby in certain conditions there is a problem flushing the SharedObject.

(see http://forums.adobe.com/message/6142146#6142146 and https://bugbase.adobe.com/index.cfm?event=bug&id=3711301).

Many thanks !

This topic has been closed for replies.

1 reply

Colin Holgate
Inspiring
April 7, 2014

Yes you would use a sharedobject, and for the moment you can deal with the writing when storage is low problem by enabling the purchased features in those cases. That does mean that a clever user could fill up their device and then get your paid for features for free, but that may be better than not letting them have features that they have already paid for.

The other way to handle it is to put up a message saying that they need to clear some space, but even that sounds like it’s your app that is causing the problem.

BTW< it’s not just flushing sharedobjects that are the problem, you can’t read an existing sharedobject, and you can’t write other kinds of files.

Here’s the bug report, if you want to go and vote for it:

https://bugbase.adobe.com/index.cfm?event=bug&id=3711301

Inspiring
April 7, 2014

Thanks so much Colin. I hadn't realised that there was a problem on reading ... or on other kinds of files. I've voted for the bug (a little while ago) - it seems as though there may be some other combination of factors involved beyond the amount of storage as the guys seem to have problems recreating it. Looks like it's all gone a bit quiet on the bug report - is that normal ?

So you'd try a read (check if they've bought the IAPs) and then a flush of the shared object when the app starts and try and catch the error ? And if the error is thrown, play safe and allow access to any restricted content.

It sounds like the best work around - as it's probably better that way than annoying some user who'd completed an IAP, but is unable to use it due to storage problems.

One other thing ... any preference for Milkman games vs Distriqt ??? Both look pretty solid - toss a coin ?

Colin Holgate
Inspiring
April 7, 2014

Yes, to what you said about the approach with sharedobjects.

I’m using Milkman for Google and Apple in-app purchasing. I didn’t know about the Disriqt ANEs until later, when I was trying to figure out local notifications. I have those too now, but no particular reason to change away from the Milkman one. I also use Milkman’s GoViral ANE.

If you don’t own any ANEs, and Distriqt have what you need, then you might as well go with them. They are extremely responsive when you send them emails.

Note that whichever one you use, for Amazon you will have to use the Amazon in-app ANE.