I have developed an application with Delphi XE6 including inappPurchase, I have defined the product as 'Consumable' in itunesConnect, but after purchasing one item, it won't let me buy another one.
In my application user should be able to buy 'n' number of licenses, in PurchaseProduct Method just takes productID as parameter so I need to call this method multiple times.
I thought defining another Product like as 10-Licenses would be a good idea, but there is no relation between this two Products, and ConsumeProduct Method just takes a ProductID not the number of consumtion.
Since lack of resources about that, I appreciate if some one gives me some hints, or best practices.
p.s. Is storing the number of purchased products in application good idea?
I found the solution but I don't know if it is correct or not:
I consume the product just right after purchasing, and I locally get the track of bought items.
if productquery is fill with list, actually u can consume. i put try finally end statement, and put consumeproduct after try. and it will work,
what do u mean by locally get the track of bought items?
Related
Does anyone have experience implementing multiple subscriptions model for an app? I wasn't able to find proper documentation about this topic. The most common way to create in-app subscription model is one-subscription per one-user. But I want to offer one-subscription per one-item(in my app). This means that users can create multiple subscriptions if they want to subscribe to multiple items. Each item is functionally the same.
For example, If the app is a pet location tracker and wants to track both pet A and B, the user has to subscribe to each A and B respectively. It means a total of 2 subscriptions.
Please explain it to me.
Thanks.
Never thought about such a use case, but for iOS you can create multiple subscriptions. So you could create a subscription PetA, PetB, PetC and so on. But, I think you asked for a more dynamic approach where you create a Pet subscription and the user can buy as much as he likes. As far as I know this isn't possible.
A different approach would be to create a subscription hierarchy: onePet, twoPets, threePets and so one. Your user can then up or down grade between those subs depending on how many pets he wants to track. Could get messy if you also want to offer different durations.
A third approach could be to use consumable IAPs. These can be purchased as often as the user likes, but have the disadvantage that you need to keep track of the validity period on your own and they can't be synced automatically between multiple devices.
For your pet example I would go for the second approach and offer a onePet, twoPet, threePet and a unlimitPet subscription. This is the most maintainable approach as long as you do not offer endless duration variations. Also this gets synced automatically with all devices of the user and if you like you can also support family sharing.
I have a question for a project I am working on. I am working on a RoR project in which a site is selling a single type of item, a book. The person I am creating this for does not want to deal with users creating user account to check out as the sales season is very short for this product, the purchases are done once per year, and the site only sells a single item.
I am wondering if there is something wrong with the implementation I am thinking of. What I was envisioning was a single database class called Orders. visitors to the site would simple fill out an order form with payment details through stripe and click submit. If they payment clears, the order with all the Orders information would be persisted to the DB. If the payment fails then it is not persisted and the relevant error information is displayed in using flash.
I suppose the meat of my question is; is there anything inherently 'wrong' about implementing this model without a users class and just having visitors to the site place orders?
I am a fairly new developer and this is my first big project so any feedback is appreciated!
If your requirements say that it is okay, then it is okay, if your requirements say it is not okay, then it is not okay.
There's not more to say, since only you know what your requirements are.
I have an app I'm working on that is a credits system for a store. A customer brings in items and receives a credit and then can turn around and use that credit towards certain goods in the store. I've set it up so every time a credit holder or credit is created,updated, or destroyed the event is logged. I'm wondering if there is an easy way to use the event data from the logs to create a dashboard displaying things such as X number of credits created and Y number of credits used today. This may not be the right way to go about doing this at all and if so feel free to guide me in another direction. Thanks in advance!
You should save the information into a database (in addition) to the log and operate on it in this fashion.
So for example, maybe you have a User it should be a Model and have credits which should be an integer. You can modify this value every time a transaction happens.
You can also create an associated model 'transactions' which belong_to the user and to find out transactions that happened on a certain day, you would be able to pull up all of the transactions of that user in a certain time range.
If your credits work similar to dollars and money. And your transactions are like orders, you may want to look into using the Spree gem. https://github.com/spree/spree
You definitely do not want to be reading from the logs to do very usual actions like you're describing.
I am building an online poster maker store with Ruby on Rails that gives the customer the option to either download a digital file for a generated poster or to have us print it for them and ship it to them. I am having troubles deciding where in my application to put this functionality. I am using a basic products, line_item, and cart structure.
Do I:
1) Make an option on the checkout that creates an Order if they decide to have us print the poster. If they just want the digital file it would just give them access on their user page after checkout.
2) Make a attribute on my line_item model that saves weather they want to download or print the file.
3) Something else entirely?
Thanks in advance for your help!
I believe I have found a solution! After talking to another developer friend, it hit me that the best solution might be to put all of the attributes for both printed and downloadable posters in the same products model and then expose only the information needed for each particular order.
For example,
If the order is to be printed by us, the user will be asked to fill out a shipping address form and asked what paper they want us to use. If they customer is just going to download the generated poster design these fields in the form will be hidden.
I believe that this is a much simpler solution then the two that I described above and will be the easiest to implement.
simple example of the problem:
i have an app that can download backgrounds from in-app purchase.
so i download images (or a zipped image).
now that i have it on my iphone...how can my app knows the name of the image and can load as background of the game?
what i have thought is zip of the image+downloaded.plist;
downloaded.plist is a filename that contains the name of what i have downloaded, so my app loads that plist (i know the name because is always equal) and then the rest...
but now i have to save that information in another local plist that contains all add-on downloaded...
this is a very basic example, but i can in future load levels, character...so i'd like to know how to organize work to have it more general as possible...
what is the standard method to make this?
thanks
I am not quite sure I understood your question, but here are some thoughts.
When the user buys something using iap, you know the associated product id. With that, you can map to the actual thing the user has bought (whether it is an image, a level, cash, whatever). So, you should use the product identifier to know that to give to the user.
It seems you are dealing with non-consumable products here. If you ship your app with the products inside the bundle, you can unlock them using the product id (As you said, you need to maintain a list of the unlocked files). If you need to download the products, the same applies here, you need to use the id to know which file to download.
To organize work, I would implement a store object that deals with the store kit, loads the products according to the transactions made, gives them to the user, maintains all the necessary stuff, etc. You can escale this approach to a set of classes if necessary.
On a side note, for non consumable products, you should perform several things on a server, e.g. maintain the list of products the user bought, validations, etc. You can read about this in the in-app purchases programming guide from Apple.
I hope this answers your question.
Cheers