Solved

Allow variable access in Swift SDK

  • 9 February 2024
  • 2 replies
  • 27 views

Badge +2

Hi,

 

I’m working on creating a native paywall with SwiftUI because we have a paywall design that deviates from the templates. (it’s mainly sizes and margin - footer paywalls are too tall for our use. Hope this is configurable in the future)

 

While creating a custom paywall, I wish we could still use some of the variables and localization RC offers with paywall templates. e.g., I tried to access periodName (e.g. “Annual”) via

 

package.periodNameOrIdentifier(.current)

This gives “'periodNameOrIdentifier' is inaccessible due to 'internal' protection level"

 

It seems that making ‘extension Package: VariableDataProvider’  public might allow this. Can RC support this? 

 

At a high level, the pain here is that as soon as we try to do anything custom that deviates from the template, we face reimplementing many of the conveniences RC provides. Wish there was a middle ground somehow.

icon

Best answer by Michael Fogel 13 February 2024, 18:04

View original

2 replies

Userlevel 4
Badge +6

Hey @daniel-888f34 !

 

While this is not available as of now, I will go ahead and share this with the team as a feature request so we can hopefully implement something along the lines of this in the future!

 

In the meantime, I recommend creating a custom paywall and using our normal fetching/purchasing methods to get information of your products and trigger purchases.

Badge +2

Hey Michael,

 

Thanks for looking into this!

Reply