-
Notifications
You must be signed in to change notification settings - Fork 319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Package.presentedOfferingContext
#3690
New Package.presentedOfferingContext
#3690
Conversation
7984c51
to
7d1d7ce
Compare
presented_offering_identifier
to an objectpresented_offering_identifier
to PresentedOfferingContext
RevenueCat.xcodeproj/xcshareddata/xcschemes/BackendIntegrationTests.xcscheme
Outdated
Show resolved
Hide resolved
super.init() | ||
} | ||
|
||
public override func isEqual(_ object: Any?) -> Bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 PresentedOfferingContext
presented_offering_identifier
to PresentedOfferingContext
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add this to the Swift/Obj-C API testers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OMG, how did I forget...
Purchases.shared.cachePresentedOfferingIdentifier( | ||
offering.identifier, | ||
Purchases.shared.cachePresentedOfferingContext( | ||
PresentedOfferingContext(offeringIdentifier: offering.identifier), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 PresentedOfferingContext
Package.presentedOfferingContext
@implementation RCPresentOfferingContextAPI | ||
|
||
+ (void)checkAPI { | ||
RCPresentedOfferingContext *poc; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't used?
Tests/APITesters/SwiftAPITester/SwiftAPITester/PresentedOfferingContextAPI.swift
Outdated
Show resolved
Hide resolved
private var context: PresentedOfferingContext! | ||
func checkPresentedOfferingContextAPI() { | ||
let oID: String = context.offeringIdentifier | ||
|
||
print(context!, oID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Tests/APITesters/CustomEntitlementComputationSwiftAPITester/SwiftAPITester/main.swift
Show resolved
Hide resolved
### 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
Package
Description
offeringIdentifier: String
onPackage
with newpresentedOfferingContext: PresentedOfferingContext
offeringIdentifier: String