New Package.presentedOfferingContext#3690
Conversation
7984c51 to
7d1d7ce
Compare
presented_offering_identifier to an objectpresented_offering_identifier to PresentedOfferingContext
| super.init() | ||
| } | ||
|
|
||
| public override func isEqual(_ object: Any?) -> Bool { |
There was a problem hiding this comment.
If you override this you also need to override hash or else bad things will happen when using these in maps and sets.
presented_offering_identifier to PresentedOfferingContextpresented_offering_identifier to PresentedOfferingContext
NachoSoto
left a comment
There was a problem hiding this comment.
Just one last missing piece: api tests.
Also I'd change this to feat since it's adding a public API.
| /// | ||
| /// Stores information about how a ``Package`` was presented. | ||
| /// | ||
| @objc(RCPresentedOfferingContext) public final class PresentedOfferingContext: NSObject { |
There was a problem hiding this comment.
Can you add this to the Swift/Obj-C API testers?
There was a problem hiding this comment.
OMG, how did I forget...
| Purchases.shared.cachePresentedOfferingIdentifier( | ||
| offering.identifier, | ||
| Purchases.shared.cachePresentedOfferingContext( | ||
| PresentedOfferingContext(offeringIdentifier: offering.identifier), |
There was a problem hiding this comment.
Nit: I like to do this to avoid all the duplicated "offering context"
| PresentedOfferingContext(offeringIdentifier: offering.identifier), | |
| .init(offeringIdentifier: offering.identifier), |
|
Maybe rename the PR to
So it's a clearer callout in the release notes, since it's more than a refactor. |
presented_offering_identifier to PresentedOfferingContextPackage.presentedOfferingContext
| @implementation RCPresentOfferingContextAPI | ||
|
|
||
| + (void)checkAPI { | ||
| RCPresentedOfferingContext *poc; |
| private var context: PresentedOfferingContext! | ||
| func checkPresentedOfferingContextAPI() { | ||
| let oID: String = context.offeringIdentifier | ||
|
|
||
| print(context!, oID) |
There was a problem hiding this comment.
We've been simplifying these:
| private var context: PresentedOfferingContext! | |
| func checkPresentedOfferingContextAPI() { | |
| let oID: String = context.offeringIdentifier | |
| print(context!, oID) | |
| func checkPresentedOfferingContextAPI(context: PresentedOfferingContext! = nil) { | |
| let _: String = context.offeringIdentifier | |
| } |
|
Do you mind rebasing? I just rebased |
477ade0 to
b884022
Compare
### Motivation Allow for storing of other presented offering context on a `Package` ### Description - Replaced `offeringIdentifier: String` on `Package` with new `presentedOfferingContext: PresentedOfferingContext` - Currently it only has a `offeringIdentifier: String` - Eventually this will add new optional properties for targeting and placements
### Motivation Allow for storing of other presented offering context on a `Package` ### Description - Replaced `offeringIdentifier: String` on `Package` with new `presentedOfferingContext: PresentedOfferingContext` - Currently it only has a `offeringIdentifier: String` - Eventually this will add new optional properties for targeting and placements
This was already approved and merged into `5.0-dev` but bringing this into `4.x` (see #3690) ### Motivation Allow for storing of other presented offering context on a `Package` ### Description - Replaced `offeringIdentifier: String` on `Package` with new `presentedOfferingContext: PresentedOfferingContext` - Currently it only has a `offeringIdentifier: String` - Eventually this will add new optional properties for targeting and placements
Motivation
Allow for storing of other presented offering context on a
PackageDescription
offeringIdentifier: StringonPackagewith newpresentedOfferingContext: PresentedOfferingContextofferingIdentifier: String