├── CriteoAdViewer ├── Frameworks │ └── .gitkeep ├── Sources │ ├── AdViewer.png │ ├── Assets.xcassets │ │ ├── Contents.json │ │ └── AppIcon.appiconset │ │ │ ├── AdViewer-20.png │ │ │ ├── AdViewer-29.png │ │ │ ├── AdViewer-40.png │ │ │ ├── AdViewer-76.png │ │ │ ├── AdViewer-1024.png │ │ │ ├── AdViewer-20@2x.png │ │ │ ├── AdViewer-20@3x.png │ │ │ ├── AdViewer-29@2x.png │ │ │ ├── AdViewer-29@3x.png │ │ │ ├── AdViewer-40@2x.png │ │ │ ├── AdViewer-40@3x.png │ │ │ ├── AdViewer-60@2x.png │ │ │ ├── AdViewer-60@3x.png │ │ │ ├── AdViewer-76@2x.png │ │ │ └── AdViewer-83.5@2x.png │ ├── Common │ │ └── InterstitialUpdateDelegate.h │ ├── Logs │ │ ├── LogEntryViewController.swift │ │ ├── RequestLogEntry.h │ │ ├── EventLogEntry.h │ │ ├── LogEntry.h │ │ └── ResponseLogEntry.h │ ├── AdViewer-Bridging-Header.h │ ├── Standalone │ │ └── StandaloneLogger.h │ ├── AdViewer │ │ ├── AdViewBuilder.swift │ │ └── InterstitialView+ads.swift │ ├── GoogleDFP │ │ └── GoogleDFPLogger.h │ ├── NativeAd │ │ ├── CRVNativeAdView.h │ │ └── CRVNativeAdView.m │ └── Criteo │ │ └── NetworkManagerDelegate.h ├── CriteoAdViewer.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── Podfile ├── UITests │ ├── CriteoAdViewerUITests.xctestplan │ └── Info.plist └── Podfile.lock ├── .github ├── CODEOWNERS └── workflows │ └── release-cocoapods.yml ├── CriteoPublisherSdk ├── Sources │ ├── Cassette │ │ ├── .clang-format │ │ ├── Cassette-Bridging-Header.h │ │ ├── CR_CASPrivateConstants.h │ │ ├── Cassette.h │ │ ├── CR_CASInMemoryObjectQueue.h │ │ ├── CR_CASDefaultDataSerializer.h │ │ ├── CR_CASQueueFileElement.m │ │ ├── CR_CASDataSerializer.h │ │ └── CR_CASError.h │ ├── Info.plist │ ├── SKAdNetwork │ │ ├── CRSKAdNetworkInfo.m │ │ └── CR_SKAdNetworkHandler.h │ ├── Public │ │ ├── CRSKAdNetworkInfo.h │ │ ├── CRBid.h │ │ ├── CRConstants.h │ │ ├── CRAdUnit.h │ │ ├── CRRewardedAdUnit.h │ │ ├── CRInterstitialAdUnit.h │ │ ├── CRBannerAdUnit.h │ │ ├── CRNativeAdUnit.h │ │ ├── CRMediaContent.h │ │ ├── CRBannerViewDelegate.h │ │ ├── CRContextData.h │ │ ├── CRNativeAdView.h │ │ ├── CRMediaView.h │ │ ├── CRBannerView.h │ │ └── CREmailHasher.h │ ├── MRAID │ │ ├── MessageHandlers │ │ │ └── Data │ │ │ │ ├── Message │ │ │ │ ├── MRAIDPlayVideoMessage.swift │ │ │ │ └── MRAIDExpandMessage.swift │ │ │ │ └── MRAIDState.swift │ │ ├── Logging │ │ │ ├── LogLevel.swift │ │ │ ├── MRAIDLog.swift │ │ │ └── ActionRepresentable.swift │ │ ├── CRMRAIDHandlerDelegate.swift │ │ ├── CRPlacementType.swift │ │ ├── Resize │ │ │ └── MRAIDCustomClosePosition.swift │ │ ├── MRAIDFeature.swift │ │ └── OrientationProperties │ │ │ └── MRAIDDeviceOrientation.swift │ ├── Context │ │ ├── CRUserData+Internal.h │ │ ├── CRContextData+Internal.h │ │ ├── CR_UserDataHolder.m │ │ ├── CR_UserDataHolder.h │ │ ├── CR_Session.h │ │ └── CR_Session.m │ ├── Util │ │ ├── NSObject+Criteo.h │ │ ├── UIView+Criteo.h │ │ ├── NSURL+Criteo.m │ │ ├── CRLogUtil.h │ │ ├── NSURL+Criteo.h │ │ ├── NSObject+Criteo.m │ │ ├── NSString+Criteo.h │ │ ├── NSDictionary+Criteo.h │ │ ├── NSUserDefaults+Criteo.h │ │ ├── NSArray+Criteo.h │ │ ├── CRLogUtil.m │ │ ├── NSString+Criteo.m │ │ └── NSError+Criteo.h │ ├── Native │ │ ├── CR_AdChoice.h │ │ ├── CRMediaView+Internal.h │ │ ├── CR_NativeImage.h │ │ ├── CR_NativePrivacy.h │ │ ├── CR_ImageCache.h │ │ ├── CR_SafeMediaDownloader.h │ │ ├── CR_DefaultMediaDownloader.h │ │ ├── CRMediaContent.m │ │ ├── CR_NativeAdvertiser.h │ │ └── CRMediaContent+Internal.h │ ├── AppEvents │ │ └── CR_AppEvents+Internal.h │ ├── Network │ │ ├── Serializers │ │ │ ├── CR_GdprSerializer.h │ │ │ └── CR_FeedbacksSerializer.h │ │ ├── CR_URLRequest.h │ │ └── CR_NetworkManagerDelegate.h │ ├── Logging │ │ ├── CR_RemoteLogStorage.h │ │ └── CR_RemoteLogRecordSerializer.h │ ├── Configuration │ │ └── CR_RemoteConfigRequest.h │ ├── CR_CacheManager.h │ ├── CRAdUnit+Internal.h │ ├── CR_AdUnitHelper.h │ └── Feedback │ │ ├── CR_CASObjectQueue+ArraySet.h │ │ └── CR_FeedbackFeatureGuard.h ├── iTestHostApp │ ├── Assets.xcassets │ │ └── Contents.json │ ├── ViewController.h │ ├── AppDelegate.h │ ├── main.m │ └── ViewController.m ├── Tests │ ├── .swiftlint.yml │ ├── UnitTests │ │ ├── Native │ │ │ ├── image.png │ │ │ └── image.jpeg │ │ ├── Configuration │ │ │ ├── skanInvalid.bundle │ │ │ │ └── Info.plist │ │ │ └── skanValid.bundle │ │ │ │ └── Info.plist │ │ ├── Mocks │ │ │ ├── MockProtocol.swift │ │ │ └── CR_CdbResponseMock.swift │ │ └── DFPRequestClasses.h │ ├── CriteoPublisherSdkTests-Info.plist │ ├── IntegrationTests │ │ ├── NativeAd │ │ │ ├── CR_NativeAdTableViewCell.m │ │ │ └── SimpleViewController │ │ │ │ ├── CR_SafeAreaView.h │ │ │ │ └── CR_CustomNativeAdView.h │ │ ├── CR_IntegrationsTestBase.h │ │ └── NativeAssetsFromCdb.json │ ├── Utility │ │ ├── Native │ │ │ └── CR_NativeAssets+Testing.h │ │ ├── Mocks │ │ │ ├── CR_InMemoryUserDefaults.h │ │ │ ├── MockWKWebView.h │ │ │ ├── CR_SynchronousThreadManager.h │ │ │ ├── CR_URLOpenerMock.h │ │ │ ├── MockWKWebView.m │ │ │ ├── CR_DeviceInfoMock.h │ │ │ └── CR_DataProtectionConsentMock.h │ │ ├── Categories │ │ │ ├── CR_ThreadManager+Waiter.h │ │ │ ├── XCTestExpectation+Criteo.h │ │ │ ├── UIImage+Testing.h │ │ │ ├── UIView+Testing.h │ │ │ ├── CR_ThreadManager+Waiter.m │ │ │ └── NSUserDefaults+Testing.m │ │ ├── Checkers │ │ │ ├── CR_ViewCheckingHelper.h │ │ │ ├── CR_MediaDownloaderDispatchChecker.h │ │ │ ├── CR_ViewCheckingHelper.m │ │ │ └── CR_NativeLoaderDispatchChecker.h │ │ ├── MRAID │ │ │ ├── URLOpenerMock.swift │ │ │ └── CR_MRAIDUtils.swift │ │ ├── CR_DeviceInfo+Testing.h │ │ ├── CR_AssertDfp.h │ │ ├── NetworkManager │ │ │ └── HTTP │ │ │ │ └── CR_HttpContent+AdUnit.h │ │ └── CR_Timer.h │ └── CriteoPublisherSdkTests-Bridging-Header.h └── CriteoPublisherSdk.xcodeproj │ ├── project.xcworkspace │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ └── xcbaselines │ └── E1F2736C21B5F08D00A2FBFA.xcbaseline │ ├── FD24A0E4-7CC1-47CA-A6A3-E3E390A8D1D5.plist │ └── Info.plist ├── wiremock ├── cert │ ├── wiremock.jks │ └── wiremock.p12 └── mappings │ ├── error.json │ ├── standard-url.json │ ├── redirect-error.json │ ├── redirect-infinite.json │ ├── redirect-standard-url.json │ ├── redirect-appstore-url.json │ ├── redirect-n.json │ ├── display-app-store.json │ ├── vast.json │ ├── cdb_delivery_ajsphp-1cc74b69-ffcb-47ed-8591-0e011cc959ca.json │ ├── inapp-v2.json │ └── csm.json ├── tools ├── clang-format │ └── clang-format └── code-format-git-hook.sh ├── .clang-format ├── CriteoMoPubAdapterTestApp └── Sources │ └── CriteoMoPubAdapterTestApp │ ├── Assets.xcassets │ └── Contents.json │ ├── AppDelegate.h │ ├── HomePage │ └── HomePageTableViewController.h │ ├── main.m │ ├── AppDelegate.m │ └── CriteoMoPubAdapterTestApp.swift ├── fastlane ├── Pluginfile └── Appfile ├── CriteoGoogleAdapter ├── CriteoGoogleAdapter.xcodeproj │ └── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── README.md ├── Sources │ └── CriteoGoogleAdapter │ │ ├── Info.plist │ │ ├── CRBannerCustomEvent.h │ │ ├── CRInterstitialCustomEvent.h │ │ └── CRCustomEvent.h └── Tests │ └── CriteoGoogleAdapterTests │ ├── Info.plist │ └── CriteoGoogleAdapterTests.swift ├── Gemfile ├── scripts ├── source-cleanup.sh ├── archive.sh ├── update.sh ├── setup.sh ├── import-cassette.sh └── dev-setup.sh ├── CriteoPublisherSdk.xcworkspace ├── xcshareddata │ ├── WorkspaceSettings.xcsettings │ ├── IDEWorkspaceChecks.plist │ └── IDETemplateMacros.plist └── contents.xcworkspacedata ├── CriteoMoPubAdapter ├── README.md ├── Sources │ └── CriteoMoPubAdapter │ │ ├── Info.plist │ │ ├── CRCustomEventHelper.h │ │ ├── CRNativeAdDelegateHandler.h │ │ ├── CRNativeCustomEvent.h │ │ ├── CRInterstitialCustomEvent.h │ │ ├── CRBannerCustomEvent.h │ │ └── CRNativeAdRenderer.h └── Tests │ └── CriteoMoPubAdapterTests │ ├── Info.plist │ ├── CriteoMoPubAdapterTests.swift │ └── CRCriteoAdapterConfigurationTests.m ├── .swiftlint.yml ├── .gitignore └── Podfile.lock /CriteoAdViewer/Frameworks/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @criteo/publisher-sdk 2 | 3 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Cassette/.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | DisableFormat: true 3 | SortIncludes: false 4 | --- 5 | -------------------------------------------------------------------------------- /wiremock/cert/wiremock.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/criteo/ios-publisher-sdk/HEAD/wiremock/cert/wiremock.jks -------------------------------------------------------------------------------- /wiremock/cert/wiremock.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/criteo/ios-publisher-sdk/HEAD/wiremock/cert/wiremock.p12 -------------------------------------------------------------------------------- /tools/clang-format/clang-format: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/criteo/ios-publisher-sdk/HEAD/tools/clang-format/clang-format -------------------------------------------------------------------------------- /CriteoAdViewer/Sources/AdViewer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/criteo/ios-publisher-sdk/HEAD/CriteoAdViewer/Sources/AdViewer.png -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | BasedOnStyle: Google 3 | SortIncludes: false 4 | --- 5 | Language: ObjC 6 | BreakStringLiterals: false 7 | --- 8 | -------------------------------------------------------------------------------- /CriteoAdViewer/Sources/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /CriteoPublisherSdk/iTestHostApp/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /CriteoPublisherSdk/Tests/.swiftlint.yml: -------------------------------------------------------------------------------- 1 | disabled_rules: 2 | # Relaxed rules for tests where it can be acceptable to crash 3 | - force_cast 4 | 5 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Tests/UnitTests/Native/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/criteo/ios-publisher-sdk/HEAD/CriteoPublisherSdk/Tests/UnitTests/Native/image.png -------------------------------------------------------------------------------- /CriteoPublisherSdk/Tests/UnitTests/Native/image.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/criteo/ios-publisher-sdk/HEAD/CriteoPublisherSdk/Tests/UnitTests/Native/image.jpeg -------------------------------------------------------------------------------- /CriteoMoPubAdapterTestApp/Sources/CriteoMoPubAdapterTestApp/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /wiremock/mappings/error.json: -------------------------------------------------------------------------------- 1 | { 2 | "request" : { 3 | "url" : "/error", 4 | "method" : "GET" 5 | }, 6 | "response": { 7 | "fault": "RANDOM_DATA_THEN_CLOSE" 8 | } 9 | } -------------------------------------------------------------------------------- /fastlane/Pluginfile: -------------------------------------------------------------------------------- 1 | # Autogenerated by fastlane 2 | # 3 | # Ensure this file is checked in to source control! 4 | 5 | gem 'fastlane-plugin-test_center' 6 | gem 'fastlane-plugin-clang_format' 7 | -------------------------------------------------------------------------------- /CriteoAdViewer/Sources/Assets.xcassets/AppIcon.appiconset/AdViewer-20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/criteo/ios-publisher-sdk/HEAD/CriteoAdViewer/Sources/Assets.xcassets/AppIcon.appiconset/AdViewer-20.png -------------------------------------------------------------------------------- /CriteoAdViewer/Sources/Assets.xcassets/AppIcon.appiconset/AdViewer-29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/criteo/ios-publisher-sdk/HEAD/CriteoAdViewer/Sources/Assets.xcassets/AppIcon.appiconset/AdViewer-29.png -------------------------------------------------------------------------------- /CriteoAdViewer/Sources/Assets.xcassets/AppIcon.appiconset/AdViewer-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/criteo/ios-publisher-sdk/HEAD/CriteoAdViewer/Sources/Assets.xcassets/AppIcon.appiconset/AdViewer-40.png -------------------------------------------------------------------------------- /CriteoAdViewer/Sources/Assets.xcassets/AppIcon.appiconset/AdViewer-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/criteo/ios-publisher-sdk/HEAD/CriteoAdViewer/Sources/Assets.xcassets/AppIcon.appiconset/AdViewer-76.png -------------------------------------------------------------------------------- /CriteoAdViewer/Sources/Assets.xcassets/AppIcon.appiconset/AdViewer-1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/criteo/ios-publisher-sdk/HEAD/CriteoAdViewer/Sources/Assets.xcassets/AppIcon.appiconset/AdViewer-1024.png -------------------------------------------------------------------------------- /CriteoAdViewer/Sources/Assets.xcassets/AppIcon.appiconset/AdViewer-20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/criteo/ios-publisher-sdk/HEAD/CriteoAdViewer/Sources/Assets.xcassets/AppIcon.appiconset/AdViewer-20@2x.png -------------------------------------------------------------------------------- /CriteoAdViewer/Sources/Assets.xcassets/AppIcon.appiconset/AdViewer-20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/criteo/ios-publisher-sdk/HEAD/CriteoAdViewer/Sources/Assets.xcassets/AppIcon.appiconset/AdViewer-20@3x.png -------------------------------------------------------------------------------- /CriteoAdViewer/Sources/Assets.xcassets/AppIcon.appiconset/AdViewer-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/criteo/ios-publisher-sdk/HEAD/CriteoAdViewer/Sources/Assets.xcassets/AppIcon.appiconset/AdViewer-29@2x.png -------------------------------------------------------------------------------- /CriteoAdViewer/Sources/Assets.xcassets/AppIcon.appiconset/AdViewer-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/criteo/ios-publisher-sdk/HEAD/CriteoAdViewer/Sources/Assets.xcassets/AppIcon.appiconset/AdViewer-29@3x.png -------------------------------------------------------------------------------- /CriteoAdViewer/Sources/Assets.xcassets/AppIcon.appiconset/AdViewer-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/criteo/ios-publisher-sdk/HEAD/CriteoAdViewer/Sources/Assets.xcassets/AppIcon.appiconset/AdViewer-40@2x.png -------------------------------------------------------------------------------- /CriteoAdViewer/Sources/Assets.xcassets/AppIcon.appiconset/AdViewer-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/criteo/ios-publisher-sdk/HEAD/CriteoAdViewer/Sources/Assets.xcassets/AppIcon.appiconset/AdViewer-40@3x.png -------------------------------------------------------------------------------- /CriteoAdViewer/Sources/Assets.xcassets/AppIcon.appiconset/AdViewer-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/criteo/ios-publisher-sdk/HEAD/CriteoAdViewer/Sources/Assets.xcassets/AppIcon.appiconset/AdViewer-60@2x.png -------------------------------------------------------------------------------- /CriteoAdViewer/Sources/Assets.xcassets/AppIcon.appiconset/AdViewer-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/criteo/ios-publisher-sdk/HEAD/CriteoAdViewer/Sources/Assets.xcassets/AppIcon.appiconset/AdViewer-60@3x.png -------------------------------------------------------------------------------- /CriteoAdViewer/Sources/Assets.xcassets/AppIcon.appiconset/AdViewer-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/criteo/ios-publisher-sdk/HEAD/CriteoAdViewer/Sources/Assets.xcassets/AppIcon.appiconset/AdViewer-76@2x.png -------------------------------------------------------------------------------- /CriteoAdViewer/Sources/Assets.xcassets/AppIcon.appiconset/AdViewer-83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/criteo/ios-publisher-sdk/HEAD/CriteoAdViewer/Sources/Assets.xcassets/AppIcon.appiconset/AdViewer-83.5@2x.png -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Cassette/Cassette-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #ifndef Cassette_Bridging_Header_h 2 | #define Cassette_Bridging_Header_h 3 | 4 | #import "Cassette.h" 5 | 6 | #endif /* Cassette_Bridging_Header_h */ 7 | -------------------------------------------------------------------------------- /wiremock/mappings/standard-url.json: -------------------------------------------------------------------------------- 1 | { 2 | "request" : { 3 | "url" : "/standard-url", 4 | "method" : "GET" 5 | }, 6 | "response": { 7 | "status": 200, 8 | "body": "Hello {{hostname}}!" 9 | } 10 | } -------------------------------------------------------------------------------- /fastlane/Appfile: -------------------------------------------------------------------------------- 1 | # app_identifier("[[APP_IDENTIFIER]]") # The bundle identifier of your app 2 | # apple_id("[[APPLE_ID]]") # Your Apple email address 3 | 4 | 5 | # For more information about the Appfile, see: 6 | # https://docs.fastlane.tools/advanced/#appfile 7 | -------------------------------------------------------------------------------- /CriteoGoogleAdapter/CriteoGoogleAdapter.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Tests/UnitTests/Configuration/skanInvalid.bundle/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /wiremock/mappings/redirect-error.json: -------------------------------------------------------------------------------- 1 | { 2 | "priority": 1, 3 | "request" : { 4 | "url" : "/redirect/error", 5 | "method" : "GET" 6 | }, 7 | "response": { 8 | "status": 302, 9 | "headers": { 10 | "Location": "https://localhost:9099/error" 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem "xcodeproj", '1.23.0' 4 | gem "cocoapods", '1.15.2' 5 | gem "fastlane", '2.220.0' 6 | gem "iostrust" 7 | 8 | plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile') 9 | eval_gemfile(plugins_path) if File.exist?(plugins_path) 10 | -------------------------------------------------------------------------------- /scripts/source-cleanup.sh: -------------------------------------------------------------------------------- 1 | # Remove Created by 2 | find . -iname *.h -o -iname *.m -o -iname *.swift | \ 3 | xargs sed -i '' '/Created by/d' 4 | 5 | # Edit Copyright 6 | find . -iname *.h -o -iname *.m -o -iname *.swift | \ 7 | xargs sed -i '' "s/Copyright.*Criteo/Copyright © 2018-$(date '+%Y') Criteo/g" 8 | -------------------------------------------------------------------------------- /wiremock/mappings/redirect-infinite.json: -------------------------------------------------------------------------------- 1 | { 2 | "priority": 1, 3 | "request" : { 4 | "url" : "/redirect/infinite", 5 | "method" : "GET" 6 | }, 7 | "response": { 8 | "status": 302, 9 | "headers": { 10 | "Location": "https://localhost:9099/redirect/infinite" 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /wiremock/mappings/redirect-standard-url.json: -------------------------------------------------------------------------------- 1 | { 2 | "priority": 1, 3 | "request" : { 4 | "url" : "/redirect/standard-url", 5 | "method" : "GET" 6 | }, 7 | "response": { 8 | "status": 302, 9 | "headers": { 10 | "Location": "https://localhost:9099/standard-url" 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /CriteoPublisherSdk.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /CriteoPublisherSdk.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /wiremock/mappings/redirect-appstore-url.json: -------------------------------------------------------------------------------- 1 | { 2 | "priority": 1, 3 | "request" : { 4 | "url" : "/redirect/appstore-url", 5 | "method" : "GET" 6 | }, 7 | "response": { 8 | "status": 302, 9 | "headers": { 10 | "Location": "https://apps.apple.com/us/app/apple-developer/id640199958" 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /CriteoAdViewer/CriteoAdViewer.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /CriteoAdViewer/CriteoAdViewer.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /CriteoGoogleAdapter/CriteoGoogleAdapter.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /CriteoGoogleAdapter/README.md: -------------------------------------------------------------------------------- 1 | # Criteo Adapters for Google Mediation (iOS) 2 | 3 | This folder contains Criteo’s Adapter for Admob Mediation. It must be used in 4 | conjunction with the Criteo Publisher SDK. For requirements, intructions, and 5 | other info, see [Integrating Criteo with Admob Mediation](https://publisherdocs.criteotilt.com/app/ios/mediation/admob/). 6 | 7 | -------------------------------------------------------------------------------- /CriteoMoPubAdapter/README.md: -------------------------------------------------------------------------------- 1 | # Criteo Adapters for MoPub Mediation (iOS) 2 | 3 | This folder contains Criteo’s Adapter for MoPub Mediation. It must be used in 4 | conjunction with the Criteo Publisher SDK. For requirements, intructions, and 5 | other info, see [Integrating Criteo with MoPub Mediation](https://publisherdocs.criteotilt.com/app/ios/mediation/mopub/). 6 | 7 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/CriteoPublisherSdk.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /CriteoAdViewer/Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '13.0' 2 | 3 | workspace 'CriteoAdViewer' 4 | 5 | target 'CriteoAdViewer' do 6 | project 'CriteoAdViewer' 7 | 8 | pod 'CriteoPublisherSdk', '~> 6.1.2' 9 | # pod 'CriteoPublisherSdk', :git => 'https://github.com/criteo/ios-publisher-sdk.git' #, :branch => '' 10 | pod 'Google-Mobile-Ads-SDK' 11 | pod 'Eureka' 12 | end 13 | 14 | -------------------------------------------------------------------------------- /CriteoMoPubAdapterTestApp/Sources/CriteoMoPubAdapterTestApp/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // CriteoMoPubAdapterTestApp 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | @interface AppDelegate : UIResponder 11 | 12 | @property(strong, nonatomic) UIWindow *window; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /scripts/archive.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -l 2 | 3 | set +x 4 | set -Eeuo pipefail 5 | 6 | SCRIPT_DIRECTORY="$( 7 | cd "$(dirname "$0")" 8 | pwd -P 9 | )" 10 | # shellcheck source=scripts/base.sh 11 | source "$SCRIPT_DIRECTORY"/base.sh 12 | 13 | crto-clean 14 | 15 | crto-build-xcframework Release 16 | crto-archive 17 | 18 | crto-build-xcframework Debug 19 | crto-archive 20 | 21 | crto-echo "Archive completed." 22 | -------------------------------------------------------------------------------- /CriteoMoPubAdapterTestApp/Sources/CriteoMoPubAdapterTestApp/HomePage/HomePageTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // HomePageTableViewController.h 3 | // CriteoMoPubAdapterTestApp 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | NS_ASSUME_NONNULL_BEGIN 11 | 12 | @interface HomePageTableViewController : UITableViewController 13 | 14 | @end 15 | 16 | NS_ASSUME_NONNULL_END 17 | -------------------------------------------------------------------------------- /wiremock/mappings/redirect-n.json: -------------------------------------------------------------------------------- 1 | { 2 | "priority": 10, 3 | "request" : { 4 | "urlPattern" : "/redirect/.*", 5 | "method" : "GET" 6 | }, 7 | "response": { 8 | "status": 302, 9 | "body": "Redirecting to {{regexExtract request.path '/redirect/([0-9]*)/(.*)' 'parts'}}{{parts.1}}", 10 | "headers": { 11 | "Location": "https://localhost:9099/redirect/{{regexExtract request.path '/redirect/([0-9]*)/(.*)' 'parts'}}{{parts.1}}" 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /scripts/update.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -l 2 | 3 | 4 | set +x 5 | set -Eeuo pipefail 6 | 7 | SCRIPT_DIRECTORY="$( 8 | cd "$(dirname "$0")" 9 | pwd -P 10 | )" 11 | # shellcheck source=scripts/base.sh 12 | source "$SCRIPT_DIRECTORY"/base.sh 13 | 14 | crto-echo "[Bundle] Updating Gems..." 15 | bundle update 16 | crto-echo "[CocoaPods] Updating Pods..." 17 | bundle exec pod update 18 | crto-echo "[Includes] Updating included libs..." 19 | "$SCRIPT_DIRECTORY"/import-cassette.sh 20 | 21 | crto-echo "Update complete." 22 | -------------------------------------------------------------------------------- /wiremock/mappings/display-app-store.json: -------------------------------------------------------------------------------- 1 | { 2 | "request" : { 3 | "url" : "/display/app-store", 4 | "method" : "GET" 5 | }, 6 | "response" : { 7 | "status" : 200, 8 | "body" : "(function(){\nvar s = \"\";\ns += \"<\"+\"a href=\\\"https://localhost:9099/redirect/3/2/1/appstore-url\\\">\\n\";\ns += \" <\"+\"img width='320' height='50' src=\\\"https://publisherdirect.criteo.com/publishertag/preprodtest/creative_cas.png\\\"/>\\n\";\ns += \"<\"+\"/a>\\n\";\ns += \"\\n\";\ndocument.write(s);})();" 9 | } 10 | } -------------------------------------------------------------------------------- /wiremock/mappings/vast.json: -------------------------------------------------------------------------------- 1 | { 2 | "request": { 3 | "urlPath": "/delivery/vast.php" 4 | }, 5 | "response": { 6 | "headers": { 7 | "access-control-allow-credentials": "true", 8 | "access-control-allow-headers": "Origin, Content-Type, Accept, X-Requested-With", 9 | "access-control-allow-methods": "GET, POST, OPTIONS", 10 | "access-control-allow-origin": "{{ request.headers.origin }}", 11 | "access-control-max-age": "1000" 12 | }, 13 | "status": 200, 14 | "bodyFileName": "vast.xml" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Tests/UnitTests/Configuration/skanValid.bundle/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SKAdNetworkItems 6 | 7 | 8 | SKAdNetworkIdentifier 9 | hs6bdukanm.skadnetwork 10 | 11 | 12 | SKAdNetworkIdentifier 13 | whateverid.skadnetwork 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /CriteoAdViewer/UITests/CriteoAdViewerUITests.xctestplan: -------------------------------------------------------------------------------- 1 | { 2 | "configurations" : [ 3 | { 4 | "id" : "BE70AAEA-2096-47F0-8C6E-98D38A85F7F6", 5 | "name" : "Configuration 1", 6 | "options" : { 7 | 8 | } 9 | } 10 | ], 11 | "defaultOptions" : { 12 | 13 | }, 14 | "testTargets" : [ 15 | { 16 | "target" : { 17 | "containerPath" : "container:CriteoAdViewer.xcodeproj", 18 | "identifier" : "4077EBC6218BC48400C41E68", 19 | "name" : "CriteoAdViewerUITests" 20 | } 21 | } 22 | ], 23 | "version" : 1 24 | } 25 | -------------------------------------------------------------------------------- /CriteoMoPubAdapterTestApp/Sources/CriteoMoPubAdapterTestApp/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // CriteoMoPubAdapterTestApp 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | 8 | #import 9 | #import "AppDelegate.h" 10 | 11 | int main(int argc, char* argv[]) { 12 | NSString* appDelegateClassName; 13 | @autoreleasepool { 14 | // Setup code that might create autoreleased objects goes here. 15 | appDelegateClassName = NSStringFromClass([AppDelegate class]); 16 | } 17 | return UIApplicationMain(argc, argv, nil, appDelegateClassName); 18 | } 19 | -------------------------------------------------------------------------------- /scripts/setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -l 2 | 3 | set +x 4 | set -Eeuo pipefail 5 | 6 | SCRIPT_DIRECTORY="$( 7 | cd "$(dirname "$0")" 8 | pwd -P 9 | )" 10 | # shellcheck source=scripts/base.sh 11 | source "$SCRIPT_DIRECTORY"/base.sh 12 | 13 | crto-echo "Checking tool versions" 14 | crto-printf "xcpretty " 15 | xcpretty -version 16 | crto-printf 17 | xcodebuild -version 18 | crto-printf 19 | ruby --version 20 | crto-printf 21 | bundle --version 22 | 23 | crto-echo "Bundle install..." 24 | bundle install --path vendor 25 | 26 | crto-echo "CocoaPods install..." 27 | bundle exec fastlane run cocoapods -------------------------------------------------------------------------------- /CriteoPublisherSdk.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 12 | 13 | 15 | 16 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tools/code-format-git-hook.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # cp tools/code-format-git-hook.sh .git/hooks/pre-commit 4 | 5 | format_objc() { 6 | file="${1}" 7 | if [ -f "$file" ]; then 8 | ./tools/clang-format/clang-format -i "$file" 9 | fi 10 | } 11 | 12 | format_swift() { 13 | file="${1}" 14 | if [ -f "$file" ]; then 15 | swift-format -i "$file" 16 | swiftlint autocorrect "$file" 17 | fi 18 | } 19 | 20 | for file in $(git diff-index --cached --name-only HEAD | grep -iE '\.(m|h)$'); do 21 | format_objc "${file}" 22 | done 23 | 24 | for file in $(git diff-index --cached --name-only HEAD | grep -iE '\.(swift)$'); do 25 | format_swift "${file}" 26 | done 27 | -------------------------------------------------------------------------------- /.swiftlint.yml: -------------------------------------------------------------------------------- 1 | disabled_rules: 2 | - file_length # Violated by long test files, like CR_BidManagerTests 3 | - line_length # Violated because it can be enabled on-demand from Xcode > Preferences > Text Editing > Wrap lines to editor width 4 | - syntactic_sugar # Violated because Dictionary is easier to read than [AnyHashable:String] 5 | - todo # Violated because some of the comments are caused by the Objective-C to Swift conversion 6 | - type_name # Violated by class names with underline, like CR_FeedbackStorageTests 7 | - type_body_length # Violated by long test files, like CR_BidManagerTests 8 | - vertical_whitespace # Violated by 2-empty line spacing before protocol conformances, MARK, FIXME 9 | -------------------------------------------------------------------------------- /.github/workflows/release-cocoapods.yml: -------------------------------------------------------------------------------- 1 | name: Release on CocoaPods 2 | 3 | on: 4 | release: 5 | types: [ published ] 6 | 7 | env: 8 | DEVELOPER_DIR: /Applications/Xcode.app/Contents/Developer 9 | 10 | jobs: 11 | release-cocoapods: 12 | runs-on: macos-latest 13 | 14 | steps: 15 | - name: Checkout 16 | uses: actions/checkout@v4 17 | 18 | - name: Ruby & Bundle setup 19 | uses: ruby/setup-ruby@v1 20 | with: 21 | ruby-version: 2.7 22 | bundler-cache: true 23 | 24 | - name: CocoaPods Release 25 | run: | 26 | bundle exec fastlane release_cocoapods 27 | env: 28 | COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} 29 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Cassette/CR_CASPrivateConstants.h: -------------------------------------------------------------------------------- 1 | // Copyright 2016 LinkedIn Corporation 2 | // Licensed under the BSD 2-Clause License (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at https://opensource.org/licenses/BSD-2-Clause 5 | // 6 | // Unless required by applicable law or agreed to in writing, software 7 | // distributed under the License is distributed on an "AS IS" BASIS, 8 | // WITHOUT WARRANTIES OF ANY KIND, either express or implied. 9 | // See the License for the specific language governing permissions and limitations under the License. 10 | 11 | #ifdef DEBUG 12 | #define CR_CASLOG(msg, ...) NSLog(msg, ##__VA_ARGS__) 13 | #else 14 | #define CR_CASLOG(msg, ...) 15 | #endif 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | # Xcode 5 | build/ 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata 15 | *.xccheckout 16 | profile 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | *.xcuserstate 22 | xcuserdata/ 23 | 24 | # Build artifacts 25 | xcodebuild.log 26 | 27 | # AppCode 28 | .idea/ 29 | 30 | # CocoaPods 31 | Pods/ 32 | 33 | # Bundler 34 | vendor 35 | 36 | # fastlane specific 37 | **/fastlane/report.xml 38 | 39 | # deliver temporary files 40 | **/fastlane/Preview.html 41 | 42 | # snapshot generated screenshots 43 | **/fastlane/screenshots 44 | 45 | # scan temporary files 46 | **/fastlane/test_output 47 | 48 | # Secret file 49 | env.secret.sh -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Cassette/Cassette.h: -------------------------------------------------------------------------------- 1 | // Copyright 2016 LinkedIn Corporation 2 | // Licensed under the BSD 2-Clause License (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at https://opensource.org/licenses/BSD-2-Clause 5 | // 6 | // Unless required by applicable law or agreed to in writing, software 7 | // distributed under the License is distributed on an "AS IS" BASIS, 8 | // WITHOUT WARRANTIES OF ANY KIND, either express or implied. 9 | // See the License for the specific language governing permissions and limitations under the License. 10 | 11 | #import "CR_CASObjectQueue.h" 12 | #import "CR_CASFileObjectQueue.h" 13 | #import "CR_CASInMemoryObjectQueue.h" 14 | #import "CR_CASDataSerializer.h" 15 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Cassette/CR_CASInMemoryObjectQueue.h: -------------------------------------------------------------------------------- 1 | // Copyright 2016 LinkedIn Corporation 2 | // Licensed under the BSD 2-Clause License (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at https://opensource.org/licenses/BSD-2-Clause 5 | // 6 | // Unless required by applicable law or agreed to in writing, software 7 | // distributed under the License is distributed on an "AS IS" BASIS, 8 | // WITHOUT WARRANTIES OF ANY KIND, either express or implied. 9 | // See the License for the specific language governing permissions and limitations under the License. 10 | 11 | #import "CR_CASObjectQueue.h" 12 | 13 | @interface CR_CASInMemoryObjectQueue> : CR_CASObjectQueue 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /CriteoMoPubAdapterTestApp/Sources/CriteoMoPubAdapterTestApp/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // CriteoMoPubAdapterTestApp 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | 8 | #import "AppDelegate.h" 9 | #import "MoPub.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | - (BOOL)application:(UIApplication *)application 18 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | MPMoPubConfiguration *config = [[MPMoPubConfiguration alloc] 20 | initWithAdUnitIdForAppInitialization:@"5f6c4592630f4f96bc3106b6ed0cc3f1"]; 21 | config.loggingLevel = MPBLogLevelDebug; 22 | [[MoPub sharedInstance] initializeSdkWithConfiguration:config completion:nil]; 23 | 24 | return YES; 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/CriteoPublisherSdk.xcodeproj/xcshareddata/xcbaselines/E1F2736C21B5F08D00A2FBFA.xcbaseline/FD24A0E4-7CC1-47CA-A6A3-E3E390A8D1D5.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | classNames 6 | 7 | NSString_UrlEncoderTests 8 | 9 | testEncodePerformance 10 | 11 | com.apple.XCTPerformanceMetric_WallClockTime 12 | 13 | baselineAverage 14 | 5.9895e-06 15 | baselineIntegrationDisplayName 16 | Local Baseline 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /CriteoAdViewer/UITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 7.0.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 7.0.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /CriteoGoogleAdapter/Sources/CriteoGoogleAdapter/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 7.0.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /CriteoMoPubAdapter/Sources/CriteoMoPubAdapter/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 4.5.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /CriteoMoPubAdapter/Tests/CriteoMoPubAdapterTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 4.5.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Tests/CriteoPublisherSdkTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 7.0.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /CriteoGoogleAdapter/Tests/CriteoGoogleAdapterTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 7.0.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/iTestHostApp/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // iTestHostApp 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | 22 | @interface ViewController : UIViewController 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/SKAdNetwork/CRSKAdNetworkInfo.m: -------------------------------------------------------------------------------- 1 | // 2 | // CRSKAdNetworkInfo.m 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import "CRSKAdNetworkInfo.h" 21 | 22 | @implementation CRSKAdNetworkInfo 23 | @end 24 | -------------------------------------------------------------------------------- /CriteoMoPubAdapter/Tests/CriteoMoPubAdapterTests/CriteoMoPubAdapterTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CriteoMoPubAdapterTests.swift 3 | // CriteoMoPubAdapterTests 4 | // 5 | // Copyright © 2018-2020 . All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | import Foundation 21 | 22 | // NOTE: this file is required by Xcode to link swift runtime 23 | -------------------------------------------------------------------------------- /CriteoGoogleAdapter/Tests/CriteoGoogleAdapterTests/CriteoGoogleAdapterTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CriteoGoogleAdapterTests.swift 3 | // CriteoGoogleAdapterTests 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | import Foundation 21 | 22 | // NOTE: this file is required by Xcode to link swift runtime 23 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Tests/IntegrationTests/NativeAd/CR_NativeAdTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // CR_NativeAdTableViewCell.m 3 | // CriteoPublisherSdkTests 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import "CR_NativeAdTableViewCell.h" 21 | 22 | @implementation CR_NativeAdTableViewCell 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /CriteoMoPubAdapterTestApp/Sources/CriteoMoPubAdapterTestApp/CriteoMoPubAdapterTestApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CriteoMoPubAdapterTestApp.swift 3 | // CriteoMoPubAdapterTestApp 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | import Foundation 21 | 22 | // NOTE: this file is required by Xcode to link swift runtime 23 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/iTestHostApp/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // iTestHostApp 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | 22 | @interface AppDelegate : UIResponder 23 | 24 | @property(strong, nonatomic) UIWindow *window; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /scripts/import-cassette.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -l 2 | 3 | CASSETTE_FOLDER=CriteoPublisherSdk/Sources/Cassette 4 | 5 | # Cleanup 6 | rm -rf $CASSETTE_FOLDER 7 | 8 | # Shallow clone 9 | git clone -b master --single-branch --depth 1 \ 10 | git@github.com:linkedin/cassette.git \ 11 | $CASSETTE_FOLDER.tmp 12 | 13 | # Only keep library source 14 | mv $CASSETTE_FOLDER.tmp/Cassette $CASSETTE_FOLDER 15 | rm -rf $CASSETTE_FOLDER.tmp $CASSETTE_FOLDER/Info.plist 16 | 17 | # Prefix file names 18 | for file in $CASSETTE_FOLDER/CAS*.{h,m}; do 19 | mv "$file" "${file/CAS/CR_CAS}" 20 | done 21 | 22 | # Prefix class names 23 | sed -i '' "s/CAS/CR_CAS/g" $CASSETTE_FOLDER/*.{h,m} 24 | 25 | # Fix imports 26 | sed -i '' "s/#import /#import \"\1\"/g" $CASSETTE_FOLDER/*.{h,m} 27 | 28 | # Exclude it from clang-format 29 | cat <> $CASSETTE_FOLDER/.clang-format 30 | --- 31 | DisableFormat: true 32 | SortIncludes: false 33 | --- 34 | EOF 35 | -------------------------------------------------------------------------------- /CriteoAdViewer/Sources/Common/InterstitialUpdateDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // InterstitialUpdateDelegate.h 3 | // CriteoAdViewer 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | 22 | @protocol InterstitialUpdateDelegate 23 | - (void)interstitialUpdated:(BOOL)loaded; 24 | @end 25 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Public/CRSKAdNetworkInfo.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRSKAdNetworkInfo.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | @interface CRSKAdNetworkInfo : NSObject 25 | @end 26 | 27 | NS_ASSUME_NONNULL_END 28 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Tests/UnitTests/Mocks/MockProtocol.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MockProtocol.swift 3 | // CriteoPublisherSdkTests 4 | // 5 | // Copyright © 2018-2022 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | import Foundation 21 | 22 | protocol MockProtocol { 23 | 24 | /// Changes the stored variables from mocking to their default value. 25 | func reset() 26 | } 27 | -------------------------------------------------------------------------------- /wiremock/mappings/cdb_delivery_ajsphp-1cc74b69-ffcb-47ed-8591-0e011cc959ca.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "1cc74b69-ffcb-47ed-8591-0e011cc959ca", 3 | "name" : "cdb_delivery_ajsphp", 4 | "request" : { 5 | "url" : "/cdb-stubs/delivery/ajs.php?width=320&height=50", 6 | "method" : "GET" 7 | }, 8 | "response" : { 9 | "status" : 200, 10 | "body" : "(function(){\nvar s = \"\";\ns += \"<\"+\"a href=\\\"https://criteo.com\\\">\\n\";\ns += \" <\"+\"img width='320' height='50' src=\\\"https://publisherdirect.criteo.com/publishertag/preprodtest/creative_cas.png\\\"/>\\n\";\ns += \"<\"+\"/a>\\n\";\ns += \"\\n\";\ndocument.write(s);})();", 11 | "headers" : { 12 | "date" : "Tue, 07 Jul 2020 13:32:28 GMT", 13 | "server" : "Finatra", 14 | "content-type" : "text/plain; charset=utf-8", 15 | "vary" : "Origin" 16 | } 17 | }, 18 | "uuid" : "1cc74b69-ffcb-47ed-8591-0e011cc959ca", 19 | "persistent" : true, 20 | "insertionIndex" : 1 21 | } -------------------------------------------------------------------------------- /scripts/dev-setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -l 2 | 3 | # Run this script to install your machine for the project. 4 | 5 | set +x 6 | set -Eeuo pipefail 7 | 8 | # Mute flooding logs 9 | # https://stackoverflow.com/questions/52455652/xcode-10-seems-to-break-com-apple-commcenter-coretelephony-xpc 10 | xcrun simctl spawn booted log config --mode "level:off" --subsystem com.apple.CoreTelephony 11 | 12 | # Enable parallel builds on Xcode 13 | num_cpu=$(sysctl -n hw.ncpu) 14 | defaults write com.apple.dt.xcodebuild PBXNumberOfParallelBuildSubtasks "$num_cpu" 15 | defaults write com.apple.dt.xcodebuild IDEBuildOperationMaxNumberOfConcurrentCompileTasks "$num_cpu" 16 | defaults write com.apple.dt.Xcode PBXNumberOfParallelBuildSubtasks "$num_cpu" 17 | defaults write com.apple.dt.Xcode IDEBuildOperationMaxNumberOfConcurrentCompileTasks "$num_cpu" 18 | 19 | # Code format 20 | brew install clang-format swift-format swiftlint 21 | cp tools/code-format-git-hook.sh .git/hooks/pre-commit 22 | -------------------------------------------------------------------------------- /CriteoGoogleAdapter/Sources/CriteoGoogleAdapter/CRBannerCustomEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRBannerCustomEvent.h 3 | // CriteoGoogleAdapter 4 | // 5 | // Copyright © 2018-2022 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import "CRCustomEvent.h" 21 | 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | @interface CRBannerCustomEvent : CRCustomEvent 25 | @end 26 | 27 | NS_ASSUME_NONNULL_END 28 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/MRAID/MessageHandlers/Data/Message/MRAIDPlayVideoMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MRAIDPlayVideoMessage.swift 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2023 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | import Foundation 21 | 22 | public struct MRAIDPlayVideoMessage: Decodable { 23 | let action: Action 24 | let url: String 25 | } 26 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/MRAID/Logging/LogLevel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LogLevel.swift 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2023 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | import Foundation 21 | 22 | public enum LogLevel: String, Decodable { 23 | case debug = "Debug" 24 | case info = "Info" 25 | case warning = "Warning" 26 | case error = "Error" 27 | } 28 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/MRAID/MessageHandlers/Data/MRAIDState.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MRAIDState.swift 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2023 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | import Foundation 21 | 22 | public enum MRAIDState: String, Decodable { 23 | case loading 24 | case `default` 25 | case expanded 26 | case hidden 27 | case resized 28 | } 29 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Tests/Utility/Native/CR_NativeAssets+Testing.h: -------------------------------------------------------------------------------- 1 | // 2 | // CR_TestNativeAssets.h 3 | // CriteoPublisherSdkTests 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | #import "CR_NativeAssets.h" 22 | 23 | @interface CR_NativeAssets (Testing) 24 | 25 | + (CR_NativeAssets *)nativeAssetsFromCdb; 26 | 27 | @end -------------------------------------------------------------------------------- /CriteoPublisherSdk/Tests/Utility/Mocks/CR_InMemoryUserDefaults.h: -------------------------------------------------------------------------------- 1 | // 2 | // CR_InMemoryUserDefaults.h 3 | // CriteoPublisherSdkTests 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | @interface CR_InMemoryUserDefaults : NSUserDefaults 25 | 26 | @end 27 | 28 | NS_ASSUME_NONNULL_END 29 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/iTestHostApp/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // iTestHostApp 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | #import "AppDelegate.h" 22 | 23 | int main(int argc, char* argv[]) { 24 | @autoreleasepool { 25 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /CriteoGoogleAdapter/Sources/CriteoGoogleAdapter/CRInterstitialCustomEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRInterstitialCustomEvent.h 3 | // CriteoGoogleAdapter 4 | // 5 | // Copyright © 2018-2022 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import "CRCustomEvent.h" 21 | 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | @interface CRInterstitialCustomEvent : CRCustomEvent 25 | 26 | @end 27 | 28 | NS_ASSUME_NONNULL_END 29 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Context/CRUserData+Internal.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRUserData+Internal.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | #import "CRUserData.h" 22 | 23 | @interface CRUserData (Internal) 24 | 25 | @property(strong, nonatomic, readonly) NSDictionary *data; 26 | 27 | @end -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Context/CRContextData+Internal.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRContextData+Internal.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | #import "CRContextData.h" 22 | 23 | @interface CRContextData (Internal) 24 | 25 | @property(strong, nonatomic, readonly) NSDictionary *data; 26 | 27 | @end -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Context/CR_UserDataHolder.m: -------------------------------------------------------------------------------- 1 | // 2 | // CR_UserDataHolder.m 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import "CR_UserDataHolder.h" 21 | 22 | @implementation CR_UserDataHolder 23 | 24 | - (instancetype)init { 25 | if (self = [super init]) { 26 | _userData = CRUserData.new; 27 | } 28 | return self; 29 | } 30 | 31 | @end -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Util/NSObject+Criteo.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+Criteo.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | @interface NSObject (Criteo) 25 | 26 | + (BOOL)cr_object:(nullable id)obj1 isEqualTo:(nullable id)obj2; 27 | 28 | @end 29 | 30 | NS_ASSUME_NONNULL_END 31 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Tests/Utility/Categories/CR_ThreadManager+Waiter.h: -------------------------------------------------------------------------------- 1 | // 2 | // CR_ThreadManager+Waiter.h 3 | // CriteoPublisherSdkTests 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import "CR_ThreadManager.h" 21 | 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | @interface CR_ThreadManager (Waiter) 25 | 26 | - (void)waiter_waitIdle; 27 | 28 | @end 29 | 30 | NS_ASSUME_NONNULL_END 31 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Tests/Utility/Checkers/CR_ViewCheckingHelper.h: -------------------------------------------------------------------------------- 1 | // 2 | // CR_ViewCheckingHelper.h 3 | // CriteoPublisherSdkTests 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | 22 | @interface CR_ViewCheckingHelper : NSObject 23 | 24 | + (NSString *)preprodCreativeImageUrl; 25 | + (NSString *)preprodCreativeImageUrlForNative; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Public/CRBid.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRBid.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | @interface CRBid : NSObject 25 | 26 | @property(nonatomic, readonly) double price; 27 | 28 | - (instancetype)init NS_UNAVAILABLE; 29 | 30 | @end 31 | 32 | NS_ASSUME_NONNULL_END 33 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Tests/Utility/Mocks/MockWKWebView.h: -------------------------------------------------------------------------------- 1 | // 2 | // MockWKWebView.h 3 | // CriteoPublisherSdkTests 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | @interface MockWKWebView : WKWebView 25 | @property NSString *loadedHTMLString; 26 | @property NSURL *loadedBaseURL; 27 | @end 28 | 29 | NS_ASSUME_NONNULL_END 30 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/MRAID/MessageHandlers/Data/Message/MRAIDExpandMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MRAIDExpandMessage.swift 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2023 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | import Foundation 21 | 22 | public struct MRAIDExpandMessage: Decodable { 23 | public let action: Action 24 | public let width: Int 25 | public let height: Int 26 | public let url: URL? 27 | } 28 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Native/CR_AdChoice.h: -------------------------------------------------------------------------------- 1 | // 2 | // CR_AdChoiceButton.h 3 | // AdViewer 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | 22 | @class CRNativeAd; 23 | 24 | NS_ASSUME_NONNULL_BEGIN 25 | 26 | @interface CR_AdChoice : UIButton 27 | 28 | @property(strong, nonatomic, nullable) CRNativeAd *nativeAd; 29 | 30 | @end 31 | 32 | NS_ASSUME_NONNULL_END 33 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/iTestHostApp/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // iTestHostApp 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import "ViewController.h" 21 | 22 | @interface ViewController () 23 | 24 | @end 25 | 26 | @implementation ViewController 27 | 28 | - (void)viewDidLoad { 29 | [super viewDidLoad]; 30 | // Do any additional setup after loading the view. 31 | } 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/AppEvents/CR_AppEvents+Internal.h: -------------------------------------------------------------------------------- 1 | // 2 | // CR_AppEvents+Internal.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #ifndef CR_AppEvents_Internal_h 21 | #define CR_AppEvents_Internal_h 22 | 23 | #import "CR_AppEvents.h" 24 | 25 | @interface CR_AppEvents () 26 | 27 | - (void)disableThrottling; 28 | 29 | @end 30 | 31 | #endif /* CR_AppEvents_Internal_h */ 32 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Context/CR_UserDataHolder.h: -------------------------------------------------------------------------------- 1 | // 2 | // CR_UserDataHolder.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | #import "CRUserData.h" 22 | 23 | NS_ASSUME_NONNULL_BEGIN 24 | 25 | @interface CR_UserDataHolder : NSObject 26 | 27 | @property(strong, atomic) CRUserData *userData; 28 | 29 | @end 30 | 31 | NS_ASSUME_NONNULL_END 32 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Util/UIView+Criteo.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Criteo.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | @interface UIView (Criteo) 25 | 26 | - (UIViewController *_Nullable)cr_parentViewController; 27 | - (UIViewController *_Nullable)cr_rootViewController; 28 | 29 | @end 30 | 31 | NS_ASSUME_NONNULL_END 32 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Tests/Utility/Categories/XCTestExpectation+Criteo.h: -------------------------------------------------------------------------------- 1 | // 2 | // XCTestExpectation+Criteo.h 3 | // CriteoPublisherSdkTests 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | @interface XCTestExpectation (Criteo) 25 | 26 | + (instancetype)expectationWithPollingBlock:(BOOL (^)(void))block; 27 | 28 | @end 29 | 30 | NS_ASSUME_NONNULL_END 31 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Tests/Utility/Mocks/CR_SynchronousThreadManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // CR_SynchronousThreadManager.h 3 | // CriteoPublisherSdkTests 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import "CR_ThreadManager.h" 21 | 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | @interface CR_SynchronousThreadManager : CR_ThreadManager 25 | 26 | @property(nonatomic, assign) BOOL isTimeout; 27 | 28 | @end 29 | 30 | NS_ASSUME_NONNULL_END 31 | -------------------------------------------------------------------------------- /CriteoAdViewer/Sources/Logs/LogEntryViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LogEntryViewController.swift 3 | // CriteoAdViewer 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | class LogEntryViewController: UIViewController { 21 | @IBOutlet weak var logTextView: UITextView! 22 | var logEntry: LogEntry? 23 | 24 | override func viewDidLoad() { 25 | super.viewDidLoad() 26 | logTextView.text = logEntry?.detail 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Tests/Utility/Categories/UIImage+Testing.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+Testing.h 3 | // CriteoPublisherSdkTests 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | @interface UIImage (Testing) 25 | 26 | + (nullable UIImage *)testImageNamed:(NSString *)name; 27 | 28 | + (UIImage *)imageWithSize:(CGSize)size; 29 | 30 | @end 31 | 32 | NS_ASSUME_NONNULL_END -------------------------------------------------------------------------------- /CriteoPublisherSdk.xcworkspace/xcshareddata/IDETemplateMacros.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | FILEHEADER 6 | 7 | // ___FILENAME___ 8 | // ___PACKAGENAME___ 9 | // 10 | // Copyright © 2018-___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. 11 | // 12 | // Licensed under the Apache License, Version 2.0 (the "License"); 13 | // you may not use this file except in compliance with the License. 14 | // You may obtain a copy of the License at 15 | // 16 | // http://www.apache.org/licenses/LICENSE-2.0 17 | // 18 | // Unless required by applicable law or agreed to in writing, software 19 | // distributed under the License is distributed on an "AS IS" BASIS, 20 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | // See the License for the specific language governing permissions and 22 | // limitations under the License. 23 | // 24 | 25 | 26 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Native/CRMediaView+Internal.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRMediaView+Internal.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | #import "CRMediaView.h" 22 | 23 | @class UIImageView; 24 | 25 | @interface CRMediaView () 26 | 27 | @property(strong, nonatomic, nullable) UIImageView *imageView; 28 | @property(strong, nonatomic, nullable) NSURL *imageUrl; 29 | 30 | @end -------------------------------------------------------------------------------- /CriteoPublisherSdk/Tests/Utility/Categories/UIView+Testing.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Testing.h 3 | // CriteoPublisherSdkTests 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | #import 22 | #import 23 | 24 | @interface UIView (Testing) 25 | 26 | - (WKWebView *)testing_findFirstWKWebView; 27 | - (NSMutableArray *)testing_findAllElementsOfClass:(Class)class; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/MRAID/CRMRAIDHandlerDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CRMRAIDHandlerDelegate.swift 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2023 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | import Foundation 21 | 22 | @objc 23 | public protocol CRMRAIDHandlerDelegate: AnyObject { 24 | @objc 25 | optional 26 | func expand(width: Int, height: Int, url: URL?, completion: VoidCompletion?) 27 | func close(completion: VoidCompletion?) 28 | } 29 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Network/Serializers/CR_GdprSerializer.h: -------------------------------------------------------------------------------- 1 | // 2 | // CR_GdprSerializer.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | @class CR_Gdpr; 25 | 26 | @interface CR_GdprSerializer : NSObject 27 | 28 | - (nullable NSDictionary *)dictionaryForGdpr:(CR_Gdpr *)gdpr; 29 | 30 | @end 31 | 32 | NS_ASSUME_NONNULL_END 33 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Tests/Utility/MRAID/URLOpenerMock.swift: -------------------------------------------------------------------------------- 1 | // 2 | // URLOpenerMock.swift 3 | // CriteoPublisherSdkTests 4 | // 5 | // Copyright © 2018-2023 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | typealias URLOpenerBlock = (URL) -> Void 21 | 22 | class URLOpenerMock: CRExternalURLOpener { 23 | var openBlock: URLOpenerBlock? 24 | 25 | init(openBlock: URLOpenerBlock?) { 26 | self.openBlock = openBlock 27 | } 28 | 29 | func open(url: URL) { 30 | openBlock?(url) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Cassette/CR_CASDefaultDataSerializer.h: -------------------------------------------------------------------------------- 1 | // Copyright 2021 LinkedIn Corporation 2 | // Licensed under the BSD 2-Clause License (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at https://opensource.org/licenses/BSD-2-Clause 5 | // 6 | // Unless required by applicable law or agreed to in writing, software 7 | // distributed under the License is distributed on an "AS IS" BASIS, 8 | // WITHOUT WARRANTIES OF ANY KIND, either express or implied. 9 | // See the License for the specific language governing permissions and limitations under the License. 10 | 11 | 12 | #import 13 | #import "CR_CASDataSerializer.h" 14 | 15 | NS_ASSUME_NONNULL_BEGIN 16 | 17 | /** 18 | * Default implementation for data serialization and deserialization using NSKeyedArchiver. 19 | */ 20 | @interface CR_CASDefaultDataSerializer : NSObject 21 | 22 | + (instancetype)shared; 23 | 24 | - (instancetype)init NS_UNAVAILABLE; 25 | 26 | @end 27 | 28 | NS_ASSUME_NONNULL_END 29 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Public/CRConstants.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRConstants.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #ifndef CRConstants_h 21 | #define CRConstants_h 22 | 23 | #define CRITEO_PUBLISHER_SDK_VERSION @"7.0.0" 24 | 25 | #define CRITEO_DEFAULT_REQUEST_TIMEOUT_IN_SECONDS 60 26 | #define CRITEO_DEFAULT_BID_TTL_IN_SECONDS 15 * 60 27 | #define CRITEO_DEFAULT_LIVE_BID_TIME_BUDGET_IN_SECONDS 8.0f 28 | 29 | #endif /* CRConstants_h */ 30 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Util/NSURL+Criteo.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSURL+Criteo.m 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import "NSURL+Criteo.h" 21 | 22 | @implementation NSURL (Criteo) 23 | 24 | + (nullable NSURL *)cr_URLWithStringOrNil:(nullable NSString *)string { 25 | if (string && [string isKindOfClass:NSString.class]) { 26 | return [NSURL URLWithString:string]; 27 | } else { 28 | return nil; 29 | } 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Tests/Utility/Mocks/CR_URLOpenerMock.h: -------------------------------------------------------------------------------- 1 | // 2 | // CR_URLOpenerMock.h 3 | // CriteoPublisherSdkTests 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import "CR_URLOpener.h" 21 | 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | @interface CR_URLOpenerMock : NSObject 25 | 26 | @property(assign, nonatomic) BOOL successInCompletion; 27 | @property(assign, nonatomic) NSUInteger openExternalURLCount; 28 | 29 | @end 30 | 31 | NS_ASSUME_NONNULL_END 32 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Tests/Utility/CR_DeviceInfo+Testing.h: -------------------------------------------------------------------------------- 1 | // 2 | // CR_TestNativeAssets.h 3 | // CriteoPublisherSdkTests 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import "CR_DeviceInfo.h" 21 | 22 | @interface CR_DeviceInfo (Testing) 23 | 24 | @property(strong, nonatomic, readonly) WKWebView *webView; 25 | 26 | - (instancetype)initWithThreadManager:(CR_ThreadManager *)threadManager 27 | testWebView:(WKWebView *)testWebView; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Cassette/CR_CASQueueFileElement.m: -------------------------------------------------------------------------------- 1 | // Copyright 2016 LinkedIn Corporation 2 | // Licensed under the BSD 2-Clause License (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at https://opensource.org/licenses/BSD-2-Clause 5 | // 6 | // Unless required by applicable law or agreed to in writing, software 7 | // distributed under the License is distributed on an "AS IS" BASIS, 8 | // WITHOUT WARRANTIES OF ANY KIND, either express or implied. 9 | // See the License for the specific language governing permissions and limitations under the License. 10 | 11 | #import "CR_CASQueueFileElement.h" 12 | 13 | @implementation CR_CASQueueFileElement 14 | 15 | + (instancetype)null { 16 | return [[CR_CASQueueFileElement alloc] initAtPosition:0 withLength:0]; 17 | } 18 | 19 | - (instancetype)initAtPosition:(NSUInteger)position withLength:(NSUInteger)length { 20 | if (self = [super init]) { 21 | _position = position; 22 | _length = length; 23 | } 24 | return self; 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /CriteoAdViewer/Sources/Logs/RequestLogEntry.h: -------------------------------------------------------------------------------- 1 | // 2 | // RequestLogEntry.h 3 | // CriteoAdViewer 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import "LogEntry.h" 21 | 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | @interface RequestLogEntry : NSObject 25 | 26 | #pragma mark - Lifecycle 27 | 28 | - (instancetype)initWithRequest:(NSURLRequest *)request NS_DESIGNATED_INITIALIZER; 29 | 30 | - (instancetype)init NS_UNAVAILABLE; 31 | 32 | @end 33 | 34 | NS_ASSUME_NONNULL_END 35 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/MRAID/CRPlacementType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CRPlacementType.swift 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2023 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | import Foundation 21 | 22 | @objc 23 | public enum CRPlacementType: Int { 24 | case banner 25 | case interstitial 26 | 27 | var placementTypeString: String { 28 | switch self { 29 | case .banner: return "inline" 30 | case .interstitial: return "interstitial" 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Tests/Utility/CR_AssertDfp.h: -------------------------------------------------------------------------------- 1 | // 2 | // CR_AssertDfp.h 3 | // CriteoPublisherSdkTests 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #ifndef CR_AssertDfp_h 21 | #define CR_AssertDfp_h 22 | 23 | #define CR_AssertDfpCustomTargetingContainsCriteoBid(customTargeting) \ 24 | XCTAssertEqualObjects(customTargeting[CR_TargetingKey_crtCpm], @"1.12"); \ 25 | XCTAssertNotNil(customTargeting[CR_TargetingKey_crtDfpDisplayUrl]); 26 | 27 | #endif /* CR_AssertDfp_h */ 28 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Util/CRLogUtil.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRLogUtil.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2023 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | #if __has_include("CriteoPublisherSdk-Swift.h") 22 | #import "CriteoPublisherSdk-Swift.h" 23 | #else 24 | #import 25 | #endif 26 | 27 | NS_ASSUME_NONNULL_BEGIN 28 | 29 | @interface CRLogUtil : NSObject 30 | 31 | @end 32 | 33 | NS_ASSUME_NONNULL_END 34 | -------------------------------------------------------------------------------- /CriteoAdViewer/Sources/Logs/EventLogEntry.h: -------------------------------------------------------------------------------- 1 | // 2 | // EventLogEntry.h 3 | // CriteoAdViewer 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import "LogEntry.h" 21 | 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | @interface EventLogEntry : NSObject 25 | 26 | #pragma mark - Lifecycle 27 | 28 | - (instancetype)initWithEvent:(NSString *)event detail:(NSString *)detail NS_DESIGNATED_INITIALIZER; 29 | 30 | - (instancetype)init NS_UNAVAILABLE; 31 | 32 | @end 33 | 34 | NS_ASSUME_NONNULL_END 35 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Tests/IntegrationTests/NativeAd/SimpleViewController/CR_SafeAreaView.h: -------------------------------------------------------------------------------- 1 | // 2 | // CR_SafeAreaView.h 3 | // CriteoPublisherSdkTests 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | API_AVAILABLE(ios(11.0)) @interface CR_SafeAreaView : UIView 25 | 26 | @property(assign, nonatomic) CGRect unsafeAreaFrame; 27 | @property(assign, nonatomic) CGRect safeAreaFrame; 28 | 29 | @end 30 | 31 | NS_ASSUME_NONNULL_END 32 | -------------------------------------------------------------------------------- /CriteoAdViewer/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - CriteoMRAID (1.0.1) 3 | - CriteoPublisherSdk (6.1.2): 4 | - CriteoMRAID (~> 1.0.1) 5 | - CriteoPublisherSdk/Sdk (= 6.1.2) 6 | - CriteoPublisherSdk/Sdk (6.1.2): 7 | - CriteoMRAID (~> 1.0.1) 8 | - Eureka (5.3.2) 9 | - Google-Mobile-Ads-SDK (11.5.0): 10 | - GoogleUserMessagingPlatform (>= 1.1) 11 | - GoogleUserMessagingPlatform (2.4.0) 12 | 13 | DEPENDENCIES: 14 | - CriteoPublisherSdk (~> 6.1.2) 15 | - Eureka 16 | - Google-Mobile-Ads-SDK 17 | 18 | SPEC REPOS: 19 | trunk: 20 | - CriteoMRAID 21 | - CriteoPublisherSdk 22 | - Eureka 23 | - Google-Mobile-Ads-SDK 24 | - GoogleUserMessagingPlatform 25 | 26 | SPEC CHECKSUMS: 27 | CriteoMRAID: a037bee17b929a8bede8a07279e01a269cd85210 28 | CriteoPublisherSdk: 710001048da8bde09116fc9812c879d4cdfcd480 29 | Eureka: 1c2b8b5892bfb0e972d0fe05f8c09fd89f8625ec 30 | Google-Mobile-Ads-SDK: 7db2098033ad3bfcd72a11e7503b49700a93029e 31 | GoogleUserMessagingPlatform: f131fa7978d2ba88d7426702b057c2cc318e6595 32 | 33 | PODFILE CHECKSUM: 12a302b23b5f4259f745dda32753c8951d5f0ed2 34 | 35 | COCOAPODS: 1.15.2 36 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/MRAID/Logging/MRAIDLog.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MRAIDLog.swift 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2023 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | import Foundation 21 | 22 | public struct MRAIDActionMessage: ActionRepresentable, Decodable { 23 | public let action: Action 24 | } 25 | 26 | public struct MRAIDLog: ActionRepresentable, Decodable { 27 | public let logId: String? 28 | public let message: String 29 | public let logLevel: LogLevel 30 | public let action: Action 31 | } 32 | -------------------------------------------------------------------------------- /CriteoGoogleAdapter/Sources/CriteoGoogleAdapter/CRCustomEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRCustomEvent.h 3 | // CriteoGoogleAdapter 4 | // 5 | // Copyright © 2018-2022 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | #import 22 | #import 23 | 24 | NS_ASSUME_NONNULL_BEGIN 25 | 26 | @interface CRCustomEvent : NSObject 27 | 28 | - (NSError *)noFillError:(NSError *)error; 29 | 30 | @end 31 | 32 | NS_ASSUME_NONNULL_END 33 | -------------------------------------------------------------------------------- /CriteoMoPubAdapter/Sources/CriteoMoPubAdapter/CRCustomEventHelper.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRCustomEventHelper.h 3 | // CriteoMoPubAdapter 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | 19 | #import 20 | 21 | NS_ASSUME_NONNULL_BEGIN 22 | 23 | extern NSString *const kCRCustomEventHelperCpId; 24 | extern NSString *const kCRCustomEventHelperAdUnitId; 25 | 26 | @interface CRCustomEventHelper : NSObject 27 | 28 | + (BOOL)checkValidInfo:(NSDictionary *)info; 29 | 30 | @end 31 | 32 | NS_ASSUME_NONNULL_END 33 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Tests/Utility/Mocks/MockWKWebView.m: -------------------------------------------------------------------------------- 1 | // 2 | // MockWKWebView.m 3 | // CriteoPublisherSdkTests 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import "MockWKWebView.h" 21 | 22 | @implementation MockWKWebView 23 | 24 | - (nullable WKNavigation *)loadHTMLString:(NSString *)string baseURL:(nullable NSURL *)baseURL { 25 | self.loadedBaseURL = baseURL; 26 | self.loadedHTMLString = string; 27 | [super loadHTMLString:string baseURL:baseURL]; 28 | return nil; 29 | } 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Cassette/CR_CASDataSerializer.h: -------------------------------------------------------------------------------- 1 | // Copyright 2021 LinkedIn Corporation 2 | // Licensed under the BSD 2-Clause License (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at https://opensource.org/licenses/BSD-2-Clause 5 | // 6 | // Unless required by applicable law or agreed to in writing, software 7 | // distributed under the License is distributed on an "AS IS" BASIS, 8 | // WITHOUT WARRANTIES OF ANY KIND, either express or implied. 9 | // See the License for the specific language governing permissions and limitations under the License. 10 | 11 | #import 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | /** 16 | * Protocol for data serialization and deserialization when persisting objects to the file queue. 17 | */ 18 | @protocol CR_CASDataSerializer 19 | 20 | - (NSData * _Nullable)serialize:(id)object error:(NSError * _Nullable __autoreleasing *)error; 21 | - (id _Nullable)deserialize:(NSData *)data error:(NSError * _Nullable __autoreleasing *)error; 22 | 23 | @end 24 | 25 | NS_ASSUME_NONNULL_END 26 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Logging/CR_RemoteLogStorage.h: -------------------------------------------------------------------------------- 1 | // 2 | // CR_RemoteLogStorage.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2021 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | 22 | @class CR_RemoteLogRecord; 23 | 24 | NS_ASSUME_NONNULL_BEGIN 25 | 26 | @interface CR_RemoteLogStorage : NSObject 27 | 28 | - (void)pushRemoteLogRecord:(CR_RemoteLogRecord *)record; 29 | - (NSArray *)popRemoteLogRecords:(NSUInteger)size; 30 | 31 | @end 32 | 33 | NS_ASSUME_NONNULL_END 34 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Util/NSURL+Criteo.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSURL+Criteo.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #ifndef NSURL_Additions_h 21 | #define NSURL_Additions_h 22 | 23 | #import 24 | #import 25 | 26 | NS_ASSUME_NONNULL_BEGIN 27 | 28 | @interface NSURL (Criteo) 29 | 30 | + (nullable NSURL *)cr_URLWithStringOrNil:(nullable NSString *)string; 31 | 32 | @end 33 | 34 | NS_ASSUME_NONNULL_END 35 | 36 | #endif /* NSURL_Additions_h */ 37 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Logging/CR_RemoteLogRecordSerializer.h: -------------------------------------------------------------------------------- 1 | // 2 | // CR_RemoteLogRecordSerializer.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2021 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | #import "CR_RemoteLogRecord.h" 22 | 23 | NS_ASSUME_NONNULL_BEGIN 24 | 25 | @interface CR_RemoteLogRecordSerializer : NSObject 26 | 27 | - (NSArray *> *)serializeRecords: 28 | (NSArray *)records; 29 | 30 | @end 31 | 32 | NS_ASSUME_NONNULL_END 33 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Native/CR_NativeImage.h: -------------------------------------------------------------------------------- 1 | // 2 | // CR_NativeImage.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | 22 | @interface CR_NativeImage : NSObject 23 | 24 | @property(readonly, copy, nonatomic) NSString *url; 25 | @property(readonly) int width; 26 | @property(readonly) int height; 27 | 28 | - (instancetype)initWithDict:(NSDictionary *)dict; 29 | + (CR_NativeImage *)nativeImageWithDict:(NSDictionary *)jdict; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Network/CR_URLRequest.h: -------------------------------------------------------------------------------- 1 | // 2 | // CR_URLRequest.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | 22 | @class CR_DeviceInfo; 23 | 24 | NS_ASSUME_NONNULL_BEGIN 25 | 26 | @interface CR_URLRequest : NSMutableURLRequest 27 | 28 | - (instancetype)initWithURL:(NSURL *)url deviceInfo:(CR_DeviceInfo *)deviceInfo; 29 | + (instancetype)requestWithURL:(NSURL *)url deviceInfo:(CR_DeviceInfo *)deviceInfo; 30 | 31 | @end 32 | 33 | NS_ASSUME_NONNULL_END 34 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Context/CR_Session.h: -------------------------------------------------------------------------------- 1 | // 2 | // CR_Session.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | @interface CR_Session : NSObject 25 | 26 | @property(nonatomic, readonly) NSTimeInterval duration; 27 | @property(nonatomic, readonly) NSString *sessionId; 28 | 29 | - (instancetype)init NS_UNAVAILABLE; 30 | - (instancetype)initWithStartDate:(NSDate *)date; 31 | 32 | @end 33 | 34 | NS_ASSUME_NONNULL_END 35 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Public/CRAdUnit.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRAdUnit.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | @interface CRAdUnit : NSObject 25 | 26 | @property(readonly, nonatomic) NSString *adUnitId; 27 | 28 | - (instancetype)init NS_UNAVAILABLE; 29 | 30 | - (NSUInteger)hash; 31 | - (BOOL)isEqual:(nullable id)object; 32 | - (BOOL)isEqualToAdUnit:(CRAdUnit *)adUnit; 33 | 34 | @end 35 | 36 | NS_ASSUME_NONNULL_END 37 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Public/CRRewardedAdUnit.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRRewardedAdUnit.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | @interface CRRewardedAdUnit : CRAdUnit 25 | 26 | - (instancetype)initWithAdUnitId:(NSString *)adUnitId; 27 | 28 | - (NSUInteger)hash; 29 | - (BOOL)isEqual:(nullable id)object; 30 | - (BOOL)isEqualToRewardedAdUnit:(CRRewardedAdUnit *)adUnit; 31 | 32 | @end 33 | 34 | NS_ASSUME_NONNULL_END 35 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Tests/Utility/Categories/CR_ThreadManager+Waiter.m: -------------------------------------------------------------------------------- 1 | // 2 | // CR_ThreadManager+Waiter.m 3 | // CriteoPublisherSdkTests 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | #import "CR_ThreadManager+Waiter.h" 22 | #import "CR_ThreadManagerWaiter.h" 23 | 24 | @implementation CR_ThreadManager (Waiter) 25 | 26 | - (void)waiter_waitIdle { 27 | CR_ThreadManagerWaiter *waiter = [[CR_ThreadManagerWaiter alloc] initWithThreadManager:self]; 28 | [waiter waitIdle]; 29 | } 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Tests/Utility/Checkers/CR_MediaDownloaderDispatchChecker.h: -------------------------------------------------------------------------------- 1 | // 2 | // CR_MediaDownloaderDispatchChecker.h 3 | // CriteoPublisherSdkTests 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import "CR_SafeMediaDownloader.h" 21 | 22 | @class XCTestExpectation; 23 | 24 | NS_ASSUME_NONNULL_BEGIN 25 | 26 | @interface CR_MediaDownloaderDispatchChecker : NSObject 27 | 28 | @property(strong, nonatomic) XCTestExpectation *didDownloadImageOnMainQueue; 29 | 30 | @end 31 | 32 | NS_ASSUME_NONNULL_END 33 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Tests/Utility/NetworkManager/HTTP/CR_HttpContent+AdUnit.h: -------------------------------------------------------------------------------- 1 | // 2 | // CR_HttpContent+AdUnit.h 3 | // CriteoPublisherSdkTests 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import "CR_CacheAdUnit.h" 21 | #import "CR_HttpContent.h" 22 | 23 | NS_ASSUME_NONNULL_BEGIN 24 | 25 | @interface CR_HttpContent (AdUnit) 26 | 27 | - (BOOL)isHTTPRequestForCacheAdUnits:(CR_CacheAdUnitArray *)cacheAdUnits; 28 | - (BOOL)isHTTPRequestForCacheAdUnit:(CR_CacheAdUnit *)cacheAdUnit; 29 | 30 | @end 31 | 32 | NS_ASSUME_NONNULL_END 33 | -------------------------------------------------------------------------------- /wiremock/mappings/inapp-v2.json: -------------------------------------------------------------------------------- 1 | { 2 | "request": { 3 | "urlPath": "/inapp/v2", 4 | "bodyPatterns": [ { 5 | "equalToJson": "{ \"slots\" : [ { \"rewarded\" : true } ] }", 6 | "ignoreArrayOrder": true, 7 | "ignoreExtraElements": true 8 | }] 9 | }, 10 | "response": { 11 | "jsonBody": { 12 | "slots": [{ 13 | "impId": "{{ jsonPath request.body '$.slots[0].impId' }}", 14 | "placementId": "{{ jsonPath request.body '$.slots[0].placementId' }}", 15 | "arbitrageId": "arbitrage_id", 16 | "zoneId": 0, 17 | "cpm": "1.12", 18 | "currency": "EUR", 19 | "width": 390, 20 | "height": 844, 21 | "ttl": 3600, 22 | "displayUrl": "https://localhost:9099/delivery/vast.php", 23 | "isVideo": true, 24 | "rewarded": true 25 | }], 26 | "requestId": "{{ jsonPath request.body '$.id'}}", 27 | "consentGiven": true 28 | }, 29 | "transformers": ["response-template"] 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/MRAID/Resize/MRAIDCustomClosePosition.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MRAIDCustomClosePosition.swift 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2023 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | import Foundation 21 | 22 | public enum MRAIDCustomClosePosition: String, Decodable { 23 | case topLeft = "top-left" 24 | case topRight = "top-right" 25 | case center 26 | case bottomLeft = "bottom-left" 27 | case bottomRight = "bottom-right" 28 | case topCenter = "top-center" 29 | case bottomCenter = "bottom-center" 30 | } 31 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Util/NSObject+Criteo.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+Criteo.m 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import "NSObject+Criteo.h" 21 | #import 22 | 23 | @implementation NSObject (Criteo) 24 | 25 | + (BOOL)cr_object:(nullable id)obj1 isEqualTo:(nullable id)obj2 { 26 | if (obj1) { 27 | return [obj1 isEqual:obj2]; // isEqual returns NO if obj2 is nil 28 | } else { 29 | return !obj2; // returns YES if obj1 and obj2 are both nil 30 | } 31 | } 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Cassette/CR_CASError.h: -------------------------------------------------------------------------------- 1 | // Copyright 2016 LinkedIn Corporation 2 | // Licensed under the BSD 2-Clause License (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at https://opensource.org/licenses/BSD-2-Clause 5 | // 6 | // Unless required by applicable law or agreed to in writing, software 7 | // distributed under the License is distributed on an "AS IS" BASIS, 8 | // WITHOUT WARRANTIES OF ANY KIND, either express or implied. 9 | // See the License for the specific language governing permissions and limitations under the License. 10 | 11 | #import 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | FOUNDATION_EXPORT NSString *const CR_CASErrorDomain; 16 | FOUNDATION_EXPORT const int CR_CASErrorCode; 17 | 18 | typedef NS_ENUM(NSInteger, CR_CASErrorType) { 19 | CR_CASErrorFileInitialization 20 | }; 21 | 22 | @interface CR_CASError : NSObject 23 | 24 | + (NSError *)createError:(CR_CASErrorType)type; 25 | + (BOOL)handleError:(nullable NSError *)casError error:(NSError * __autoreleasing *)error; 26 | 27 | @end 28 | 29 | NS_ASSUME_NONNULL_END 30 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Public/CRInterstitialAdUnit.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRInterstitialAdUnit.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | @interface CRInterstitialAdUnit : CRAdUnit 25 | 26 | - (instancetype)initWithAdUnitId:(NSString *)adUnitId; 27 | 28 | - (NSUInteger)hash; 29 | - (BOOL)isEqual:(nullable id)object; 30 | - (BOOL)isEqualToInterstitialAdUnit:(CRInterstitialAdUnit *)adUnit; 31 | 32 | @end 33 | 34 | NS_ASSUME_NONNULL_END 35 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Tests/Utility/Categories/NSUserDefaults+Testing.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSUserDefaults+Testing.m 3 | // CriteoPublisherSdkTests 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import "NSUserDefaults+Testing.h" 21 | 22 | NSString* const NSUserDefaultsKillSwitchKey = @"CRITEO_KillSwitch"; 23 | NSString* const NSUserDefaultsCsmEnabledKey = @"CRITEO_CsmEnabled"; 24 | NSString* const NSUserDefaultsLiveBiddingEnabledKey = @"CRITEO_LiveBiddingEnabled"; 25 | NSString* const NSUserDefaultsLiveBiddingTimeBudgetKey = @"CRITEO_LiveBiddingTimeBudget"; 26 | -------------------------------------------------------------------------------- /CriteoMoPubAdapter/Sources/CriteoMoPubAdapter/CRNativeAdDelegateHandler.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRNativeAdDelegateHandler.h 3 | // CriteoMoPubAdapter 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | #import 22 | 23 | @class CRNativeCustomEvent; 24 | 25 | NS_ASSUME_NONNULL_BEGIN 26 | 27 | @interface CRNativeAdDelegateHandler : NSObject 28 | 29 | - (instancetype)initWithCustomEvent:(CRNativeCustomEvent *)customEvent; 30 | 31 | @end 32 | 33 | NS_ASSUME_NONNULL_END 34 | -------------------------------------------------------------------------------- /CriteoAdViewer/Sources/Logs/LogEntry.h: -------------------------------------------------------------------------------- 1 | // 2 | // LogEntry.h 3 | // CriteoAdViewer 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | @protocol LogEntry 25 | 26 | #pragma mark - Properties 27 | 28 | @property(copy, nonatomic, readonly) NSDate *timestamp; 29 | @property(copy, nonatomic, readonly) NSString *title; 30 | @property(copy, nonatomic, readonly) NSString *subtitle; 31 | @property(copy, nonatomic, readonly) NSString *detail; 32 | 33 | @end 34 | 35 | NS_ASSUME_NONNULL_END 36 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Tests/IntegrationTests/NativeAd/SimpleViewController/CR_CustomNativeAdView.h: -------------------------------------------------------------------------------- 1 | // 2 | // CR_CustomNativeAdView.h 3 | // CriteoPublisherSdkTests 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import "CRNativeAdView.h" 21 | 22 | @class CRNativeAd; 23 | @class CRMediaView; 24 | 25 | NS_ASSUME_NONNULL_BEGIN 26 | 27 | @interface CR_CustomNativeAdView : CRNativeAdView 28 | 29 | @property(strong, nonatomic) CRMediaView *productMediaView; 30 | @property(strong, nonatomic) CRMediaView *advertiserLogoMediaView; 31 | 32 | @end 33 | 34 | NS_ASSUME_NONNULL_END 35 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Tests/Utility/Checkers/CR_ViewCheckingHelper.m: -------------------------------------------------------------------------------- 1 | // 2 | // CR_ViewCheckingHelper.m 3 | // CriteoPublisherSdkTests 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import "CR_ViewCheckingHelper.h" 21 | 22 | @implementation CR_ViewCheckingHelper 23 | 24 | + (NSString *)preprodCreativeImageUrl { 25 | return @"https://publisherdirect.criteo.com/publishertag/preprodtest/creative_cas.png"; 26 | } 27 | 28 | + (NSString *)preprodCreativeImageUrlForNative { 29 | return @"https://publisherdirect.criteo.com/publishertag/preprodtest/creative.png"; 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /CriteoAdViewer/Sources/AdViewer-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // AdViewer-Bridging-Header.h 3 | // CriteoAdViewer 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | // 21 | // Use this file to import your target's public headers that you would like to 22 | // expose to Swift. 23 | // 24 | 25 | #import 26 | 27 | #import 28 | #import "Criteo+Internal.h" 29 | 30 | #import "LogManager.h" 31 | #import "GoogleDFPLogger.h" 32 | #import "StandaloneLogger.h" 33 | 34 | #import "InterstitialUpdateDelegate.h" 35 | #import "CRVNativeAdView.h" 36 | -------------------------------------------------------------------------------- /CriteoAdViewer/Sources/Standalone/StandaloneLogger.h: -------------------------------------------------------------------------------- 1 | // 2 | // StandaloneLogger.h 3 | // CriteoAdViewer 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | #import 22 | 23 | @protocol InterstitialUpdateDelegate; 24 | 25 | NS_ASSUME_NONNULL_BEGIN 26 | 27 | @interface StandaloneLogger 28 | : NSObject 29 | 30 | @property(weak, nonatomic) id interstitialDelegate; 31 | 32 | @end 33 | 34 | NS_ASSUME_NONNULL_END 35 | -------------------------------------------------------------------------------- /CriteoAdViewer/Sources/Logs/ResponseLogEntry.h: -------------------------------------------------------------------------------- 1 | // 2 | // ResponseLogEntry.h 3 | // CriteoAdViewer 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import "LogEntry.h" 21 | 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | @interface ResponseLogEntry : NSObject 25 | 26 | #pragma mark - Lifecycle 27 | 28 | - (instancetype)initWithResponse:(NSURLResponse *)response 29 | data:(NSData *)data 30 | error:(NSError *)error NS_DESIGNATED_INITIALIZER; 31 | 32 | - (instancetype)init NS_UNAVAILABLE; 33 | 34 | @end 35 | 36 | NS_ASSUME_NONNULL_END 37 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Util/NSString+Criteo.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+Criteo.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #ifndef NSString_Criteo_h 21 | #define NSString_Criteo_h 22 | 23 | #import 24 | 25 | NS_ASSUME_NONNULL_BEGIN 26 | 27 | @interface NSString (Criteo) 28 | 29 | + (nullable NSString *)cr_StringWithStringOrNil:(nullable NSString *)string; 30 | + (nullable NSString *)cr_nonEmptyStringWithStringOrNil:(nullable NSString *)string; 31 | 32 | @end 33 | 34 | NS_ASSUME_NONNULL_END 35 | 36 | #endif /* NSString_Criteo_h */ 37 | -------------------------------------------------------------------------------- /CriteoAdViewer/Sources/AdViewer/AdViewBuilder.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AdViewBuilder.swift 3 | // CriteoAdViewer 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | typealias BannerView = UIView 21 | 22 | protocol InterstitialView { 23 | func present(viewController: UIViewController) 24 | } 25 | 26 | enum AdView { 27 | case banner(BannerView) 28 | case interstitial(InterstitialView) 29 | } 30 | 31 | typealias AdViewController = UIViewController & InterstitialUpdateDelegate 32 | 33 | protocol AdViewBuilder { 34 | func build(config: AdConfig, criteo: Criteo, completion: @escaping (AdView) -> Void) 35 | } 36 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Configuration/CR_RemoteConfigRequest.h: -------------------------------------------------------------------------------- 1 | // 2 | // CR_RemoteConfigRequest.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | 22 | @class CR_Config; 23 | 24 | NS_ASSUME_NONNULL_BEGIN 25 | 26 | @interface CR_RemoteConfigRequest : NSObject 27 | 28 | @property(copy, nonatomic, readonly) NSString *configUrl; 29 | @property(copy, nonatomic, readonly) NSDictionary *postBody; 30 | 31 | + (instancetype)requestWithConfig:(CR_Config *)config profileId:(NSNumber *)profileId; 32 | 33 | @end 34 | 35 | NS_ASSUME_NONNULL_END 36 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Native/CR_NativePrivacy.h: -------------------------------------------------------------------------------- 1 | // 2 | // CR_NativePrivacy.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | 22 | @interface CR_NativePrivacy : NSObject 23 | 24 | @property(readonly, copy, nonatomic) NSString *optoutClickUrl; 25 | @property(readonly, copy, nonatomic) NSString *optoutImageUrl; 26 | @property(readonly, copy, nonatomic) NSString *longLegalText; 27 | 28 | - (instancetype)initWithDict:(NSDictionary *)dict; 29 | + (CR_NativePrivacy *)nativePrivacyWithDict:(NSDictionary *)dict; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Tests/Utility/CR_Timer.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRTimer.h 3 | // CriteoPublisherSdkTests 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | @interface CR_Timer : NSObject 25 | 26 | @property(nonatomic, assign, readonly, getter=isValid) BOOL valid; 27 | 28 | + (CR_Timer *)scheduledTimerWithTimeInterval:(NSTimeInterval)interval 29 | repeats:(BOOL)repeats 30 | block:(void (^)(NSTimer *timer))block; 31 | 32 | @end 33 | 34 | NS_ASSUME_NONNULL_END 35 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Tests/Utility/MRAID/CR_MRAIDUtils.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CR_MRAIDUtils.swift 3 | // CriteoPublisherSdkTests 4 | // 5 | // Copyright © 2018-2023 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | import Foundation 21 | 22 | @objc 23 | public class CR_MRAIDUtils: NSObject { 24 | @objc 25 | public static func mraidBundle() -> Bundle? { 26 | for bundle in Bundle.allBundles { 27 | if bundle.bundlePath.hasSuffix("xctest"), 28 | let path = bundle.path(forResource: "CriteoMRAIDResource", ofType: "bundle") { 29 | return Bundle.init(path: path) 30 | } 31 | } 32 | 33 | return nil 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - CriteoMRAID (2.0.0) 3 | - Eureka (5.4.0) 4 | - FunctionalObjC (1.0.2) 5 | - Google-Mobile-Ads-SDK (11.5.0): 6 | - GoogleUserMessagingPlatform (>= 1.1) 7 | - GoogleUserMessagingPlatform (2.4.0) 8 | - OCMock (3.9.1) 9 | - SwiftLint (0.45.1) 10 | 11 | DEPENDENCIES: 12 | - CriteoMRAID (~> 2.0.0) 13 | - Eureka 14 | - FunctionalObjC (~> 1.0) 15 | - Google-Mobile-Ads-SDK 16 | - OCMock (~> 3.6) 17 | - SwiftLint (~> 0.45.0) 18 | 19 | SPEC REPOS: 20 | trunk: 21 | - CriteoMRAID 22 | - Eureka 23 | - FunctionalObjC 24 | - Google-Mobile-Ads-SDK 25 | - GoogleUserMessagingPlatform 26 | - OCMock 27 | - SwiftLint 28 | 29 | SPEC CHECKSUMS: 30 | CriteoMRAID: ed0541c7f49680a22fe4e704420c1436cbffe246 31 | Eureka: fadaa9fa3d6e402d3c60f78f24edf3d7bafc9c29 32 | FunctionalObjC: bd6aaa4b69abea0a5ac0e860a052c1ebebd5311c 33 | Google-Mobile-Ads-SDK: 7db2098033ad3bfcd72a11e7503b49700a93029e 34 | GoogleUserMessagingPlatform: f131fa7978d2ba88d7426702b057c2cc318e6595 35 | OCMock: 9491e4bec59e0b267d52a9184ff5605995e74be8 36 | SwiftLint: 06ac37e4d38c7068e0935bb30cda95f093bec761 37 | 38 | PODFILE CHECKSUM: debd610e4d3856bc7ad7baafb7e5687354157485 39 | 40 | COCOAPODS: 1.15.2 41 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Network/Serializers/CR_FeedbacksSerializer.h: -------------------------------------------------------------------------------- 1 | // 2 | // CR_FeedbacksSerializer.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | 22 | @class CR_FeedbackMessage; 23 | @class CR_Config; 24 | 25 | NS_ASSUME_NONNULL_BEGIN 26 | 27 | @interface CR_FeedbacksSerializer : NSObject 28 | 29 | - (NSDictionary *)postBodyForCsm:(NSArray *)messages 30 | config:(CR_Config *)config 31 | profileId:(NSNumber *)profileId; 32 | 33 | @end 34 | 35 | NS_ASSUME_NONNULL_END 36 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/MRAID/Logging/ActionRepresentable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ActionRepresentable.swift 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2023 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | import Foundation 21 | 22 | public protocol ActionRepresentable { 23 | var action: Action { get } 24 | } 25 | 26 | public enum Action: String, Decodable { 27 | case log 28 | case `open` 29 | case expand 30 | case close 31 | case none 32 | case playVideo = "play_video" 33 | case resize 34 | case orientationPropertiesUpdate = "orientation_properties_update" 35 | case orientationPropertiesSet = "set_orientation_properties" 36 | } 37 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Util/NSDictionary+Criteo.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSDictionary+Criteo.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #ifndef NSDictionary_Criteo_h 21 | #define NSDictionary_Criteo_h 22 | 23 | #import 24 | 25 | NS_ASSUME_NONNULL_BEGIN 26 | 27 | @interface NSDictionary (Criteo) 28 | 29 | - (NSDictionary *)cr_dictionaryWithNewValue:(nullable id)value forKey:(id)key; 30 | - (nullable NSDictionary *)cr_dictionaryWithNewValue:(nullable id)value forKeys:(NSArray *)keys; 31 | 32 | @end 33 | 34 | NS_ASSUME_NONNULL_END 35 | 36 | #endif /* NSArray_Criteo_h */ 37 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Util/NSUserDefaults+Criteo.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSUserDefaults+Criteo.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | @interface NSUserDefaults (Criteo) 25 | 26 | - (BOOL)cr_containsKey:(NSString *)key; 27 | 28 | - (BOOL)boolForKey:(NSString *)key withDefaultValue:(BOOL)defaultValue; 29 | 30 | - (double)doubleForKey:(NSString *)key withDefaultValue:(double)defaultValue; 31 | 32 | - (int)intForKey:(NSString *)key withDefaultValue:(int)defaultValue; 33 | 34 | @end 35 | 36 | NS_ASSUME_NONNULL_END 37 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Public/CRBannerAdUnit.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRBannerAdUnit.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | 22 | #import 23 | 24 | NS_ASSUME_NONNULL_BEGIN 25 | 26 | @interface CRBannerAdUnit : CRAdUnit 27 | 28 | @property(readonly, nonatomic) CGSize size; 29 | 30 | - (instancetype)initWithAdUnitId:(NSString *)adUnitId size:(CGSize)size; 31 | 32 | - (NSUInteger)hash; 33 | - (BOOL)isEqual:(nullable id)object; 34 | - (BOOL)isEqualToBannerAdUnit:(CRBannerAdUnit *)adUnit; 35 | 36 | @end 37 | 38 | NS_ASSUME_NONNULL_END 39 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/SKAdNetwork/CR_SKAdNetworkHandler.h: -------------------------------------------------------------------------------- 1 | // 2 | // CR_SKAdNetworkHandler.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2023 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | #import "CR_SKAdNetworkParameters.h" 22 | 23 | NS_ASSUME_NONNULL_BEGIN 24 | 25 | @interface CR_SKAdNetworkHandler : NSObject 26 | 27 | - (instancetype)initWithParameters:(CR_SKAdNetworkParameters *)skAdNetworkParameters 28 | API_AVAILABLE(ios(14.5)); 29 | - (void)startSKAdImpression API_AVAILABLE(ios(14.5)); 30 | - (void)endSKAdImpression API_AVAILABLE(ios(14.5)); 31 | 32 | @end 33 | 34 | NS_ASSUME_NONNULL_END 35 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Native/CR_ImageCache.h: -------------------------------------------------------------------------------- 1 | // 2 | // CR_ImageCache.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | 22 | @class UIImage; 23 | 24 | NS_ASSUME_NONNULL_BEGIN 25 | 26 | @interface CR_ImageCache : NSObject 27 | 28 | - (instancetype)init NS_UNAVAILABLE; 29 | 30 | - (instancetype)initWithSizeLimit:(NSUInteger)dataSizeLimit NS_DESIGNATED_INITIALIZER; 31 | 32 | - (void)setImage:(UIImage *)image forUrl:(NSURL *)url imageSize:(NSUInteger)size; 33 | 34 | - (nullable UIImage *)imageForUrl:(NSURL *)url; 35 | 36 | @end 37 | 38 | NS_ASSUME_NONNULL_END 39 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Native/CR_SafeMediaDownloader.h: -------------------------------------------------------------------------------- 1 | // 2 | // CR_SafeMediaDownloader.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import "CRMediaDownloader.h" 21 | 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | @class CR_ThreadManager; 25 | 26 | @interface CR_SafeMediaDownloader : NSObject 27 | 28 | - (instancetype)init NS_UNAVAILABLE; 29 | 30 | - (instancetype)initWithUnsafeDownloader:(id)downloader 31 | threadManager:(CR_ThreadManager *)threadManager 32 | NS_DESIGNATED_INITIALIZER; 33 | 34 | @end 35 | 36 | NS_ASSUME_NONNULL_END 37 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Public/CRNativeAdUnit.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRNativeAdUnit.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #ifndef CRNativeAdUnit_h 21 | #define CRNativeAdUnit_h 22 | 23 | #import 24 | 25 | NS_ASSUME_NONNULL_BEGIN 26 | 27 | /** 28 | Ad Unit used for both Custom Native Ad and Advanced Native Ad. 29 | */ 30 | @interface CRNativeAdUnit : CRAdUnit 31 | 32 | - (instancetype)initWithAdUnitId:(NSString *)adUnitId; 33 | - (BOOL)isEqualToNativeAdUnit:(CRNativeAdUnit *)other; 34 | 35 | @end 36 | 37 | NS_ASSUME_NONNULL_END 38 | 39 | #endif /* CRNativeAdUnit_h */ 40 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Tests/Utility/Mocks/CR_DeviceInfoMock.h: -------------------------------------------------------------------------------- 1 | // 2 | // CR_DeviceInfoMock.h 3 | // CriteoPublisherSdkTests 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import "CR_DeviceInfo+Testing.h" 21 | 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | extern NSString* const CR_DeviceInfoMockDefaultCrtSize; 25 | 26 | @interface CR_DeviceInfoMock : CR_DeviceInfo 27 | 28 | @property(assign, nonatomic) BOOL mock_isPhone; // Default YES. 29 | @property(assign, nonatomic) BOOL mock_isInPortrait; // Default YES. 30 | @property(assign, nonatomic) CGSize mock_screenSize; // Default 320/480. 31 | 32 | @end 33 | 34 | NS_ASSUME_NONNULL_END 35 | -------------------------------------------------------------------------------- /CriteoMoPubAdapter/Sources/CriteoMoPubAdapter/CRNativeCustomEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRNativeCustomEvent.h 3 | // CriteoMoPubAdapter 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #if __has_include() 21 | #import 22 | #elif __has_include() 23 | #import 24 | #elif __has_include() 25 | #import 26 | #else 27 | #import "MoPub.h" 28 | #endif 29 | 30 | #import 31 | 32 | NS_ASSUME_NONNULL_BEGIN 33 | 34 | @interface CRNativeCustomEvent : MPNativeCustomEvent 35 | 36 | @end 37 | 38 | NS_ASSUME_NONNULL_END 39 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/MRAID/MRAIDFeature.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MRAIDFeature.swift 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2023 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | import Foundation 21 | import MessageUI 22 | 23 | public struct MRAIDFeatures: Codable { 24 | var sms: Bool = false 25 | var tel: Bool = false 26 | 27 | public init() { 28 | if 29 | let telURL = URL(string: "tel://"), 30 | UIApplication.shared.canOpenURL(telURL) { 31 | self.tel = true 32 | } 33 | 34 | if MFMessageComposeViewController.canSendText() { 35 | self.sms = true 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Tests/IntegrationTests/CR_IntegrationsTestBase.h: -------------------------------------------------------------------------------- 1 | // 2 | // CR_IntegrationsTestBase.h 3 | // CriteoPublisherSdkTests 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | #import 22 | #import "Criteo.h" 23 | 24 | @class CRBannerAdUnit; 25 | @class CRInterstitialAdUnit; 26 | 27 | @interface CR_IntegrationsTestBase : XCTestCase 28 | 29 | @property(nonatomic) Criteo *criteo; 30 | 31 | - (void)initCriteoWithAdUnits:(NSArray *)adUnits; 32 | 33 | - (void)waitForIdleState; 34 | 35 | - (void)enrichAdObject:(id)object forAdUnit:(CRAdUnit *)adUnit; 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/MRAID/OrientationProperties/MRAIDDeviceOrientation.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MRAIDDeviceOrientation.swift 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2023 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | import Foundation 21 | 22 | public enum MRAIDDeviceOrientation: String, Decodable { 23 | case portrait 24 | case landscape 25 | case `none` 26 | } 27 | 28 | extension MRAIDDeviceOrientation { 29 | var interfaceOrientation: UIInterfaceOrientation? { 30 | switch self { 31 | case .landscape: return .landscapeLeft 32 | case .portrait: return .portrait 33 | default: return nil 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Tests/IntegrationTests/NativeAssetsFromCdb.json: -------------------------------------------------------------------------------- 1 | { 2 | "products": [ 3 | { 4 | "title": "Criteo native solution", 5 | "description": "A smart solution for your Native advertising", 6 | "price": "10$", 7 | "clickUrl": "https://www.criteo.com/products/", 8 | "callToAction": "Try it now!", 9 | "image": { 10 | "url": "https://publisherdirect.criteo.com/publishertag/preprodtest/creative.png", 11 | "height": 300, 12 | "width": 300 13 | } 14 | } 15 | ], 16 | "advertiser": { 17 | "description": "Our digital marketing solutions are trusted", 18 | "domain": "criteo.com", 19 | "logo": { 20 | "url": "https://www.criteo.com/images/criteo-logo.svg", 21 | "height": 300, 22 | "width": 300 23 | }, 24 | "logoClickUrl": "https://www.criteo.com" 25 | }, 26 | "privacy": { 27 | "optoutClickUrl": "https://info.criteo.com/privacy/informations", 28 | "optoutImageUrl": "https://static.criteo.net/flash/icon/nai_small.png", 29 | "longLegalText": "Long Legal Text" 30 | }, 31 | "impressionPixels": [ 32 | { 33 | "url": "https://my-impression-pixel/test/impression" 34 | }, 35 | { 36 | "url": "https://cas.com/lg.com" 37 | } 38 | ] 39 | } -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Context/CR_Session.m: -------------------------------------------------------------------------------- 1 | // 2 | // CR_Session.m 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import "CR_Session.h" 21 | #import "CR_UniqueIdGenerator.h" 22 | 23 | @interface CR_Session () 24 | @property(nonatomic, copy) NSDate *startDate; 25 | @end 26 | 27 | @implementation CR_Session 28 | 29 | - (id)initWithStartDate:(NSDate *)date { 30 | if (self = [super init]) { 31 | _startDate = date; 32 | _sessionId = CR_UniqueIdGenerator.generateId; 33 | } 34 | return self; 35 | } 36 | 37 | - (NSTimeInterval)duration { 38 | return -self.startDate.timeIntervalSinceNow; 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Tests/CriteoPublisherSdkTests-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to 3 | // expose to Swift. 4 | // 5 | 6 | #import "CR_ApiHandler.h" 7 | #import "CR_ApiQueryKeys.h" 8 | #import "CR_BidManager.h" 9 | #import "CR_BidManager+Testing.h" 10 | #import "CR_BidRequestSerializer.h" 11 | #import "CR_CdbBidBuilder.h" 12 | #import "CR_DataProtectionConsent.h" 13 | #import "CR_DataProtectionConsentMock.h" 14 | #import "CR_DependencyProvider.h" 15 | #import "CR_DependencyProvider+Testing.h" 16 | #import "CR_DeviceInfoMock.h" 17 | #import "CR_DisplaySizeInjector.h" 18 | #import "CR_FeedbackController.h" 19 | #import "CR_FeedbackFileManager.h" 20 | #import "CR_FeedbackStorage+Internal.h" 21 | #import "CR_FeedbacksSerializer.h" 22 | #import "CR_Gdpr.h" 23 | #import "CR_GdprSerializer.h" 24 | #import "CR_HeaderBidding.h" 25 | #import "CR_InMemoryUserDefaults.h" 26 | #import "CR_IntegrationRegistry.h" 27 | #import "CR_LogHandler.h" 28 | #import "CR_RemoteLogStorage+Internal.h" 29 | #import "CR_Session.h" 30 | #import "CR_SynchronousThreadManager.h" 31 | #import "CR_UniqueIdGenerator.h" 32 | #import "CR_RemoteLogHandler.h" 33 | #import "Criteo+Testing.h" 34 | #import "NSString+APIKeys.h" 35 | #import "NSString+GDPR.h" 36 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Native/CR_DefaultMediaDownloader.h: -------------------------------------------------------------------------------- 1 | // 2 | // CR_DefaultMediaDownloader.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import "CRMediaDownloader.h" 21 | 22 | @class CR_NetworkManager; 23 | @class CR_ImageCache; 24 | 25 | NS_ASSUME_NONNULL_BEGIN 26 | 27 | @interface CR_DefaultMediaDownloader : NSObject 28 | 29 | - (instancetype)init NS_UNAVAILABLE; 30 | 31 | - (instancetype)initWithNetworkManager:(CR_NetworkManager *)networkManager 32 | imageCache:(CR_ImageCache *)imageCache NS_DESIGNATED_INITIALIZER; 33 | 34 | @end 35 | 36 | NS_ASSUME_NONNULL_END 37 | -------------------------------------------------------------------------------- /CriteoAdViewer/Sources/GoogleDFP/GoogleDFPLogger.h: -------------------------------------------------------------------------------- 1 | // 2 | // GoogleDFPLogger.h 3 | // CriteoAdViewer 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | @import GoogleMobileAds; 22 | 23 | @protocol InterstitialUpdateDelegate; 24 | 25 | NS_ASSUME_NONNULL_BEGIN 26 | 27 | @interface GoogleDFPLogger 28 | : NSObject 29 | 30 | #pragma mark - Lifecycle 31 | 32 | - (instancetype)init NS_UNAVAILABLE; 33 | 34 | - (instancetype)initWithInterstitialDelegate:(id)interstitialDelegate; 35 | 36 | @end 37 | 38 | NS_ASSUME_NONNULL_END 39 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Public/CRMediaContent.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRMediaContent.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | #import 22 | 23 | NS_ASSUME_NONNULL_BEGIN 24 | 25 | /** 26 | * A media content is a Native Ad sub-element that can be loaded asynchronously. 27 | * 28 | * It represents media for native product image/video or advertiser logo. 29 | */ 30 | @interface CRMediaContent : NSObject 31 | 32 | @property(copy, nonatomic, readonly, nullable) NSURL *url; 33 | 34 | - (instancetype)init NS_UNAVAILABLE; 35 | 36 | @end 37 | 38 | NS_ASSUME_NONNULL_END 39 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Tests/UnitTests/DFPRequestClasses.h: -------------------------------------------------------------------------------- 1 | // 2 | // DFPRequestClasses.h 3 | // CriteoPublisherSdkTests 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #ifndef DFPRequestClasses_h 21 | #define DFPRequestClasses_h 22 | 23 | #import 24 | 25 | // NOTE: This is OK that there is no explicit implementation for these interfaces. 26 | // NOTE: The implementation is provided by GoogleMobileAds SDK. 27 | 28 | @interface GADRequest : NSObject 29 | @property(readwrite, copy, nonatomic, nullable) NSDictionary *customTargeting; 30 | @end 31 | 32 | @interface GAMRequest : GADRequest 33 | @end 34 | 35 | #endif /* DFPRequestClasses_h */ 36 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Util/NSArray+Criteo.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+Criteo.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #ifndef NSArray_Criteo_h 21 | #define NSArray_Criteo_h 22 | 23 | #import 24 | 25 | typedef NSArray StringArray; 26 | typedef NSMutableArray MutableStringArray; 27 | 28 | NS_ASSUME_NONNULL_BEGIN 29 | 30 | @interface NSArray (Criteo) 31 | 32 | - (NSArray *)cr_splitIntoChunks:(NSUInteger)chunkSize; 33 | - (NSDictionary *)cr_groupByKey:(id (^)(id item))keyForItemBlock; 34 | 35 | @end 36 | 37 | NS_ASSUME_NONNULL_END 38 | 39 | #endif /* NSArray_Criteo_h */ 40 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Public/CRBannerViewDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRBannerViewDelegate.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #ifndef CRBannerViewDelegate_h 21 | #define CRBannerViewDelegate_h 22 | 23 | @class CRBannerView; 24 | 25 | @protocol CRBannerViewDelegate 26 | 27 | @optional 28 | - (void)banner:(CRBannerView *)bannerView didFailToReceiveAdWithError:(NSError *)error; 29 | - (void)bannerDidReceiveAd:(CRBannerView *)bannerView; 30 | - (void)bannerWillLeaveApplication:(CRBannerView *)bannerView; 31 | - (void)bannerWasClicked:(CRBannerView *)bannerView; 32 | 33 | @end 34 | 35 | #endif /* CRBannerViewDelegate_h */ 36 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Native/CRMediaContent.m: -------------------------------------------------------------------------------- 1 | // 2 | // CRMediaContent.m 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import "CRMediaContent.h" 21 | #import "CRMediaContent+Internal.h" 22 | #import "CRMediaDownloader.h" 23 | #import "CR_NativeImage.h" 24 | #import "NSURL+Criteo.h" 25 | 26 | @implementation CRMediaContent 27 | 28 | - (instancetype)initWithNativeImage:(CR_NativeImage *)image 29 | mediaDownloader:(id)mediaDownloader { 30 | if (self = [super init]) { 31 | _url = [NSURL cr_URLWithStringOrNil:image.url]; 32 | _mediaDownloader = mediaDownloader; 33 | } 34 | return self; 35 | } 36 | 37 | @end -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/CR_CacheManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // CR_CacheManager.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #ifndef CR_CacheManager_h 21 | #define CR_CacheManager_h 22 | 23 | #import 24 | #import "CR_CdbBid.h" 25 | #import "CR_CacheAdUnit.h" 26 | 27 | @interface CR_CacheManager : NSObject 28 | 29 | @property(nonatomic, strong) NSMutableDictionary *bidCache; 30 | 31 | - (CR_CacheAdUnit *)setBid:(CR_CdbBid *)bid; 32 | 33 | - (CR_CdbBid *)getBidForAdUnit:(CR_CacheAdUnit *)adUnit; 34 | 35 | - (void)removeBidForAdUnit:(CR_CacheAdUnit *)adUnit; 36 | 37 | @end 38 | 39 | #endif /* CR_CacheManager_h */ 40 | -------------------------------------------------------------------------------- /CriteoAdViewer/Sources/NativeAd/CRVNativeAdView.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRVNativeAdView.h 3 | // CriteoAdViewer 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | @interface CRVNativeAdView : CRNativeAdView 25 | 26 | @property(nonatomic, weak) IBOutlet UILabel *titleLabel; 27 | @property(nonatomic, weak) IBOutlet UILabel *bodyLabel; 28 | @property(nonatomic, weak) IBOutlet CRMediaView *productMediaView; 29 | @property(nonatomic, weak) IBOutlet CRMediaView *advertiserMediaView; 30 | @property(nonatomic, weak) IBOutlet UILabel *advertiserDescriptionLabel; 31 | 32 | @end 33 | 34 | NS_ASSUME_NONNULL_END 35 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Native/CR_NativeAdvertiser.h: -------------------------------------------------------------------------------- 1 | // 2 | // CR_NativeAdvertiser.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | #import "CR_NativeImage.h" 22 | 23 | @interface CR_NativeAdvertiser : NSObject 24 | 25 | @property(readonly, copy, nonatomic) NSString *description; 26 | @property(readonly, copy, nonatomic) NSString *domain; 27 | @property(readonly, copy, nonatomic) CR_NativeImage *logoImage; 28 | @property(readonly, copy, nonatomic) NSString *logoClickUrl; 29 | 30 | - (instancetype)initWithDict:(NSDictionary *)jdict; 31 | + (CR_NativeAdvertiser *)nativeAdvertiserWithDict:(NSDictionary *)jdict; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /CriteoAdViewer/Sources/AdViewer/InterstitialView+ads.swift: -------------------------------------------------------------------------------- 1 | // 2 | // InterstitialView+ads.swift 3 | // CriteoAdViewer 4 | // 5 | // Copyright © 2018-2022 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | import Foundation 21 | import GoogleMobileAds 22 | 23 | extension GADInterstitialAd: InterstitialView { 24 | func present(viewController: UIViewController) { 25 | self.present(fromRootViewController: viewController) 26 | } 27 | } 28 | 29 | extension GADRewardedAd: InterstitialView { 30 | func present(viewController: UIViewController) { 31 | self.present( 32 | fromRootViewController: viewController, 33 | userDidEarnRewardHandler: { 34 | print("User did earn reward \(self.adReward)") 35 | }) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Tests/UnitTests/Mocks/CR_CdbResponseMock.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CR_CdbResponseMock.swift 3 | // CriteoPublisherSdkTests 4 | // 5 | // Copyright © 2018-2022 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | import CriteoPublisherSdk 21 | 22 | class CR_CdbResponseMock: CR_CdbResponse { 23 | 24 | // MARK: - Overrides 25 | 26 | private var cdbBidsOverride: [CR_CdbBid]? 27 | 28 | override var cdbBids: [CR_CdbBid] { 29 | get { 30 | return cdbBidsOverride ?? super.cdbBids 31 | } 32 | set { 33 | cdbBidsOverride = newValue 34 | } 35 | } 36 | } 37 | 38 | // MARK: - MockProtocol 39 | 40 | extension CR_CdbResponseMock: MockProtocol { 41 | 42 | func reset() { 43 | cdbBidsOverride = nil 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Native/CRMediaContent+Internal.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRMediaContent+Internal.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | #import "CRMediaContent.h" 22 | 23 | @protocol CRMediaDownloader; 24 | @class CR_ThreadManager; 25 | @class CR_NativeImage; 26 | 27 | NS_ASSUME_NONNULL_BEGIN 28 | 29 | @interface CRMediaContent () 30 | 31 | @property(weak, nonatomic, readonly) id mediaDownloader; 32 | 33 | - (instancetype)initWithNativeImage:(CR_NativeImage *)image 34 | mediaDownloader:(id)mediaDownloader 35 | NS_DESIGNATED_INITIALIZER; 36 | 37 | @end 38 | 39 | NS_ASSUME_NONNULL_END -------------------------------------------------------------------------------- /CriteoAdViewer/Sources/NativeAd/CRVNativeAdView.m: -------------------------------------------------------------------------------- 1 | // 2 | // CRVNativeAdView.m 3 | // CriteoAdViewer 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import "CRVNativeAdView.h" 21 | 22 | @implementation CRVNativeAdView 23 | 24 | #pragma mark - CRNativeDelegate 25 | 26 | - (void)nativeLoader:(CRNativeLoader *)loader didReceiveAd:(CRNativeAd *)ad { 27 | self.nativeAd = ad; 28 | self.titleLabel.text = ad.title ?: @"No title"; 29 | self.bodyLabel.text = ad.body ?: @"No body"; 30 | self.productMediaView.mediaContent = ad.productMedia; 31 | self.advertiserDescriptionLabel.text = ad.advertiserDescription ?: @"No advertiser description"; 32 | self.advertiserMediaView.mediaContent = ad.advertiserLogoMedia; 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /wiremock/mappings/csm.json: -------------------------------------------------------------------------------- 1 | { 2 | "request" : { 3 | "urlPath":"/csm" 4 | }, 5 | "response" : { 6 | "jsonBody": { 7 | "killSwitch": false, 8 | "AndroidDisplayUrlMacro": "%%displayUrl%%", 9 | "AndroidAdTagUrlMode": "", 10 | "AndroidAdTagDataMacro": "%%adTagData%%", 11 | "AndroidAdTagDataMode": "", 12 | "iOSDisplayUrlMacro": "%%displayUrl%%", 13 | "iOSWidthMacro": "%%width%%", 14 | "iOSAdTagUrlMode": "", 15 | "csmEnabled": true, 16 | "liveBiddingEnabled": true, 17 | "liveBiddingTimeBudgetInMillis": 8000, 18 | "prefetchOnInitEnabled": true, 19 | "remoteLogLevel": "Warning", 20 | "mraidEnabled": false, 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Public/CRContextData.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRContextData.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | /** 25 | * @brief A single URL of the content, for buy-side contextualization or review. 26 | * 27 | * @remark Type: String, like https://www.criteo.com 28 | */ 29 | FOUNDATION_EXPORT NSString *const CRContextDataContentUrl; 30 | 31 | @interface CRContextData : NSObject 32 | 33 | + (CRContextData *)contextDataWithDictionary:(NSDictionary *)dictionary; 34 | 35 | - (instancetype)initWithDictionary:(NSDictionary *)dictionary; 36 | 37 | @end 38 | 39 | NS_ASSUME_NONNULL_END 40 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Util/CRLogUtil.m: -------------------------------------------------------------------------------- 1 | // 2 | // CRLogUtil.m 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2023 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import "CRLogUtil.h" 21 | #import "CR_Logging.h" 22 | 23 | #define CRITEO_MRAID_TAG @"CRMRAID" 24 | 25 | @implementation CRLogUtil 26 | 27 | - (void)mraidLogWithDebug:(NSString* _Nonnull)debug { 28 | CRLogDebug(CRITEO_MRAID_TAG, debug); 29 | } 30 | 31 | - (void)mraidLogWithError:(NSString* _Nonnull)error { 32 | CRLogError(CRITEO_MRAID_TAG, error); 33 | } 34 | 35 | - (void)mraidLogWithInfo:(NSString* _Nonnull)info { 36 | CRLogInfo(CRITEO_MRAID_TAG, info); 37 | } 38 | 39 | - (void)mraidLogWithWarning:(NSString* _Nonnull)warning { 40 | CRLogWarn(CRITEO_MRAID_TAG, warning); 41 | } 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/CriteoPublisherSdk.xcodeproj/xcshareddata/xcbaselines/E1F2736C21B5F08D00A2FBFA.xcbaseline/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | runDestinationsByUUID 6 | 7 | FD24A0E4-7CC1-47CA-A6A3-E3E390A8D1D5 8 | 9 | localComputer 10 | 11 | busSpeedInMHz 12 | 100 13 | cpuCount 14 | 1 15 | cpuKind 16 | Intel Core i7 17 | cpuSpeedInMHz 18 | 2800 19 | logicalCPUCoresPerPackage 20 | 8 21 | modelCode 22 | MacBookPro14,3 23 | physicalCPUCoresPerPackage 24 | 4 25 | platformIdentifier 26 | com.apple.platform.macosx 27 | 28 | targetArchitecture 29 | x86_64 30 | targetDevice 31 | 32 | modelCode 33 | iPhone8,1 34 | platformIdentifier 35 | com.apple.platform.iphonesimulator 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Public/CRNativeAdView.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRNativeAdView.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | 22 | @class CRNativeAd; 23 | 24 | NS_ASSUME_NONNULL_BEGIN 25 | 26 | /** 27 | * View that wrap a UIView for displaying an Advanced Native Ad. 28 | * 29 | * You need to call super if you override methods. 30 | */ 31 | @interface CRNativeAdView : UIControl 32 | 33 | /** 34 | * The advanced native ad associated to the view. 35 | * 36 | * The assignation of the native ad is mandatory to track the impression and the clicks on the 37 | * advanced native ad. 38 | */ 39 | @property(strong, nonatomic, nullable) CRNativeAd *nativeAd; 40 | 41 | @end 42 | 43 | NS_ASSUME_NONNULL_END 44 | -------------------------------------------------------------------------------- /CriteoAdViewer/Sources/Criteo/NetworkManagerDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // NetworkManagerDelegate.h 3 | // CriteoAdViewer 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #ifndef NetworkManagerDelegate_h 21 | #define NetworkManagerDelegate_h 22 | 23 | #import 24 | 25 | NS_ASSUME_NONNULL_BEGIN 26 | 27 | @class NetworkManager; 28 | 29 | @protocol NetworkManagerDelegate 30 | 31 | - (void)networkManager:(NetworkManager*)manager sentRequest:(NSURLRequest*)request; 32 | - (void)networkManager:(NetworkManager*)manager 33 | receivedResponse:(NSURLResponse*)response 34 | withData:(NSData*)data 35 | error:(NSError*)error; 36 | 37 | @end 38 | 39 | NS_ASSUME_NONNULL_END 40 | 41 | #endif /* NetworkManagerDelegate_h */ 42 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Public/CRMediaView.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRMediaView.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | 22 | @class UIImage; 23 | @class CRMediaContent; 24 | 25 | /** 26 | * A view that can hold and display a CRMediaContent. 27 | * 28 | * The CRMediaView takes care of loading the necessary ressources if needed. 29 | */ 30 | @interface CRMediaView : UIView 31 | 32 | /** 33 | * Placeholder to display while the media content is loading or in case of error. 34 | */ 35 | @property(strong, nonatomic, nullable) UIImage *placeholder; 36 | 37 | /** 38 | * New media content to load in this view. 39 | */ 40 | @property(strong, nonatomic, nullable) CRMediaContent *mediaContent; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Util/NSString+Criteo.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+Criteo.m 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import "NSString+Criteo.h" 21 | 22 | @implementation NSString (Criteo) 23 | 24 | + (nullable NSString *)cr_StringWithStringOrNil:(nullable NSString *)string { 25 | if (string && [string isKindOfClass:NSString.class]) { 26 | return [NSString stringWithString:string]; 27 | } else { 28 | return nil; 29 | } 30 | } 31 | 32 | + (nullable NSString *)cr_nonEmptyStringWithStringOrNil:(nullable NSString *)string { 33 | if (string && [string isKindOfClass:NSString.class] && string.length > 0) { 34 | return [NSString stringWithString:string]; 35 | } else { 36 | return nil; 37 | } 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/CRAdUnit+Internal.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRAdUnit+Internal.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #ifndef CRAdUnit_Internal_h 21 | #define CRAdUnit_Internal_h 22 | 23 | // TODO: Make sure we only pass valid Enum values when initializing 24 | typedef NS_ENUM(NSInteger, CRAdUnitType) { 25 | CRAdUnitTypeInterstitial, 26 | CRAdUnitTypeBanner, 27 | CRAdUnitTypeNative, 28 | CRAdUnitTypeRewarded 29 | }; 30 | 31 | NS_ASSUME_NONNULL_BEGIN 32 | 33 | @interface CRAdUnit () 34 | 35 | @property(nonatomic, readonly) CRAdUnitType adUnitType; 36 | - (instancetype)initWithAdUnitId:(NSString *)adUnitId adUnitType:(CRAdUnitType)adUnitType; 37 | 38 | @end 39 | 40 | #endif /* CRAdUnit_Internal_h */ 41 | 42 | NS_ASSUME_NONNULL_END 43 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/CR_AdUnitHelper.h: -------------------------------------------------------------------------------- 1 | // 2 | // CR_AdUnitHelper.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | #import "CR_CacheAdUnit.h" 22 | #import "CRInterstitialAdUnit.h" 23 | #import "CR_DeviceInfo.h" 24 | 25 | NS_ASSUME_NONNULL_BEGIN 26 | 27 | /** 28 | * TODO: Remove this class by switching to a Class Cluster 29 | * https://developer.apple.com/library/archive/documentation/General/Conceptual/CocoaEncyclopedia/ClassClusters/ClassClusters.html 30 | */ 31 | @interface CR_AdUnitHelper : NSObject 32 | 33 | + (CR_CacheAdUnitArray *)cacheAdUnitsForAdUnits:(NSArray *)adUnits; 34 | 35 | + (CR_CacheAdUnit *)cacheAdUnitForAdUnit:(CRAdUnit *)adUnit; 36 | 37 | @end 38 | 39 | NS_ASSUME_NONNULL_END 40 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Feedback/CR_CASObjectQueue+ArraySet.h: -------------------------------------------------------------------------------- 1 | // 2 | // CR_CASObjectQueue+ArraySet.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import "CR_CASObjectQueue.h" 21 | #import "CR_FeedbackMessage.h" 22 | 23 | NS_ASSUME_NONNULL_BEGIN 24 | 25 | @interface CR_CASObjectQueue (ArraySet) 26 | 27 | /** 28 | * Adds an element to the end of the queue or assert if the object already exists. 29 | */ 30 | - (void)addFeedbackMessage:(CR_FeedbackMessage *)data; 31 | /** 32 | * Return YES if the queue contains the given element. 33 | */ 34 | - (BOOL)containsFeedbackMessage:(CR_FeedbackMessage *)data; 35 | /** 36 | * Return all the queued elements as an array. 37 | */ 38 | - (NSArray *)allFeedbackMessages; 39 | 40 | @end 41 | 42 | NS_ASSUME_NONNULL_END 43 | -------------------------------------------------------------------------------- /CriteoMoPubAdapter/Sources/CriteoMoPubAdapter/CRInterstitialCustomEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRInterstitialCustomEvent.h 3 | // CriteoMoPubAdapter 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | 19 | #if __has_include() 20 | #import 21 | #elif __has_include() 22 | #import 23 | #elif __has_include() 24 | #import 25 | #else 26 | #import "MoPub.h" 27 | #import "MPFullscreenAdAdapter.h" 28 | #endif 29 | 30 | #import 31 | #import 32 | 33 | NS_ASSUME_NONNULL_BEGIN 34 | 35 | @interface CRInterstitialCustomEvent 36 | : MPFullscreenAdAdapter 37 | @end 38 | 39 | NS_ASSUME_NONNULL_END 40 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Util/NSError+Criteo.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSError+Criteo.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | typedef NS_ENUM(NSInteger, CRErrorCode) { 25 | CRErrorCodeInternalError, 26 | CRErrorCodeNoFill, 27 | CRErrorCodeNetworkError, 28 | CRErrorCodeInvalidRequest, 29 | CRErrorCodeInvalidParameter, 30 | 31 | CRErrorCodeInvalidErrorCode // the last error code 32 | }; 33 | 34 | @interface NSError (Criteo) 35 | 36 | + (NSError *)cr_errorWithCode:(CRErrorCode)code; 37 | + (NSError *)cr_errorWithCode:(CRErrorCode)code description:(nullable NSString *)description; 38 | + (NSString *)cr_descriptionForCode:(CRErrorCode)code; 39 | 40 | @end 41 | 42 | NS_ASSUME_NONNULL_END 43 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Tests/Utility/Checkers/CR_NativeLoaderDispatchChecker.h: -------------------------------------------------------------------------------- 1 | // 2 | // CR_NativeLoaderDispatchChecker.h 3 | // CriteoPublisherSdkTests 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import "CRNativeLoader.h" 21 | @class XCTestExpectation; 22 | 23 | NS_ASSUME_NONNULL_BEGIN 24 | 25 | @interface CR_NativeLoaderDispatchChecker : NSObject 26 | 27 | @property(strong, nonatomic) XCTestExpectation *didReceiveOnMainQueue; 28 | @property(strong, nonatomic) XCTestExpectation *didFailOnMainQueue; 29 | @property(strong, nonatomic) XCTestExpectation *didDetectImpression; 30 | @property(strong, nonatomic) XCTestExpectation *didDetectClick; 31 | @property(strong, nonatomic) XCTestExpectation *willLeaveApplicationForNativeAd; 32 | 33 | @end 34 | 35 | NS_ASSUME_NONNULL_END 36 | -------------------------------------------------------------------------------- /CriteoMoPubAdapter/Tests/CriteoMoPubAdapterTests/CRCriteoAdapterConfigurationTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // CRCriteoAdapterConfigurationTests.m 3 | // CriteoMoPubAdapterTests 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | 19 | #import 20 | #import "CRCriteoAdapterConfiguration.h" 21 | 22 | @interface CRCriteoAdapterConfigurationTests : XCTestCase 23 | 24 | @end 25 | 26 | @implementation CRCriteoAdapterConfigurationTests 27 | 28 | - (void)testBiddingToken { 29 | CRCriteoAdapterConfiguration *config = [[CRCriteoAdapterConfiguration alloc] init]; 30 | XCTAssertNil([config biddingToken]); 31 | } 32 | 33 | - (void)testmoPubNetworkName { 34 | CRCriteoAdapterConfiguration *config = [[CRCriteoAdapterConfiguration alloc] init]; 35 | XCTAssertEqual([config moPubNetworkName], @"criteo"); 36 | } 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Network/CR_NetworkManagerDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // CR_NetworkManagerDelegate.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #ifndef CR_NetworkManagerDelegate_h 21 | #define CR_NetworkManagerDelegate_h 22 | 23 | #import 24 | 25 | NS_ASSUME_NONNULL_BEGIN 26 | 27 | @class CR_NetworkManager; 28 | 29 | @protocol CR_NetworkManagerDelegate 30 | 31 | - (void)networkManager:(CR_NetworkManager*)manager sentRequest:(NSURLRequest*)request; 32 | - (void)networkManager:(CR_NetworkManager*)manager 33 | receivedResponse:(NSURLResponse*)response 34 | withData:(NSData*)data 35 | error:(NSError*)error; 36 | 37 | @end 38 | 39 | NS_ASSUME_NONNULL_END 40 | 41 | #endif /* CR_NetworkManagerDelegate_h */ 42 | -------------------------------------------------------------------------------- /CriteoMoPubAdapter/Sources/CriteoMoPubAdapter/CRBannerCustomEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRCustomBannerEvent.h 3 | // CriteoMoPubAdapter 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | 19 | #if __has_include() 20 | #import 21 | #elif __has_include() 22 | #import 23 | #elif __has_include() 24 | #import 25 | #else 26 | #import "MoPub.h" 27 | #import "MPInlineAdAdapter.h" 28 | #endif 29 | 30 | #import 31 | #import 32 | #import "CRCriteoAdapterConfiguration.h" 33 | 34 | NS_ASSUME_NONNULL_BEGIN 35 | 36 | @interface CRBannerCustomEvent 37 | : MPInlineAdAdapter 38 | @end 39 | 40 | NS_ASSUME_NONNULL_END 41 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Feedback/CR_FeedbackFeatureGuard.h: -------------------------------------------------------------------------------- 1 | // 2 | // CR_FeedbackFeatureGuard.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #ifndef CR_FeedbackFeatureGuard_H 21 | #define CR_FeedbackFeatureGuard_H 22 | 23 | #import 24 | #import "CR_FeedbackController.h" 25 | 26 | @class CR_Config; 27 | @class CR_DataProtectionConsent; 28 | 29 | @interface CR_FeedbackFeatureGuard : NSObject 30 | 31 | - (instancetype)init NS_UNAVAILABLE; 32 | 33 | - (instancetype)initWithController:(id)controller 34 | config:(CR_Config *)config 35 | consent:(CR_DataProtectionConsent *)consent NS_DESIGNATED_INITIALIZER; 36 | 37 | @end 38 | 39 | #endif /* CR_FeedbackFeatureGuard_H */ 40 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Tests/Utility/Mocks/CR_DataProtectionConsentMock.h: -------------------------------------------------------------------------------- 1 | // 2 | // CR_DataProtectionConsentMock.h 3 | // CriteoPublisherSdkTests 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import "CR_DataProtectionConsent.h" 21 | 22 | @class CR_GdprMock; 23 | 24 | NS_ASSUME_NONNULL_BEGIN 25 | 26 | extern NSString *const CR_DataProtectionConsentMockDefaultConsentString; 27 | extern NSString *const CR_DataProtectionConsentMockDefaultUsPrivacyIabConsentString; 28 | 29 | @interface CR_DataProtectionConsentMock : CR_DataProtectionConsent 30 | 31 | @property(strong, nonatomic) CR_GdprMock *gdprMock; 32 | 33 | @property(strong, nonatomic, nullable) NSNumber *trackingAuthorizationStatus_mock; 34 | @property(nonatomic, copy, nullable) NSString *usPrivacyIabConsentString_mock; 35 | 36 | @end 37 | 38 | NS_ASSUME_NONNULL_END 39 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Public/CRBannerView.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRBannerView.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | 22 | #import 23 | #import 24 | #import 25 | #import 26 | 27 | NS_ASSUME_NONNULL_BEGIN 28 | 29 | @interface CRBannerView : UIView 30 | @property(nullable, nonatomic, weak) id delegate; 31 | 32 | - (instancetype)initWithAdUnit:(CRBannerAdUnit *)adUnit; 33 | 34 | - (void)loadAd; 35 | - (void)loadAdWithContext:(CRContextData *)contextData; 36 | - (void)loadAdWithBid:(CRBid *)bid; 37 | - (void)loadAdWithDisplayData:(NSString *)displayData; 38 | 39 | @end 40 | 41 | NS_ASSUME_NONNULL_END 42 | -------------------------------------------------------------------------------- /CriteoPublisherSdk/Sources/Public/CREmailHasher.h: -------------------------------------------------------------------------------- 1 | // 2 | // CREmailHasher.h 3 | // CriteoPublisherSdk 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | @interface CREmailHasher : NSObject 25 | 26 | /** 27 | * @brief Helper function to hash emails for `CRUserDataHashedEmail` 28 | * 29 | * @discussion 30 | * The hashing should be the users’ email address: 31 | * @textblock 32 | * - Encoded in UTF-8 33 | * - Trimmed of any white space (eg: “test@criteo.com “ should become “test@criteo.com”) 34 | * - Converted to lower case 35 | * - Hashed with MD5 & output as ASCII text 36 | * - Hashed with SHA256 and output as ASCII text 37 | * @/textblock 38 | */ 39 | + (NSString *)hash:(NSString *)email; 40 | 41 | @end 42 | 43 | NS_ASSUME_NONNULL_END 44 | -------------------------------------------------------------------------------- /CriteoMoPubAdapter/Sources/CriteoMoPubAdapter/CRNativeAdRenderer.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRNativeAdRenderer.h 3 | // CriteoMoPubAdapter 4 | // 5 | // Copyright © 2018-2020 Criteo. All rights reserved. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #if __has_include() 21 | #import 22 | #elif __has_include() 23 | #import 24 | #elif __has_include() 25 | #import 26 | #else 27 | #import "MoPub.h" 28 | #endif 29 | 30 | NS_ASSUME_NONNULL_BEGIN 31 | 32 | @interface CRNativeAdRenderer : NSObject 33 | 34 | @property(nonatomic, readonly) MPNativeViewSizeHandler viewSizeHandler; 35 | 36 | + (MPNativeAdRendererConfiguration *)rendererConfigurationWithRendererSettings: 37 | (id)rendererSettings; 38 | 39 | @end 40 | 41 | NS_ASSUME_NONNULL_END 42 | --------------------------------------------------------------------------------