autoRenewPreference
The auto-renewable subscripton product that renews at the next billing cycle.
Declaration
var autoRenewPreference: Product? { get }Discussion
Use the autoRenewPreference property to identify the subscription that renews in the next billing cycle, if there is one. The property is nil if the customer doesn’t have an auto-renewable subscription that renews in the next billing period. This indicates that the customer turned off the auto-renew preference, or that they don’t have a current subscription.
Display the subscription in the auto-renew preference only if it appears in the options or sections arrays. However, disable its subscribe() control so the customer doesn’t try to subscribe to it again, to prevent a system dialog that explains that the customer is already subscribed. The following code example shows how to check for the auto-renew preference and disable the subscribe functionality:
ForEach(configuration.options) { option in
Button(option.displayName, action: option.subscribe)
.disabled(option.id == configuration.autoRenewPreference?.id)
}