In app purchase dynamic add items from server - ios

I'm working on a singing app where people can purchase both our currency and the background music for a song. It's obvious that the currency is in consumable type however I'm confused on the the background music (or beats) because I've the following conditions.
The background music has to be purchased with in app purchase , not in our currency (we have agreement with the music provider).
There may be hundreds out music updated frequently , I can't manually register them in itunes connect.
3 . We have a server store these music, an ideal flow will be the user purchase a particular bg music , he can then download it into device and we also keep record on server side.
I've first thought about create a general item as "Beat" . No matter what particular BG music user buy , I will treat it as purchase of this "Beat" item. If possible what type should the item be ? or is there another way I can register these music one by one automatically? (get product id)
The app is almost done except this part . I'm kinda worry now. thanks for help in advance.

Related

In app purchase Type to be used for below requirement

I am using In-app purchases in my app. After a user pays for a video, they can view it.
The problem is that I will have a huge list of videos on my server and price will vary for each video. So, every time when I post a video, do I need to add the video in iTunes Connect or is there an easier way?
A user can watch a video only a limited number of times (say 5 times) then the user needs to pay for the video again. How do I achieve this functionality? Use consumable and restore it after 5 times? Or, is there an approach for this?
Yes, you will have to create one product per consumable that you want to sell. After the user purchases the product, send the receipt to your backend and verify and store the purchase. Then notify your client and finish the transaction. You need to make sure you keep track of the consumables that your user purchased, this might be easier if you have a login system, otherwise, things get more complicated and you might need to create a restore and alias system with random user IDs. You can read more about how the system works here
Every time you start the app you would ask your server for the purchases that the specific user has made. That way you can programmatically figure out if the user can buy to watch the same video again and let it purchase another view.
It looks to me that what you are trying to achieve is not really scalable with the way the App Store IAPs are structured right now and I would really consider a subscription model rather than a consumable based app.
There's four types of In-App purchases and only Consumable fits your requirements.
You'd have to implement the logic to keep track of how many times a user can watch a given video and update this data whenever a user makes a purchase or watches a video. Ideally, you'd use a database (local or remote) to keep track of this data.
With this implementation, you would only need to register a new SKU when you want a new combination of price and number of views.
Here's an example of possible SKUs:
com.yourorganization.5dollars5views which lets a user view the selected video 5 times for $5
com.yourorganization.5dollars10views which lets a user view the selected video 10 times for $5
com.yourorganization.10dollars5views which lets a user view the selected video 5 times for $10

How to implement InApp Purchase iOS for this Pay per view type of app?

I am working on an app that serves new movies every week and users have to buy a movie to be able to watch it. Once an user purchases a movie they can watch it any number of times. We have our own user registration and login system. I want to know do i have to create an In App Product on the iTunes Connect For every movie? We don't want to restore purchases to the different users using same apple id as well, will Apple allow that? I am really confused guys, I'd really appreciate some ideas.

Can a single in App purchase item be linked to multiple items

The application I'm developing has multiple MP3's for purchase and download. I need to know if I have to create "In-App Purchase" items for each of the MP3 items. (Each MP3 item can be priced differently, but multiple MP3s can have the same price ). Please advise on this.
You can go ahead with consumable purchases with this case. You would need to create different priced products on itunes.
So lets say there are two price variants in your app. 10rs/song and 15rs/song.
So while displaying songs you can show appropriate itunes product with them. When user purchases a song, record the transaction on your server as well, that way you will be able to track how many songs are bought by one user. And you can give access to those mp3 on other device as well if user logs in with same user id.

Non-consumable In App Purchases for Million items

Problem
I am working on app that has millions digital items . I want to implement InAppPurchases for this . So as this is digital content and only once unlock-able/Purchase-able.
What i have already done.
I tried to do this via consumable for same price tier but apple rejected my app and forcing to use **non-consumable.
How to handle the following:
1 - Do i need to create 30k in App Purchases at iTunes ???? (I read somewhere there is a limit of 10k)
2- Is there a way to reuse one in app purchase for type non-consumable.
I'd recommend to you to make user buy points, each point opens one item, and whenever user purchases an item, you record it to user's purchases list (for restore purposes).

how to synchronise "non-consumable purchase" with a "online multiplayer game server"

We are developing an online mobile multiplayer game for iOS platforms.
In our game, a player may purchase and activate the "PRO" mode to get some extra benefits.
So, we created a "non-consumable" type of in-app purchase. because, "PRO" mode is a kind of one time purchased, forever activated item. We will activate it and store the necessary data on the server, but we also need information about "who have just purchased this item form itunes game store".
My question is: how can we synchronise user's appleid and the server game account? appleid is a private variable which we can't get from SDK.
We also cannot use identifierForVendor, because someone can login and logout with different accounts on the same device.
Is there any solution is this situation? Or do you advice me to change this item as "consumable" type and handle all the works on the server side? ( I suppose this situation may also create some kind of trouble in the future )
EDIT: How can I detect that: someone delete the app, reinstall, log in to game server with different account and restore PRO mode for this account (he can easily do this probably lots of his friends who play the game) I wonder, how can I match appleuser <==> gameuser in this situation?
You can implement "restoreCompletedTransactions" method for your non-consumable items.
It's ready to use mechanic by Apple which allows user to restore purchases - you just provide a button and implementation.
Also check: https://developer.apple.com/in-app-purchase/In-App-Purchase-Guidelines.pdf
I found the solution
It is explained under the Server Product Model section.
There is an extra receipt validation process between the game server and itunes server. I get the transection receipt data with mobile app, send it to the game server, and then game server check this receipt if it is valid or not.
https://developer.apple.com/library/mac/documentation/NetworkingInternet/Conceptual/StoreKitGuide/APIOverview/OverviewoftheStoreKitAPI.html#//apple_ref/doc/uid/TP40008267-CH100-SW11

Resources