-
Notifications
You must be signed in to change notification settings - Fork 416
Add purchase_source to receipt posts for non-paywall Customer Center purchases
#6376
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
Draft
ajpallares
wants to merge
66
commits into
main
Choose a base branch
from
pallares/presented-offering-source
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 53 commits
Commits
Show all changes
66 commits
Select commit
Hold shift + click to select a range
16e6383
Track customer center purchases
facumenzella 05b03df
simplified logic
facumenzella 5205282
add spiinternal
facumenzella 37e9ddd
Merge branch 'main' into feat/paywall-source
facumenzella f6aef6d
fixed tests
facumenzella a9885c2
pod lib lint
facumenzella ba5e231
Add PaywallSource.swift to RevenueCatUI target
ajpallares 61a4904
Remove unnecessary `@_spi(Internal)` attributes
ajpallares eaf2a30
Simplified Customer Center paywall source to `customer_center`
ajpallares 75fa191
Remove redundant `source` parameter from `track` method
ajpallares aa70dc4
Update snapshot files
ajpallares fd1c9a6
Move PaywallSource to RevenueCat module as @_spi(Internal) enum
ajpallares 3cb71dd
Fix: pass `paywallSource` to `PaywallEvent` creation
ajpallares a73b3e3
Cleanup unnecessary diff
ajpallares 7bb804f
Revert changes to Examples/rc-maestro/rc-maestro/Resources/StoreKit/S…
ajpallares 225d51f
Remove redundant source parameter from trackPaywallImpression
ajpallares f296de3
Undo changes to RevenueCatUI/Purchasing/MockPurchases.swift
ajpallares a1e3649
Undo changes to RevenueCatUI/Purchasing/PurchaseHandler.swift
ajpallares 35f2098
Remove presentedOfferingSource from receipt posting
ajpallares c19f27d
Remove trailing newlines from snapshot JSON files
ajpallares d6cc5eb
Simplification
ajpallares b27f274
Remove trailing newlines from OfferingContext snapshot files
ajpallares 09734f4
Change Paywall.source type from String? to PaywallSource?
ajpallares 7505fa6
Revert cosmetic changes to PurchaseHandler+TestData.swift
ajpallares db71ef5
Change EventsRequest.PaywallEvent.source type from String? to Paywall…
ajpallares a3c02c3
Cleanup
ajpallares 274efe2
Revert cosmetic changes in AsyncPurchaseHandler init
ajpallares 52370ce
Add snapshot test for PaywallEvent source serialization
ajpallares 58b2931
Merge remote-tracking branch 'origin/main' into feat/paywall-source
ajpallares c4efa7f
Update deprecation messages for PaywallEvent.Data inits
ajpallares 8cd9955
Fix compilation error, add source: nil test coverage, fix snapshot ne…
ajpallares fe45b30
Fix snapshot test trailing newlines causing test failures
ajpallares bf43308
Fix exhaustive switch on PaywallEvent in PurchaseHandlerTests
ajpallares 71593a0
Add presentedOfferingSource to receipt posting
ajpallares 377f9ac
Add PurchaseSource tracking for non-paywall purchases
ajpallares 2a9f152
Use typed PurchaseSource in CachedPurchaseSource and PurchasedTransac…
ajpallares 03bcbff
Persist presentedOfferingSource in LocalTransactionMetadata
ajpallares e2a9926
[skip ci] Generating new test snapshots (#6377)
RCGitBot bbbd391
[skip ci] Generating new test snapshots (#6378)
RCGitBot 3e61256
[skip ci] Generating new test snapshots (#6381)
RCGitBot e39605c
[skip ci] Generating new test snapshots (#6385)
RCGitBot f733110
[skip ci] Generating new test snapshots (#6384)
RCGitBot 744cdee
[skip ci] Generating new test snapshots (#6382)
RCGitBot c2ecdbc
[skip ci] Generating new test snapshots (#6383)
RCGitBot 4988cdd
[skip ci] Generating new test snapshots (#6379)
RCGitBot 125310e
Merge branch 'main' into feat/paywall-source
ajpallares 213d58e
Merge branch 'feat/paywall-source' into pallares/presented-offering-s…
ajpallares 6b5e41c
Add missing `cachePurchaseSource` call
ajpallares f9e5d15
Generating new test snapshots for `pallares/presented-offering-source…
RCGitBot d119a2e
Merge branch 'main' into feat/paywall-source
ajpallares 919b581
Merge branch 'feat/paywall-source' into pallares/presented-offering-s…
ajpallares 2a906a2
Merge branch 'main' into feat/paywall-source
ajpallares 84c0a8e
Merge branch 'feat/paywall-source' into pallares/presented-offering-s…
ajpallares a03e43c
Rename presentedOfferingSource to purchaseSource
ajpallares 84c30a1
Fix lint and snapshot test failures
ajpallares 7cd3856
Merge branch 'main' into feat/paywall-source
ajpallares 6b0f5c9
Merge branch 'feat/paywall-source' into pallares/presented-offering-s…
ajpallares 1e98533
Cache purchase source for Customer Center change plans flow
ajpallares a63a4f6
Fix PaywallSource being dropped by withPurchaseInfo
ajpallares 133977f
Merge branch 'feat/paywall-source' into pallares/presented-offering-s…
ajpallares cc0ac0c
Merge branch 'main' into feat/paywall-source
ajpallares 7cbd17a
fix: Add missing `source` parameter to PaywallEvent.Data init in tests
ajpallares c432e4b
Merge branch 'main' into feat/paywall-source
ajpallares 16cd10b
Merge branch 'main' into feat/paywall-source
ajpallares 39e5e77
Merge branch 'feat/paywall-source' into pallares/presented-offering-s…
ajpallares ee5fc2a
Merge remote-tracking branch 'origin/main' into pallares/presented-of…
ajpallares File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| // | ||
| // PaywallSourceEnvironment.swift | ||
| // | ||
| // | ||
| // Created by RevenueCat on 2/26/25. | ||
| // | ||
|
|
||
| #if canImport(SwiftUI) | ||
|
|
||
| @_spi(Internal) import RevenueCat | ||
| import SwiftUI | ||
|
|
||
| #if !os(tvOS) | ||
|
|
||
| @available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *) | ||
| private struct PaywallSourceKey: EnvironmentKey { | ||
|
|
||
| static let defaultValue: PaywallSource? = nil | ||
|
|
||
| } | ||
|
|
||
| @available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *) | ||
| extension EnvironmentValues { | ||
|
|
||
| /// The optional paywall source available in the current environment. | ||
| var paywallSource: PaywallSource? { | ||
| get { self[PaywallSourceKey.self] } | ||
| set { self[PaywallSourceKey.self] = newValue } | ||
| } | ||
| } | ||
|
|
||
| @available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *) | ||
| extension View { | ||
|
|
||
| /// Associates the provided paywall source with this view hierarchy so downstream paywall presentations can read it. | ||
| func paywallSource(_ source: PaywallSource?) -> some View { | ||
| self.environment(\.paywallSource, source) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| #endif | ||
|
|
||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| // | ||
| // Copyright RevenueCat Inc. All Rights Reserved. | ||
| // | ||
| // Licensed under the MIT License (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // https://opensource.org/licenses/MIT | ||
| // | ||
| // PaywallSource.swift | ||
| // | ||
| // Created by RevenueCat on 2/26/25. | ||
|
|
||
| import Foundation | ||
|
|
||
| /// Identifies where a paywall was presented from so that backend analytics can classify the event. | ||
| @_spi(Internal) public enum PaywallSource: String, Sendable, Codable { | ||
|
|
||
| /// The paywall was presented from Customer Center. | ||
| case customerCenter = "customer_center" | ||
|
|
||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.