-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Analytics swift API tests. (#11965)
- Loading branch information
Showing
2 changed files
with
18 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -50,13 +50,16 @@ - (void)appDelegateTests:(NSURL *)url { | |
|
||
- (void)consentTests:(NSURL *)url { | ||
[FIRAnalytics setConsent:@{ | ||
FIRConsentTypeAnalyticsStorage : FIRConsentStatusGranted, | ||
FIRConsentTypeAdStorage : FIRConsentStatusDenied | ||
FIRConsentTypeAdPersonalization : FIRConsentStatusGranted, | ||
FIRConsentTypeAdStorage : FIRConsentStatusDenied, | ||
FIRConsentTypeAdUserData : FIRConsentStatusGranted, | ||
FIRConsentTypeAnalyticsStorage : FIRConsentStatusDenied, | ||
}]; | ||
} | ||
|
||
- (void)onDeviceConversionTests:(NSURL *)url { | ||
[FIRAnalytics initiateOnDeviceConversionMeasurementWithEmailAddress:@"[email protected]"]; | ||
[FIRAnalytics initiateOnDeviceConversionMeasurementWithPhoneNumber:@"+15555555555"]; | ||
} | ||
|
||
- (NSArray<NSString *> *)eventNames { | ||
|
This file contains 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 |
---|---|---|
|
@@ -17,6 +17,7 @@ | |
// MARK: This file is used to evaluate the experience of using Analytics APIs in Swift. | ||
|
||
import Foundation | ||
import StoreKit | ||
import SwiftUI | ||
|
||
import FirebaseAnalyticsSwift | ||
|
@@ -43,6 +44,13 @@ final class AnalyticsAPITests { | |
} | ||
} | ||
|
||
@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *) | ||
@available(watchOS, unavailable) | ||
func logTransactionUsage() { | ||
let transaction: StoreKit.Transaction! = nil | ||
Analytics.logTransaction(transaction!) | ||
} | ||
|
||
// MARK: - AppDelegate | ||
|
||
Analytics.handleEvents(forBackgroundURLSession: "session_id", completionHandler: {}) | ||
|
@@ -56,11 +64,15 @@ final class AnalyticsAPITests { | |
|
||
// MARK: - Consent | ||
|
||
Analytics.setConsent([.analyticsStorage: .granted, .adStorage: .denied]) | ||
Analytics.setConsent([.adPersonalization: .granted, | ||
.adStorage: .denied, | ||
.adUserData: .granted, | ||
.analyticsStorage: .denied]) | ||
|
||
// MARK: - OnDeviceConversion | ||
|
||
Analytics.initiateOnDeviceConversionMeasurement(emailAddress: "[email protected]") | ||
Analytics.initiateOnDeviceConversionMeasurement(phoneNumber: "+15555555555") | ||
|
||
// MARK: - EventNames | ||
|
||
|