Solved

How to implement 2 'annual' subscription packages? (SwiftUI)

  • 30 December 2021
  • 3 replies
  • 195 views

Badge +3

Apologies if this is a newbie question, but I’m struggling with implementing what I consider a rather simple auto-renewable subscription offering consisting of two packages on iOS with SwiftUI:

  • Annual Individual Plan (family sharing disabled)
  • Annual Family Plan (family sharing enabled)

When I create the second package, RC refuses to create it, because the ‘Annual’ identifier is already taken.

I solved it temporarily with a custom identifier (“Annual Family”), but RC does not automatically recognise the subscription length (annual) and throws WARN: ⚠️ Unknown subscription length for package:default, ignoring.

Any advice on how to implement the above scenario (two annual packages) is much appreciated, thank you!

icon

Best answer by sharif 10 January 2022, 18:28

View original

3 replies

Userlevel 5
Badge +9

You can only have one of each type of labeled package (annual, monthly, weekly, etc.) per offering. So a package can only have one iOS product with the “annual” label. In your case you’ll want to use a custom package for one of the annual plans. The one that you choose to label as “annual” can be what you consider as the “default” annual package. Alternatively, you can:

  1. Create both as custom packages if it doesn’t make sense to label just one as “annual”.
  2. Create two separate offerings, one for the individual plan and one for the family plan.

Using custom packages shouldn’t make your app less dynamic - you can still iterate over the available packages in an offering and display them on your paywall. Just check the underlying product’s duration if your paywall needs that info.

Badge +3

You can only have one of each type of labeled package (annual, monthly, weekly, etc.) per offering. So a package can only have one iOS product with the “annual” label. In your case you’ll want to use a custom package for one of the annual plans. The one that you choose to label as “annual” can be what you consider as the “default” annual package. Alternatively, you can:

  1. Create both as custom packages if it doesn’t make sense to label just one as “annual”.
  2. Create two separate offerings, one for the individual plan and one for the family plan.

Using custom packages shouldn’t make your app less dynamic - you can still iterate over the available packages in an offering and display them on your paywall. Just check the underlying product’s duration if your paywall needs that info.

Thank you. Yes, everything appears to be working fine with the custom identifier. I just wanted to silence the warning.

Badge +1

Is it ok to have that warning in the console? Will things break?

Unknown subscription length for package 'default'

 

I have that now and I have two packages, one the default Annual and the other AnnualFamily. Both set to be annual. They appear fine in my UI when I iterate over the packages.

Reply