diff --git a/Example/Podfile.lock b/Example/Podfile.lock index 29832a8..bc273fd 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -1,5 +1,5 @@ PODS: - - TrustlySDK (3.0.0) + - TrustlySDK (3.1.1) DEPENDENCIES: - TrustlySDK (from `../`) @@ -9,8 +9,8 @@ EXTERNAL SOURCES: :path: "../" SPEC CHECKSUMS: - TrustlySDK: 9c710da3104f2b7c3e25b061c0693895190ab293 + TrustlySDK: 8bf9044a576043775ac7032ac2a569eb7e14a746 PODFILE CHECKSUM: 2d88e8d6e29e33aaa64b36a8d0e73ac21b25b6ba -COCOAPODS: 1.12.0 +COCOAPODS: 1.12.1 diff --git a/Example/TrustlySDK.xcodeproj/project.pbxproj b/Example/TrustlySDK.xcodeproj/project.pbxproj index cd6b135..83f3557 100644 --- a/Example/TrustlySDK.xcodeproj/project.pbxproj +++ b/Example/TrustlySDK.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 15369A732BDBE3F10050FDAD /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 15369A722BDBE3F10050FDAD /* PrivacyInfo.xcprivacy */; }; 1587AB912A2FE043006F6FC3 /* SessionManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1587AB902A2FE043006F6FC3 /* SessionManagerTests.swift */; }; 15987B0929DEF79D00D7A395 /* TrustlyLightBoxViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15987B0829DEF79D00D7A395 /* TrustlyLightBoxViewController.swift */; }; 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; }; @@ -29,6 +30,7 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 15369A722BDBE3F10050FDAD /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = PrivacyInfo.xcprivacy; path = ../PrivacyInfo.xcprivacy; sourceTree = ""; }; 1587AB902A2FE043006F6FC3 /* SessionManagerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SessionManagerTests.swift; sourceTree = ""; }; 15987B0829DEF79D00D7A395 /* TrustlyLightBoxViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrustlyLightBoxViewController.swift; sourceTree = ""; }; 2416E32056EECA07B4C86E1B /* TrustlySDK.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = TrustlySDK.podspec; path = ../TrustlySDK.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; @@ -74,6 +76,7 @@ 607FACC71AFB9204008FA782 = { isa = PBXGroup; children = ( + 15369A722BDBE3F10050FDAD /* PrivacyInfo.xcprivacy */, 607FACF51AFB993E008FA782 /* Podspec Metadata */, 607FACD21AFB9204008FA782 /* Example for TrustlySDK */, 607FACE81AFB9204008FA782 /* Tests */, @@ -252,6 +255,7 @@ files = ( 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */, 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */, + 15369A732BDBE3F10050FDAD /* PrivacyInfo.xcprivacy in Resources */, 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/Example/TrustlySDK/ViewController.swift b/Example/TrustlySDK/ViewController.swift index 733493d..a89e1a8 100644 --- a/Example/TrustlySDK/ViewController.swift +++ b/Example/TrustlySDK/ViewController.swift @@ -33,7 +33,8 @@ class ViewController: UIViewController { "metadata.urlScheme": "demoapp://", "description": "First Data Mobile Test", "env": "<[int, sandbox, local]>", - "localUrl": ""] + "localUrl": ""] + self.trustlyView.onChangeListener { (eventName, attributes) in print("onChangeListener: \(eventName) \(attributes)") diff --git a/Package.swift b/Package.swift index 78e8edb..cef6529 100644 --- a/Package.swift +++ b/Package.swift @@ -14,8 +14,9 @@ let package = Package( targets: ["TrustlySDK"]), ], targets: [ - .target( - name: "TrustlySDK", - dependencies: []), + .target(name: "TrustlySDK", + path: "Sources", + resources: [.copy("TrustlySDK/PrivacyInfo.xcprivacy")] + ), ] ) diff --git a/README.md b/README.md index 25ba87a..951a176 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,8 @@ ___ | VERSION | DESCRIPTION | BRANCH | | :-------: | :----------- | :----------- | +3.2.0 | Add PrivacyInfo.xcprivacy | *main* +3.1.1 | Fix minor bug when use the SDK in local environment | *main* 3.1.0 | Add SessionCid to to distinct widget impressions and transactions | *main* 3.0.0 | Add cocoapods, and swift package manager support | *main* diff --git a/Sources/TrustlySDK/PrivacyInfo.xcprivacy b/Sources/TrustlySDK/PrivacyInfo.xcprivacy new file mode 100644 index 0000000..4ce9f2a --- /dev/null +++ b/Sources/TrustlySDK/PrivacyInfo.xcprivacy @@ -0,0 +1,32 @@ + + + + + NSPrivacyCollectedDataTypes + + + NSPrivacyCollectedDataType + NSPrivacyCollectedDataTypeOtherDataTypes + NSPrivacyCollectedDataTypeLinked + + NSPrivacyCollectedDataTypeTracking + + NSPrivacyCollectedDataTypePurposes + + NSPrivacyCollectedDataTypePurposeAppFunctionality + + + + NSPrivacyAccessedAPITypes + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryUserDefaults + NSPrivacyAccessedAPITypeReasons + + CA92.1 + + + + + diff --git a/Sources/TrustlySDK/TrustlyView.swift b/Sources/TrustlySDK/TrustlyView.swift index 7d71ecc..14fd68d 100644 --- a/Sources/TrustlySDK/TrustlyView.swift +++ b/Sources/TrustlySDK/TrustlyView.swift @@ -35,7 +35,7 @@ let NavBarHeight:Int = 26 let NavBarIconWidth:Int = 10 let NavBarIconHeight:Int = 10 -let build = "3.1.0" +let build = "3.2.0" let CloseIconBase64:String! = "iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAACxLAAAsSwGlPZapAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAG1SURBVHgB3diLTcNADAZgpxOUBVA6CYzQDdoRGMETABMAG8AEVUdggmaDdoMYn5KTQlSau8RnW/ySVUWyo/sa9XEH8E9SDS+IaM0vO647rmNVVUdwFF5feAlr3HLVXN+8xq9x047rQr/zAk4SEFwbrma0xhNXHZvqK4iYdzDODUTMITbu6XbMMAmIkHbV968n7re3wFD3mdhwhXe8Thl4pLSoYRKfRMxpOPhBaSmOyUS0XLvxDcwxmYgQ/OtGZhgxhCVGHGGBKYbQxBRHaGDUECUx6ogSGDOEJMYcIYFxg1iKcYWYi6Fuz9MkziBoJgPz6RYxA+MXIYxB8JCFGARPmYlB8JhMDIJQViAY6s6XHjJG7sFTKP8Xe5g38JCFCB8YIYQtRhhhg5mBQEr/NtPB0IK/4m4wtHA/wdeVOYaENkWmGBLe2ZlgqND2VBVDhffYKhhSOigoiiHl044iGDI6shHFkPG5kwjGGiGG8YBYjKHuaTSJgwgKycQ8x6Ft4gCCYjIw5ziACc0IBknEtLF56okgGCYB0w6bT9carBExExgcNtZch37xoc5cT+AoPeZ1ALhExA8NsASbTxPzlwAAAABJRU5ErkJggg==" @@ -59,6 +59,7 @@ public class TrustlyView : UIView, TrustlyProtocol, WKNavigationDelegate, WKScri private var urlScheme = "" private var webSession: ASWebAuthenticationSession! private var baseUrls = ["paywithmybank.com", "trustly.one"] + private var isLocalEnvironment = false private let oauthLoginPath = "/oauth/login/" private var sessionCid = "ios wrong sessionCid" private var cid = "ios wrong cid" @@ -492,10 +493,10 @@ public class TrustlyView : UIView, TrustlyProtocol, WKNavigationDelegate, WKScri } if ("local" == env), let urlLocal = localUrl { - url = urlLocal+"/start/selectBank/"+fn+"?v="+build+"-ios-sdk" + url = "http://"+urlLocal+"/start/selectBank/"+fn+"?v="+build+"-ios-sdk" let cleanLocalUrl = urlLocal.components(separatedBy: ":")[0] - self.baseUrls.append(cleanLocalUrl) + isLocalEnvironment = true } else { url = "https://"+subDomain+"paywithmybank.com/start/selectBank/"+fn+"?v="+build+"-ios-sdk" @@ -602,8 +603,8 @@ extension TrustlyView { let path = url.path //1.1: On the main view creates a new OAuth view (new WKWebview) and opens the URL there - if self.checkUrl(host: host) && - path.contains(self.oauthLoginPath) { + if isLocalEnvironment || (self.checkUrl(host: host) && + path.contains(self.oauthLoginPath)) { self.buildASWebAuthenticationSession(url: url, callbackURL: urlScheme) diff --git a/TrustlySDK.podspec b/TrustlySDK.podspec index 7eae06c..522724e 100644 --- a/TrustlySDK.podspec +++ b/TrustlySDK.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = 'TrustlySDK' - s.version = '3.1.0' + s.version = '3.2.0' s.summary = 'This SDK help the merchants to integrate their solutions with Trustly Widget and LightBox.' s.swift_version = '5.0'