mirror of
https://github.com/RevenueCat/purchases-ios
synced 2026-11-11 22:55:55 +05:45
Rename internal SSV symbols, URL and metric to RewardVerification (#6667)
* Rename internal AdMobSSV symbols, URL and metric to RewardVerification Renames the internal AdMobSSV* types and SPI introduced in #6641 to RewardVerification* so the wording stays adapter-agnostic. Also renames the backend URL path and the client-side metric to match, so the SPI is provider-agnostic end to end. Renames: - Sources/Ads/AdMobSSV/ -> Sources/Ads/RewardVerification/ - AdMobSSVPollStatus -> RewardVerificationPollStatus - RewardVerificationPollStatus.validated -> .verified - AdMobSSVStatusResponse -> RewardVerificationStatusResponse - RewardVerificationStatusResponse.Status.validated -> .verified (the decoder still accepts the legacy "validated" wire value during the rollout window; covered by a new decoder unit test) - AdMobSSVStatusCallback -> RewardVerificationStatusCallback - GetAdMobSSVStatusOperation -> GetRewardVerificationStatusOperation - AdsAPI.getAdMobSSVStatus -> getRewardVerificationStatus - Purchases.pollAdMobSSVStatus -> pollRewardVerificationStatus - HTTPRequest.Path.adMobSSVStatus -> .rewardVerificationStatus - URL path: /ads/admob/ssv/{tx} -> /ads/reward_verifications/{tx} - Metric name: get_admob_ssv_status -> get_reward_verification_status - BackendErrorStrings.unknown_admob_ssv_status -> .unknown_reward_verification_status - Test files, test methods and snapshot artifacts renamed to match. - Xcode project file references updated in lockstep. * Drop legacy `validated` wire-value compat in RewardVerification decoder The `RewardVerificationStatusResponse` decoder was accepting both `"verified"` and the legacy `"validated"` status from the backend as a backwards-compat hedge during rollout. The endpoint has not been shipped and the SDK has no public entry point that polls it yet, so there is no compatibility window to preserve — the decoder can require `"verified"` outright. While here, simplify the decoder to look up known cases via `Status(rawValue:)` instead of a string-literal switch, so adding a future case can't silently drift from the enum. Removes the corresponding `testDecodesLegacyValidatedWireValueAsVerified` test. Existing coverage for `verified`, `pending`, `failed`, and the `unknown` fallback (with the `Logger.warn` assertion) is unchanged. * Update Sources/Purchasing/Purchases/Purchases.swift Co-authored-by: Antonio Pallares <ajpallares@users.noreply.github.com> * test: assert warning is logged when decoding literal "unknown" status Address review feedback: cover the case where the backend sends the literal "unknown" wire value, which still falls through the unmapped-status branch and should emit a warning. --------- Co-authored-by: Antonio Pallares <ajpallares@users.noreply.github.com>
This commit is contained in:
1 parent
5ddd825249
commit
7d7d584634
211 files changed
+2967
-2881
No files matched your search
@@ -107,7 +107,7 @@ extension HTTPRequest {
|
||||
case postRedeemWebPurchase
|
||||
case postCreateTicket
|
||||
case isPurchaseAllowedByRestoreBehavior(appUserID: String)
|
||||
case adMobSSVStatus(appUserID: String, clientTransactionID: String)
|
||||
case rewardVerificationStatus(appUserID: String, clientTransactionID: String)
|
||||
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ extension HTTPRequest.Path: HTTPRequestPath {
|
||||
.appHealthReport,
|
||||
.postCreateTicket,
|
||||
.isPurchaseAllowedByRestoreBehavior,
|
||||
.adMobSSVStatus:
|
||||
.rewardVerificationStatus:
|
||||
return true
|
||||
|
||||
case .health,
|
||||
@@ -223,7 +223,7 @@ extension HTTPRequest.Path: HTTPRequestPath {
|
||||
.appHealthReport,
|
||||
.postCreateTicket,
|
||||
.isPurchaseAllowedByRestoreBehavior,
|
||||
.adMobSSVStatus:
|
||||
.rewardVerificationStatus:
|
||||
return true
|
||||
case .health,
|
||||
.appHealthReportAvailability:
|
||||
@@ -254,7 +254,7 @@ extension HTTPRequest.Path: HTTPRequestPath {
|
||||
.getCustomerCenterConfig,
|
||||
.postCreateTicket:
|
||||
return false
|
||||
case .adMobSSVStatus:
|
||||
case .rewardVerificationStatus:
|
||||
return true
|
||||
}
|
||||
}
|
||||
@@ -268,7 +268,7 @@ extension HTTPRequest.Path: HTTPRequestPath {
|
||||
.health,
|
||||
.appHealthReportAvailability,
|
||||
.isPurchaseAllowedByRestoreBehavior,
|
||||
.adMobSSVStatus:
|
||||
.rewardVerificationStatus:
|
||||
return true
|
||||
case .getWorkflow,
|
||||
.getOfferings,
|
||||
@@ -348,8 +348,8 @@ extension HTTPRequest.Path: HTTPRequestPath {
|
||||
case let .isPurchaseAllowedByRestoreBehavior(appUserID):
|
||||
return "subscribers/\(Self.escape(appUserID))/restore/eligibility"
|
||||
|
||||
case let .adMobSSVStatus(appUserID, clientTransactionID):
|
||||
return "subscribers/\(Self.escape(appUserID))/ads/admob/ssv/\(Self.escape(clientTransactionID))"
|
||||
case let .rewardVerificationStatus(appUserID, clientTransactionID):
|
||||
return "subscribers/\(Self.escape(appUserID))/ads/reward_verifications/\(Self.escape(clientTransactionID))"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -411,8 +411,8 @@ extension HTTPRequest.Path: HTTPRequestPath {
|
||||
case .isPurchaseAllowedByRestoreBehavior:
|
||||
return "post_restore_eligibility"
|
||||
|
||||
case .adMobSSVStatus:
|
||||
return "get_admob_ssv_status"
|
||||
case .rewardVerificationStatus:
|
||||
return "get_reward_verification_status"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user