Skip to content

Commit

Permalink
Merge pull request #9 from TrustlyInc/DEV
Browse files Browse the repository at this point in the history
[DEV-229937] IOS - SDK support to privacy updates for App Store submissions
  • Loading branch information
marcosrivereto authored Apr 29, 2024
2 parents 44b9ab7 + 507d343 commit 3759e15
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 13 deletions.
6 changes: 3 additions & 3 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- TrustlySDK (3.0.0)
- TrustlySDK (3.1.1)

DEPENDENCIES:
- TrustlySDK (from `../`)
Expand All @@ -9,8 +9,8 @@ EXTERNAL SOURCES:
:path: "../"

SPEC CHECKSUMS:
TrustlySDK: 9c710da3104f2b7c3e25b061c0693895190ab293
TrustlySDK: 8bf9044a576043775ac7032ac2a569eb7e14a746

PODFILE CHECKSUM: 2d88e8d6e29e33aaa64b36a8d0e73ac21b25b6ba

COCOAPODS: 1.12.0
COCOAPODS: 1.12.1
4 changes: 4 additions & 0 deletions Example/TrustlySDK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */; };
Expand All @@ -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 = "<group>"; };
1587AB902A2FE043006F6FC3 /* SessionManagerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SessionManagerTests.swift; sourceTree = "<group>"; };
15987B0829DEF79D00D7A395 /* TrustlyLightBoxViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrustlyLightBoxViewController.swift; sourceTree = "<group>"; };
2416E32056EECA07B4C86E1B /* TrustlySDK.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = TrustlySDK.podspec; path = ../TrustlySDK.podspec; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
Expand Down Expand Up @@ -74,6 +76,7 @@
607FACC71AFB9204008FA782 = {
isa = PBXGroup;
children = (
15369A722BDBE3F10050FDAD /* PrivacyInfo.xcprivacy */,
607FACF51AFB993E008FA782 /* Podspec Metadata */,
607FACD21AFB9204008FA782 /* Example for TrustlySDK */,
607FACE81AFB9204008FA782 /* Tests */,
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion Example/TrustlySDK/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ class ViewController: UIViewController {
"metadata.urlScheme": "demoapp://",
"description": "First Data Mobile Test",
"env": "<[int, sandbox, local]>",
"localUrl": "<YOUR LOCAL URL WHEN `ENV` PROPERTY IS `LOCAL` (ex: https://192.168.0.30:8000)>"]
"localUrl": "<YOUR LOCAL URL WHEN `ENV` PROPERTY IS `LOCAL` (ex: 192.168.0.30:8000)>"]


self.trustlyView.onChangeListener { (eventName, attributes) in
print("onChangeListener: \(eventName) \(attributes)")
Expand Down
7 changes: 4 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ let package = Package(
targets: ["TrustlySDK"]),
],
targets: [
.target(
name: "TrustlySDK",
dependencies: []),
.target(name: "TrustlySDK",
path: "Sources",
resources: [.copy("TrustlySDK/PrivacyInfo.xcprivacy")]
),
]
)
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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*

Expand Down
32 changes: 32 additions & 0 deletions Sources/TrustlySDK/PrivacyInfo.xcprivacy
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrivacyCollectedDataTypes</key>
<array>
<dict>
<key>NSPrivacyCollectedDataType</key>
<string>NSPrivacyCollectedDataTypeOtherDataTypes</string>
<key>NSPrivacyCollectedDataTypeLinked</key>
<false/>
<key>NSPrivacyCollectedDataTypeTracking</key>
<false/>
<key>NSPrivacyCollectedDataTypePurposes</key>
<array>
<string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
</array>
</dict>
</array>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>CA92.1</string>
</array>
</dict>
</array>
</dict>
</plist>
11 changes: 6 additions & 5 deletions Sources/TrustlySDK/TrustlyView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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=="

Expand All @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion TrustlySDK.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down

0 comments on commit 3759e15

Please sign in to comment.