Skip to content

Paywalls: fix PaywallViewControllerDelegate access from Objective-C#3510

Merged
NachoSoto merged 1 commit into
RevenueCat:mainfrom
noncenz:main
Dec 10, 2023
Merged

Paywalls: fix PaywallViewControllerDelegate access from Objective-C#3510
NachoSoto merged 1 commit into
RevenueCat:mainfrom
noncenz:main

Conversation

@noncenz

@noncenz noncenz commented Dec 10, 2023

Copy link
Copy Markdown
Contributor

Public variables must be exposed with @objc to be accessible outside of Swift. This change is necessary to set delegate from host project so that we may dismiss the paywall.

Checklist

  • If applicable, unit tests
  • If applicable, create follow-up issues for purchases-android and hybrids

Motivation

Paywall doesn't seem to be usable in an Objective-C project as there is no way to receive the callback to drop the paywall other than by setting a delegate.

Description

Added code to expose the public variable delegate in PaywallViewController to Objective-C.
Tested by setting delegate and receiving delegate method callbacks in Obj-C code.

Public variables must be exposed with `@objc` to be accessible outside of Swift. This change is necessary to set delegate from host project so that we may dismiss the paywall.

@NachoSoto NachoSoto left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!! 🙏

@NachoSoto NachoSoto merged commit b946db9 into RevenueCat:main Dec 10, 2023
NachoSoto pushed a commit that referenced this pull request Dec 12, 2023
**This is an automatic release.**

### RevenueCatUI
* `Paywalls`: improve image caching (#3498) via NachoSoto (@NachoSoto)
* `Paywalls`: change style of CTA button to be consistent with other
platforms (#3507) via NachoSoto (@NachoSoto)
* `Paywalls`: open footer links on Safari on Catalyst (#3508) via
NachoSoto (@NachoSoto)
* `Paywalls`: fix compilation on Xcode < 14.3 (#3513) via NachoSoto
(@NachoSoto)
* Fix typo in zh-Hans localization of RevenueCatUI (#3512) via Francis
Feng (@francisfeng)
* `Paywalls`: fix PaywallViewControllerDelegate access from Objective-C
(#3510) via noncenz (@noncenz)
* `Paywalls`: open Terms and Privacy Policy links in-app (#3475) via
Andy Boedo (@aboedo)
* `Paywalls`: fix empty description when using `custom` package type and
`{{ sub_period }}` (#3495) via Andy Boedo (@aboedo)
* `Paywalls`: use `HEIC` images (#3496) via NachoSoto (@NachoSoto)
* Paywalls: disable the close button when an action is in progress
(#3474) via Andy Boedo (@aboedo)
* `Paywalls`: adjusted German translations (#3476) via Tensei (@tensei)
* Paywalls: Improve Chinese localization (#3489) via Andy Boedo
(@aboedo)
### Other Changes
* `CircleCI`: add git credentials to snapshot generation (#3506) via
NachoSoto (@NachoSoto)
* `StoreProduct`: improve `priceFormatter` documentation (#3500) via
NachoSoto (@NachoSoto)
* `Paywalls`: fix tests (#3499) via NachoSoto (@NachoSoto)
* `Optimization`: changed `first` to `first(where:)` (#3467) via
NachoSoto (@NachoSoto)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants