In-App Purchase Tutorial: Auto-Renewable Subscriptions | raywenderlich.com

Auto-renewable subscriptions provide a way of offering your users continuous access to your app’s renewing content – providing them with a great user experience and access to content they care about, and you with an appealing business model.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/1458378-in-app-purchase-tutorial-auto-renewable-subscriptions

This is a great tutorial for the frontend of the app, but now we need to see how the server side behavies, e.g: i have this question, can anybody help? ios - How to associate apple payment notification with my custom payment records? - Stack Overflow

@ronyr Can you please help with this when you get a chance? Thank you - much appreciated! :]

Hey! Really sorry for the delayed response. This tutorial indeed focuses on the app’s side of IAP auto-renewable subscriptions. The server side of the story is its own topic and unfortunately I’m more of a client-side person… :] The links for the receipt validation documentation in the tutorial itself are a good place to start. Sorry I can’t offer more help…

This tutorial is a bit incomplete, because it assumes someone who subscribes to a product gets access to lifetime. I.e. it does not handle cancellations, non-renewals, expired subscriptions, and all these other corner cases causing the subscription to end.

I understand that the server component is hard, so maybe you should include some stubs for verifying the receipt using your server and mark them as TODO, or use a client library to verify (such as SwiftyStoreKit).

I ended up following the tutorial, thought I was ready to ship, but then noticed the whole renewals / cancellations / expired part was missing, so ended up using SwiftyStoreKit in the end.

I would at least mention these unhandled cases in the ‘where to go from here’ section. I could see a newbie getting lost after reading this tutorial and shipping subscription without these unhandled cases in mind.

If my iphone donot have any itunes account logged in then it is not being redirected to add payment methods page to enter card details.

Hi,
Thanks for this great tutorial. I have an issue with in-app purchases promotions on the app store. have submitted an in-App purchase item for app store promotion, everything approved and fine, But there is a yellow box with this warning:

These in-app purchases can’t be promoted on the App Store because your latest approved binary doesn’t include the SKPaymentTransactionObserver method.

I am sure I have added SKPaymentTransactionObserver method in my code, for making sure I have added in two places one in IAPManager class and another in main ViewController
Here is a screenshot:

How should I fix this issue?
Thank you

@ronyr Can you please help with this when you get a chance? Thank you - much appreciated! :]

Hey momeks,
This may be a silly question but did the are you sure the version of your code containing the SKPaymentTransactionObserver method is already approved by Apple? If you updated your code but the newest binary hasn’t been approved by Apple yet, this would explain the warning you see…

I used SwiftyStoreKit and the problem is gone :slight_smile:

Hi, ronyr I’ve open-sourced a server-side solution for App Store subscriptions written in Go. It combines Apple’s server-to-server notifications with active polling. I’m hoping it could be really helpful for the community.

What is the best way for me to share this with the raywenderlich community? Would it make sense to collaborate on a tutorial?

So you decided to tell us how to have a single level (which is actual the default):

Drag one on top of the other to set them at the same level.

but didn’t think of telling us how to create another level?! :exploding_head:

https://twitter.com/Revolt666/status/1169544109922668544

@ronyr Do you have any feedback about this? Thank you - much appreciated! :]

Are transactions associated with a auto-renewable subscription removed after the expiration date from the list of transactions that can be obtained using the restoreCompletedTransactions() method?

In its simplest implementation, is it possible to manage application content associated with a auto-renewable subscription without using Validating Receipts? And using only the result of the restoreCompletedTransactions() method?

@ronyr Can you please help with this when you get a chance? Thank you - much appreciated! :]

I keep getting this error, Transaction Error: Cannot connect to iTunes Store. I’ve worked all day trying so many different things, so many different suggestions that are online but cannot rectify the problem. My IAP does show up fine, but I can’t purchase it. I am using a sandbox user.

In a real-life application, you should always validate receipts. It’s the safest way to go.

I assume this means you’ve already made sure none of your contracts expired and that the details of your sandbox user are correct, etc…

Unfortunately Apple’s IAP sandbox environment has been known to be not 100% reliable. I’d try to maybe generate new sandbox users and even IAPs, if you haven’t tried that already…

Yeah, I’ve tried it all. I’m using an iPhone 6. Today I will try with my friend’s iPhone 7.

This tutorial is more than six months old so questions are no longer supported at the moment for it. Thank you!