diff --git a/Podfile b/Podfile index 4f9419b8099a..256d77341593 100644 --- a/Podfile +++ b/Podfile @@ -50,8 +50,8 @@ def wordpress_ui end def wordpress_kit - pod 'WordPressKit', '~> 8.2-beta' - # pod 'WordPressKit', git: 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', branch: '' + # pod 'WordPressKit', '~> 8.2-beta' + pod 'WordPressKit', git: 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', branch: 'feature/add-blaze-campaigns-endpoints' # pod 'WordPressKit', git: 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', tag: '' # pod 'WordPressKit', git: 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', commit: '' # pod 'WordPressKit', path: '../WordPressKit-iOS' diff --git a/Podfile.lock b/Podfile.lock index 14fb1035db9f..8d2035ecc6c7 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -512,7 +512,7 @@ PODS: - WordPressKit (~> 8.0-beta) - WordPressShared (~> 2.1-beta) - WordPressUI (~> 1.7-beta) - - WordPressKit (8.2.0): + - WordPressKit (8.3.0-beta.1): - Alamofire (~> 4.8.0) - NSObject-SafeExpectations (~> 0.0.4) - UIDeviceIdentifier (~> 2.0) @@ -612,7 +612,7 @@ DEPENDENCIES: - SwiftLint (~> 0.50) - WordPress-Editor-iOS (~> 1.19.8) - WordPressAuthenticator (~> 6.1-beta) - - WordPressKit (~> 8.2-beta) + - WordPressKit (from `https://github.com/wordpress-mobile/WordPressKit-iOS.git`, branch `feature/add-blaze-campaigns-endpoints`) - WordPressShared (from `https://github.com/wordpress-mobile/WordPress-iOS-Shared.git`, branch `trunk`) - WordPressUI (~> 1.12.5) - WPMediaPicker (~> 1.8-beta) @@ -661,7 +661,6 @@ SPEC REPOS: - UIDeviceIdentifier - WordPress-Aztec-iOS - WordPress-Editor-iOS - - WordPressKit - WordPressUI - WPMediaPicker - wpxmlrpc @@ -776,6 +775,9 @@ EXTERNAL SOURCES: :git: https://github.com/wordpress-mobile/gutenberg-mobile.git :submodules: true :tag: v1.97.0-alpha1 + WordPressKit: + :branch: feature/add-blaze-campaigns-endpoints + :git: https://github.com/wordpress-mobile/WordPressKit-iOS.git WordPressShared: :branch: trunk :git: https://github.com/wordpress-mobile/WordPress-iOS-Shared.git @@ -794,6 +796,9 @@ CHECKOUT OPTIONS: :git: https://github.com/wordpress-mobile/gutenberg-mobile.git :submodules: true :tag: v1.97.0-alpha1 + WordPressKit: + :commit: efdf32d8ba5ecf18c4e49f08209cf1ef8756387d + :git: https://github.com/wordpress-mobile/WordPressKit-iOS.git WordPressShared: :commit: 9a010fdab8d31f9e1fa0511f231e7068ef0170b1 :git: https://github.com/wordpress-mobile/WordPress-iOS-Shared.git @@ -885,7 +890,7 @@ SPEC CHECKSUMS: WordPress-Aztec-iOS: 7d11d598f14c82c727c08b56bd35fbeb7dafb504 WordPress-Editor-iOS: 9eb9f12f21a5209cb837908d81ffe1e31cb27345 WordPressAuthenticator: b0b900696de5129a215adcd1e9ae6eb89da36ac8 - WordPressKit: d9015b097a58096033775dd8fc026d7d42005ae2 + WordPressKit: eab8f16472a869721b3c5ecce0089f467cf6602d WordPressShared: 87f3ee89b0a3e83106106f13a8b71605fb8eb6d2 WordPressUI: c5be816f6c7b3392224ac21de9e521e89fa108ac WPMediaPicker: 0d40b8d66b6dfdaa2d6a41e3be51249ff5898775 @@ -900,6 +905,6 @@ SPEC CHECKSUMS: ZendeskSupportSDK: 3a8e508ab1d9dd22dc038df6c694466414e037ba ZIPFoundation: ae5b4b813d216d3bf0a148773267fff14bd51d37 -PODFILE CHECKSUM: c4bdcbac21a417ad5d771fc6fe99602db67b4fa8 +PODFILE CHECKSUM: d2bc1efbb0c1760c24438c6dd6c89be1150c617f COCOAPODS: 1.12.1 diff --git a/WordPress/Classes/Services/BlazeService.swift b/WordPress/Classes/Services/BlazeService.swift index 1e90c5477ec8..945660acc8ca 100644 --- a/WordPress/Classes/Services/BlazeService.swift +++ b/WordPress/Classes/Services/BlazeService.swift @@ -68,4 +68,18 @@ import WordPressKit completion?() }, on: .main) } + + func getRecentCampaigns(for blog: Blog, + completion: @escaping (Result) -> Void) { + guard let siteId = blog.dotComID?.intValue else { + DDLogError("Invalid site ID for Blaze") + completion(.failure(BlazeServiceError.missingBlogId)) + return + } + remote.searchCampaigns(forSiteId: siteId, callback: completion) + } +} + +enum BlazeServiceError: Error { + case missingBlogId }