Skip to content

Commit

Permalink
Update iOS 4.10.0 (and add AdServices) (#194)
Browse files Browse the repository at this point in the history
* Update iOS to 4.10.0 with AdServices

* Make public and add API test

* Fix tests

* Allow warning on pod lib lint because use of deprecated automaticAppleSearchAdsAttributionCollection

* Using setValue to set automaticAppleSearchAdsAttributionCollection

* Unused stuff

* ugh

* How did this happen
  • Loading branch information
joshdholtz authored Aug 9, 2022
1 parent 631b932 commit df3eade
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 12 deletions.
2 changes: 1 addition & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
In `ios/PurchasesHybridCommon/Podfile` replace:

```
pod 'RevenueCat', '4.9.0'
pod 'RevenueCat', '4.10.0'
```

with:
Expand Down
2 changes: 1 addition & 1 deletion PurchasesHybridCommon.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Pod::Spec.new do |s|

s.framework = 'StoreKit'

s.dependency 'RevenueCat', '4.9.1'
s.dependency 'RevenueCat', '4.10.0'
s.swift_version = '5.0'

s.ios.deployment_target = '11.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ - (void)testAPI {
}];

[RCCommonFunctionality setAutomaticAppleSearchAdsAttributionCollection:YES];
[RCCommonFunctionality enableAdServicesAttributionTokenCollection];
[RCCommonFunctionality getOfferingsWithCompletionBlock:^(NSDictionary * _Nullable offerings,
RCErrorContainer * _Nullable error) {
}];
Expand Down
4 changes: 2 additions & 2 deletions ios/PurchasesHybridCommon/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ target 'PurchasesHybridCommon' do
use_frameworks!

# Pods for PurchasesHybridCommon
pod 'RevenueCat', '4.9.1'
pod 'RevenueCat', '4.10.0'

target 'PurchasesHybridCommonTests' do
# Pods for testing
Expand All @@ -28,5 +28,5 @@ target 'ObjCAPITester' do
platform :ios, '11.0'
use_frameworks!

pod 'RevenueCat', '4.9.1'
pod 'RevenueCat', '4.10.0'
end
8 changes: 4 additions & 4 deletions ios/PurchasesHybridCommon/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
PODS:
- Nimble (10.0.0)
- Quick (5.0.1)
- RevenueCat (4.9.0)
- RevenueCat (4.10.0)
- SnapshotTesting (1.9.0)

DEPENDENCIES:
- Nimble
- Quick
- RevenueCat (= 4.9.0)
- RevenueCat (= 4.10.0)
- "SnapshotTesting (from `git@github.com:pointfreeco/swift-snapshot-testing.git`, branch `main`)"

SPEC REPOS:
Expand All @@ -29,9 +29,9 @@ CHECKOUT OPTIONS:
SPEC CHECKSUMS:
Nimble: 5316ef81a170ce87baf72dd961f22f89a602ff84
Quick: 749aa754fd1e7d984f2000fe051e18a3a9809179
RevenueCat: d5ec5e2944eedce83497218f0dc01eda546dd7a7
RevenueCat: 1fd18820548e7c38677055a8ffc4aac530fa1851
SnapshotTesting: 6141c48b6aa76ead61431ca665c14ab9a066c53b

PODFILE CHECKSUM: 1e06780152d2843b1ed121c20897565b8bc24975
PODFILE CHECKSUM: c5e40eb73d0ccddfd47781909856edc6f8f80dea

COCOAPODS: 1.11.3
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,15 @@ import RevenueCat
}

@objc public static func setAutomaticAppleSearchAdsAttributionCollection(_ enabled: Bool) {
Purchases.automaticAppleSearchAdsAttributionCollection = enabled
// Using `setValue` because `automaticAppleSearchAdsAttributionCollection` is now deprecated and we get a warning
Purchases.setValue(enabled, forKey: "automaticAppleSearchAdsAttributionCollection")
}

@available(iOS 14.3, macOS 11.1, macCatalyst 14.3, *)
@available(tvOS, unavailable)
@available(watchOS, unavailable)
@objc public static func enableAdServicesAttributionTokenCollection() {
Purchases.shared.attribution.enableAdServicesAttributionTokenCollection()
}

@objc public static func setFinishTransactions(_ finishTransactions: Bool) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,18 @@ class MockPurchases: Purchases {
appUserID: nil
)

let subscriberAttributes = Attribution(subscriberAttributesManager: subscriberAttributesManager,
currentUserProvider: identityManager)

let attributionPoster: AttributionPoster = AttributionPoster(
deviceCache: deviceCache,
currentUserProvider: identityManager,
backend: backend,
attributionFetcher: attributionFetcher,
subscriberAttributesManager: subscriberAttributesManager)

let subscriberAttributes = Attribution(
subscriberAttributesManager: subscriberAttributesManager,
currentUserProvider: identityManager,
attributionPoster: attributionPoster)

let storeKitWrapper: StoreKitWrapper = StoreKitWrapper()
let notificationCenter: NotificationCenter = NotificationCenter.default

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ class PurchasesHybridCommonTests: QuickSpec {

override func spec() {

context("automaticAppleSearchAdsAttributionCollection") {
it("sets automaticAppleSearchAdsAttributionCollection using setValue") {
// sets Purchases.automaticAppleSearchAdsAttributionCollection dynamically
// through setValue
expect(Purchases.automaticAppleSearchAdsAttributionCollection) == false
CommonFunctionality.setAutomaticAppleSearchAdsAttributionCollection(true)
expect(Purchases.automaticAppleSearchAdsAttributionCollection) == true
}
}

context("proxy url string") {
it("parses the string and sets the url if valid") {
let urlString = "https://revenuecat.com"
Expand Down

0 comments on commit df3eade

Please sign in to comment.