diff --git a/AffiseAttributionLib.podspec b/AffiseAttributionLib.podspec index 95f8856..1610026 100644 --- a/AffiseAttributionLib.podspec +++ b/AffiseAttributionLib.podspec @@ -5,7 +5,7 @@ Pod::Spec.new do |spec| spec.name = "AffiseAttributionLib" - spec.version = ENV['LIB_VERSION'] || "1.6.33" + spec.version = ENV['LIB_VERSION'] || "1.6.34" spec.summary = "Affise Attribution iOS library" spec.description = "Affise SDK is a software you can use to collect app usage statistics, device identifiers, deeplink usage, track install referrer." spec.homepage = "https://github.com/affise/sdk-ios" diff --git a/AffiseAttributionLib/Classes/deeplink/DeeplinkValue.swift b/AffiseAttributionLib/Classes/deeplink/DeeplinkValue.swift index 32e5022..230b85b 100644 --- a/AffiseAttributionLib/Classes/deeplink/DeeplinkValue.swift +++ b/AffiseAttributionLib/Classes/deeplink/DeeplinkValue.swift @@ -10,7 +10,7 @@ public class DeeplinkValue: NSObject { public let path: String? public let parameters: [String:[String]] - init( + public init( deeplink: String, scheme: String?, host: String?, @@ -32,7 +32,7 @@ extension DeeplinkValue { extension Optional where Wrapped == URL { - func toDeeplinkValue() -> DeeplinkValue { + public func toDeeplinkValue() -> DeeplinkValue { guard let self = self else { return DeeplinkValue( deeplink: "", diff --git a/AffiseAttributionLib/Classes/internal/BuildConfig.swift b/AffiseAttributionLib/Classes/internal/BuildConfig.swift new file mode 100644 index 0000000..8efe90b --- /dev/null +++ b/AffiseAttributionLib/Classes/internal/BuildConfig.swift @@ -0,0 +1,5 @@ +import Foundation + +internal struct BuildConfig { + static let AFFISE_VERSION = "1.6.34" +} diff --git a/AffiseAttributionLib/Classes/modules/AffiseModule.swift b/AffiseAttributionLib/Classes/modules/AffiseModule.swift index 409ba41..bd5197f 100644 --- a/AffiseAttributionLib/Classes/modules/AffiseModule.swift +++ b/AffiseAttributionLib/Classes/modules/AffiseModule.swift @@ -26,6 +26,8 @@ open class AffiseModule: NSObject { self.dependencies = dependencies self.baseProviders = providers } + + open var version: String { "" } open func start() { diff --git a/AffiseAttributionLib/Classes/modules/AffiseModuleManager.swift b/AffiseAttributionLib/Classes/modules/AffiseModuleManager.swift index 1b46618..c655b74 100644 --- a/AffiseAttributionLib/Classes/modules/AffiseModuleManager.swift +++ b/AffiseAttributionLib/Classes/modules/AffiseModuleManager.swift @@ -71,11 +71,13 @@ internal class AffiseModuleManager { private func initAffiseModules(_ callback: (_ module: AffiseModule) -> Void) { for name in AffiseModules.values() { guard let cls = classType(name) else { continue } - let module = cls.init() - modules[name] = module - - callback(module) + if module.version == BuildConfig.AFFISE_VERSION { + modules[name] = module + callback(module) + } else { + print(AffiseModuleError.version(name: name, module: module).localizedDescription) + } } } diff --git a/AffiseAttributionLib/Classes/modules/exceptions/AffiseModuleError.swift b/AffiseAttributionLib/Classes/modules/exceptions/AffiseModuleError.swift new file mode 100644 index 0000000..ee32943 --- /dev/null +++ b/AffiseAttributionLib/Classes/modules/exceptions/AffiseModuleError.swift @@ -0,0 +1,14 @@ +import Foundation + +enum AffiseModuleError: Error { + case version(name: AffiseModules, module: AffiseModule) +} + +extension AffiseModuleError : LocalizedError { + public var errorDescription: String? { + switch self { + case .version(name: let name, module: let module): + return NSLocalizedString("AffiseModuleError.version(module [\(name.description.lowercased()):\(module.version)] version is incompatible with [attribution:\(BuildConfig.AFFISE_VERSION)], use same version as attribution)", comment: "") + } + } +} diff --git a/AffiseAttributionLib/Classes/parameters/providers/init/AffSDKVersionProvider.swift b/AffiseAttributionLib/Classes/parameters/providers/init/AffSDKVersionProvider.swift index f23fdfe..b46da9d 100644 --- a/AffiseAttributionLib/Classes/parameters/providers/init/AffSDKVersionProvider.swift +++ b/AffiseAttributionLib/Classes/parameters/providers/init/AffSDKVersionProvider.swift @@ -6,7 +6,7 @@ import Foundation class AffSDKVersionProvider: StringPropertyProvider { override func provide() -> String? { - return "1.6.33" + return BuildConfig.AFFISE_VERSION } public override func getOrder() -> Float { diff --git a/AffiseInternal.podspec b/AffiseInternal.podspec index 5290f10..773ebd8 100644 --- a/AffiseInternal.podspec +++ b/AffiseInternal.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |spec| spec.name = "AffiseInternal" - spec.version = ENV['LIB_VERSION'] || "1.6.33" + spec.version = ENV['LIB_VERSION'] || "1.6.34" spec.summary = "Affise Internal library" spec.description = "Affise Internal wrapper library for crossplatform" spec.homepage = "https://github.com/affise/sdk-ios" diff --git a/AffiseModule.podspec b/AffiseModule.podspec index 9716759..969feff 100644 --- a/AffiseModule.podspec +++ b/AffiseModule.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = "AffiseModule" - s.version = ENV["LIB_VERSION"] || "1.6.33" + s.version = ENV["LIB_VERSION"] || "1.6.34" s.summary = "Affise Modules" s.description = "Affise module collection" s.homepage = "https://github.com/affise/sdk-ios" diff --git a/AffiseModule/Advertising/Classes/AdvertisingModule.swift b/AffiseModule/Advertising/Classes/AdvertisingModule.swift index ce26b61..85d566f 100644 --- a/AffiseModule/Advertising/Classes/AdvertisingModule.swift +++ b/AffiseModule/Advertising/Classes/AdvertisingModule.swift @@ -4,6 +4,8 @@ import Foundation @objc(AffiseAdvertisingModule) public final class AdvertisingModule: AffiseModule { + public override var version: String { "1.6.34" } + private lazy var advertisingIdManager: AdvertisingIdManager = AdvertisingIdManagerImpl() private lazy var adidProvider: Provider = AdidProvider(advertisingIdManager: advertisingIdManager) diff --git a/AffiseModule/Link/Classes/LinkModule.swift b/AffiseModule/Link/Classes/LinkModule.swift index 5399812..3388b11 100644 --- a/AffiseModule/Link/Classes/LinkModule.swift +++ b/AffiseModule/Link/Classes/LinkModule.swift @@ -5,6 +5,8 @@ import AffiseAttributionLib @objc(AffiseLinkModule) public final class LinkModule: AffiseModule { + public override var version: String { "1.6.34" } + private var useCase: LinkResolveUseCase? = nil public override func start() { diff --git a/AffiseModule/Status/Classes/StatusModule.swift b/AffiseModule/Status/Classes/StatusModule.swift index 121461d..e601762 100644 --- a/AffiseModule/Status/Classes/StatusModule.swift +++ b/AffiseModule/Status/Classes/StatusModule.swift @@ -5,6 +5,8 @@ import AffiseAttributionLib @objc(AffiseStatusModule) public final class StatusModule: AffiseModule { + public override var version: String { "1.6.34" } + private var checkStatusUseCase: CheckStatusUseCase? = nil private var referrerUseCase: ReferrerUseCase? = nil diff --git a/AffiseModule/Subscription/Classes/SubscriptionModule.swift b/AffiseModule/Subscription/Classes/SubscriptionModule.swift index 1e3cd7d..71ec3ad 100644 --- a/AffiseModule/Subscription/Classes/SubscriptionModule.swift +++ b/AffiseModule/Subscription/Classes/SubscriptionModule.swift @@ -6,6 +6,8 @@ import AffiseAttributionLib @objc(AffiseSubscriptionModule) public final class SubscriptionModule: AffiseModule { + public override var version: String { "1.6.34" } + lazy var storeManager: StoreManager = StoreManager() override public func start() { diff --git a/AffiseSKAdNetwork.podspec b/AffiseSKAdNetwork.podspec index 0772cb2..617ffc0 100644 --- a/AffiseSKAdNetwork.podspec +++ b/AffiseSKAdNetwork.podspec @@ -5,7 +5,7 @@ Pod::Spec.new do |spec| spec.name = "AffiseSKAdNetwork" - spec.version = ENV['LIB_VERSION'] || "1.6.33" + spec.version = ENV['LIB_VERSION'] || "1.6.34" spec.summary = "AffiseSKAdNetwork iOS library" spec.description = "Affise library for StoreKit Ad Network (SKAdNetwork)" spec.homepage = "https://github.com/affise/sdk-ios" diff --git a/CHANGELOG.md b/CHANGELOG.md index 1aaec81..f7b54b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [1.6.34] - 2024-07-26 + +### Added + +- Modules compatibility check. + ## [1.6.33] - 2024-06-28 ### Added @@ -62,6 +68,7 @@ - Improve `AffiseModuleManager` - Update for demo app +[1.6.34]: https://github.com/affise/sdk-ios/compare/1.6.33...1.6.34 [1.6.33]: https://github.com/affise/sdk-ios/compare/1.6.32...1.6.33 [1.6.32]: https://github.com/affise/sdk-ios/compare/1.6.31...1.6.32 [1.6.31]: https://github.com/affise/sdk-ios/compare/1.6.30...1.6.31 diff --git a/README.md b/README.md index c8492d6..ca1c160 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,11 @@ | Pod | Version | | ---- |:-------:| -| `AffiseAttributionLib` | [`1.6.33`](https://github.com/CocoaPods/Specs/tree/master/Specs/a/9/3/AffiseAttributionLib) | -| `AffiseSKAdNetwork` | [`1.6.33`](https://github.com/CocoaPods/Specs/tree/master/Specs/3/6/f/AffiseSKAdNetwork) | -| `AffiseModule/Advertising` | [`1.6.33`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | -| `AffiseModule/Link` | [`1.6.33`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | -| `AffiseModule/Status` | [`1.6.33`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | +| `AffiseAttributionLib` | [`1.6.34`](https://github.com/CocoaPods/Specs/tree/master/Specs/a/9/3/AffiseAttributionLib) | +| `AffiseSKAdNetwork` | [`1.6.34`](https://github.com/CocoaPods/Specs/tree/master/Specs/3/6/f/AffiseSKAdNetwork) | +| `AffiseModule/Advertising` | [`1.6.34`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | +| `AffiseModule/Link` | [`1.6.34`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | +| `AffiseModule/Status` | [`1.6.34`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | - [Affise Attribution iOS Library](#affise-attribution-ios-library) - [Description](#description) @@ -80,22 +80,22 @@ To add the SDK using Cocoapods, specify the version you want to use in your Podf ```ruby # Affise SDK library -pod 'AffiseAttributionLib', '~> 1.6.33' +pod 'AffiseAttributionLib', '~> 1.6.34' # Affise modules -pod 'AffiseModule/Advertising', '~> 1.6.33' -pod 'AffiseModule/Link', '~> 1.6.33' -pod 'AffiseModule/Status', '~> 1.6.33' +pod 'AffiseModule/Advertising', '~> 1.6.34' +pod 'AffiseModule/Link', '~> 1.6.34' +pod 'AffiseModule/Status', '~> 1.6.34' ``` Get source directly from GitHub ```ruby # Affise SDK library -pod 'AffiseAttributionLib', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.33' +pod 'AffiseAttributionLib', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.34' # Affise modules -pod 'AffiseModule/Advertising', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.33' -pod 'AffiseModule/Link', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.33' -pod 'AffiseModule/Status', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.33' +pod 'AffiseModule/Advertising', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.34' +pod 'AffiseModule/Link', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.34' +pod 'AffiseModule/Status', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.34' ``` ### Integrate as Swift Package Manager @@ -197,9 +197,9 @@ Affise | Module | Version | Start | | ------------- |:------------------------------------------------------------------------------------:|----------| -| `Advertising` | [`1.6.33`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | `Manual` | -| `Link` | [`1.6.33`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | `Auto` | -| `Status` | [`1.6.33`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | `Auto` | +| `Advertising` | [`1.6.34`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | `Manual` | +| `Link` | [`1.6.34`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | `Auto` | +| `Status` | [`1.6.34`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | `Auto` | If module start type is `manual`, then call: @@ -263,14 +263,14 @@ To add the SDK using Cocoapods, specify the version you want to use in your Podf ```ruby # Wrapper for StoreKit Ad Network -pod 'AffiseSKAdNetwork', '~> 1.6.33' +pod 'AffiseSKAdNetwork', '~> 1.6.34' ``` Get source directly from GitHub ```ruby # Wrapper for StoreKit Ad Network -pod 'AffiseSKAdNetwork', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.33' +pod 'AffiseSKAdNetwork', :git => 'https://github.com/affise/sdk-ios.git', :tag => '1.6.34' ``` For `swift` use: diff --git a/example/app/app/Info.plist b/example/app/app/Info.plist index 2d65e06..6acbb84 100644 --- a/example/app/app/Info.plist +++ b/example/app/app/Info.plist @@ -17,5 +17,12 @@ NSAdvertisingAttributionReportEndpoint https://affise-skadnetwork.com/ + UIApplicationSceneManifest + + + UISceneConfigurations + +