I am implementing an in app purchase subscription model.
Let's say I have an iPhone 3 user which starts the whole purchase process from my application and then exits the application only to continue and fill his app store credentials outside of my app until he is done with the purchase.
How can my app know that the transaction was made upon launch?
Also in case I do get this info how can I tell it is not an old purchase for an old subscription period which has already expired?
And last but not least in case the device supports multitasking and the purchase was finished while my app was in the background how will I get notified upon returning to the foreground?
Thanks
Roi
Have you read Apple's Documentation - In App Purchase Programming Guide? I believe it answers all your questions.
The - (void)recordTransaction:(SKPaymentTransaction *)transaction method takes care of most of your pains.
Once you properly implement this method,you would just have to check whether the inApp purchase is done.Rest is taken care of by the payment methods.
Thanks
Related
I am planning to use subscription (auto renew) type of in-app purchase. My idea is to allow one subscription per device. (i.e.) if someone purchase the subscription on iPhone, he shouldn't be able to use same subscription on iPad. Instead I want to force user to new subscription for other device. But from in-app purchase what i understood is that, if user subscribe for a particular item, if he tries to purchase the same thing again, app store allows to user to restore already purchased item.
As per my current setup, all the downloads will happen from a separate server and I am going to keep all the receipts and content in that server. In order to implement this particular thing, what should I do in my application? Could someone help me on this?
Also if I want to limit download of data from server using in-app purchase for only 3 device? Beyond 3 I want user to make payment via in-app purchase again? How will I do this?
Thanks
Apple's In-App Purchase Guidelines state that you must support restoring subscriptions to all of a user's devices (see page 7).
Also consider if your content is episodic (such as a TV show or magazine) because that's a requirement for using auto-renewing subscriptions. For things like time-limited access to a certain feature, like voice guidance in a navigation app, you'd need to use non-renewing subscriptions.
I am developing a application in which i have 10 items setup for in-app purchase, and also i am giving an option to restore the purchases he made, if user changes his device or may be any possible case.
I want to ask that, if user taps on "restore transactions" button from my application,then Store kit is going to return all the purchases id from his Apple id(that he purchased from other apps also) or it will return only of my application.
From the Test Account it returns only of my application purchases ids,But if i try with my apple id, but its giving me error: "This is not a Test User account.",I guess i cannot test restoreCompletedTransactions in debug mode.
So i wanted to know how its going to return the purchases id if the app is released.
Can any one help me..
Thanx...
It returns only the purchased products that belong to your application both in the sandbox mode and production mode.
We are having the issue that the app we have has an In-App purchase that unlocks some content when it is paid.
The problem is that if you reinstall the app or update it, it will be reinstalled without the unlocked content. The customer will have to go through the buying process again and it will then tell them that they already have purchased the content. Is there any way to avoid this issue so that automatically the purchased content is provided if you have already paid for it?
We have tried asking the user for his Apple ID during launch of the app and retrieve his previous payments from that, but Apple disapproves of the practice.
I may be looking at this at a different, unconventional angle but I am really looking for a widely accepted approach for this kind of thing.
Thanks.
A "Restore Purchases" button calling restoreCompletedTransactions on SKPaymentQueue is the way to go-
We considered checking this call automatically on start, or before giving the user a price for the in-app update, but the prompt for user iTunes details which appears makes this impractical, so the button is the best solution.
For that you should simply call restoreCompletedTransactions of the SKPaymentQueue on startup. That's the way apple suggests.
I submitted an iPhone app to the store that got approved, but some things with the inApp purchasing weren't working. The consequence is that the users that tried to install the inApp purchases were charged, and Apple has recorded that they already purchased the additional feature. I have fixed the issue, and I use NSUserDefaults to track whether or not a user has purchased the feature. The problem is the users that have already paid for it. Is there a way to check through Apple whether or not the feature has already been paid for?
Thanks.
See the Restoring Transactions section of the In-App Purchase guide. Specifically:
Store Kit provides built-in functionality to restore transactions for
non-consumable products, auto-renewable subscriptions and free
subscriptions. To restore transactions, your application calls the
payment queue’s restoreCompletedTransactions method. The payment queue
sends a request to the App Store to restore the transctions. In
return, the App Store generates a new restore transaction for each
transaction that was previously completed.
If it is a consumable product (it shouldn't be) then I don't think there is a way to do it via Apple.
How can I detect this situation in code:
User purchase a full version with in-app purchase.
User delete the application from iPhone.
User installed the application again
User purchases full version,
My problem is that in testing, I can see a message box saying "you already purchased...", but in the application updateTransactions not called.
In this situation I need to change to full version. How can I detect this event?
I.e., How can I know in my application that the user already purchased so I will "open" to full version?
Thanks.
Use [[SKPaymentQueue defaultQueue] restoreCompletedTransactions]. It will force your app to receive transactions again.
See docs:
Restoring transactions
- restoreCompletedTransactions