Kodeco Forums

In-App Purchases: Non-Renewing Subscriptions Tutorial

Learn to offer access to time-limited content to users and monetize your app using In-App Purchases in this Non-Renewing Subscriptions Tutorial.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/754-in-app-purchases-non-renewing-subscriptions-tutorial

Hey Owen,

Thanks for creating this tutorial!

I found 1 small issue with the tutorial that some folks may run intoā€¦

Error
unauthorized
ok

However, I fixed the issue. I think if the optional app name is created, in my case ā€œinsomniowl-svrā€, then it creates the issue above if you simply copy the value displayed in SERVER_URL. What needs to be put in place between ā€œhttps://ā€ and ā€œ.herokuapp.com/parseā€ is the app name when updating the $0.server value in the AppDelegate. Maybe not naming the app on Heroku is the way to go?

So in my case this:

$0.server = ā€œhttps://insomniowl.herokuapp.com/parseā€

Should be this:

$0.server = ā€œhttps://insomniowl-svr.herokuapp.com/parseā€

Thanks!

Hi chinjazz,

Correct. Actually all 3 Parse Config keys should be unique to your specific app. Its important to keep these secret to prevent others access to your database.

Personally, Iā€™d still name the app in Heroku. You just have to be sure to copy the Config Vars exactly from Heroku to the app.

Hey Owen!! Great tutorial, thank you so much!!! One quick question: after a user consumes a 3 month subscription, and then wants to renew at an additional 3 monthsā€¦how do you get past the Apple Error to the user ā€œYou have already purchased this productā€?

Thanks!!!

Steve

Hell slugo,
If the 3 month subscription is setup as non-renewing, the user can purchase as many subscriptions as they want. Even before they are consumed and it should just extend their total time.
If you see this error, I would check 2 things.

  • Ensure the subscription is set as non-renewing.
  • Has the user ā€˜Restored Purchasesā€™ (if app was reinstalled after a purchase).

Owen

Hi owenb,

I am implementing the non renewable purchase in my app. I am still using in sandbox mode. After I subscribe for the product, even after 3 days when I again try to subscribe the same product, it gives me an alert saying ā€˜This In-App purchase has already been bought. It will be restored for free.ā€™. I donā€™t know how I should enable user to subscribe again.

Thanks,
Prajyot

I guess the post has been old and need minor updateā€¦ and also I hope I am wrong.

As mentioned in post:
ā€œBackend as a service, or BaaS. By requiring a user to create an account in order to subscribe, you can store any necessary data, such as the subscription expiry date, against their account on the server. This method will allow you to share a subscription across all platforms simply, by requiring a user to log in.ā€

My app got rejected by Apple due to following reason :
ā€œPlease kindly keep in mind that to purchase all Non-Renewing-Subscriptions registration-login should not be required.
We noticed that we had to log in to make those purchases.
Other parts of the app that are account-based can exist behind a loginā€

I am not sure why Apple changes its guidelines all the time without notifying. Anyway my app got stuck now. My app is cross-platform cordova app and I donā€™t know whether I need to start thinking for changing my flow (as this will be a big trouble for me now).

Any suggestions or views on this will be appreciated. Thanks!!

This tutorial is more than six months old so questions regarding it are no longer supported for the moment. We will update it as soon as possible. Thank you! :]