Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Fix warnings in SDK and debug app #847

Merged
merged 1 commit into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Debug App/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>com.primerapi.PrimerSDKExample</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
Expand Down
8 changes: 4 additions & 4 deletions Debug App/Primer.io Debug App.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
E1A2971F2B021ABA005ADA51 /* URL+NetworkHeaders.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1AB44D12AFE13AF00639DC5 /* URL+NetworkHeaders.swift */; };
EA7FAA4F8476BD3711D628CB /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B18D7E7738BF86467B0F1465 /* Images.xcassets */; };
F02F496FD20B5291C044F62C /* MerchantResultViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00E3C8FE62D22147335F2455 /* MerchantResultViewController.swift */; };
F03699592AC2E63700E4179D /* BuildFile in Sources */ = {isa = PBXBuildFile; };
F03699592AC2E63700E4179D /* (null) in Sources */ = {isa = PBXBuildFile; };
F08F63D82B9B5A7C006EF9A9 /* SessionConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = F08F63D72B9B5A7C006EF9A9 /* SessionConfiguration.swift */; };
F08F63DA2B9B5BC5006EF9A9 /* AppetizeConfigProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = F08F63D92B9B5BC5006EF9A9 /* AppetizeConfigProvider.swift */; };
F08F63DC2B9F27B0006EF9A9 /* MetadataParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = F08F63DB2B9F27B0006EF9A9 /* MetadataParser.swift */; };
Expand Down Expand Up @@ -609,7 +609,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F03699592AC2E63700E4179D /* BuildFile in Sources */,
F03699592AC2E63700E4179D /* (null) in Sources */,
04F323612BD408C600F5927C /* AppetizeConfigTests.swift in Sources */,
04F323632BD408C600F5927C /* MetadataParserTests.swift in Sources */,
);
Expand Down Expand Up @@ -740,7 +740,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "";
PRODUCT_BUNDLE_IDENTIFIER = com.primerapi.PrimerSDKExample;
PRODUCT_NAME = "Debug App";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match Development com.primerapi.PrimerSDKExample";
Expand Down Expand Up @@ -775,7 +775,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "";
PRODUCT_BUNDLE_IDENTIFIER = com.primerapi.PrimerSDKExample;
PRODUCT_NAME = "Debug App";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match Development com.primerapi.PrimerSDKExample";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"size" : "60x60"
},
{
"filename" : "ItunesArtwork@2x 1.png",
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,8 @@ final class MerchantResultViewController: UIViewController {

if logs.count > 0 {
if let data = try? JSONSerialization.data(withJSONObject: logs) {
if let prettyNSStr = data.prettyPrintedJSONString {
if let prettyStr = prettyNSStr as? String {
logsTextView.text = prettyStr
} else {
logsTextView.text = "[\"Failed to case NSString to String [WebDriverIO]\"]"
}
if let prettyNSStr = data.prettyPrintedJSONString as? String {
logsTextView.text = prettyNSStr
} else {
logsTextView.text = "[\"Failed to create pretty string from logs\"]"
}
Expand All @@ -59,12 +55,8 @@ final class MerchantResultViewController: UIViewController {

if let checkoutData {
if let data = try? JSONEncoder().encode(checkoutData) {
if let prettyNSStr = data.prettyPrintedJSONString {
if let prettyStr = prettyNSStr as? String {
responseTextView.text = prettyStr
} else {
responseTextView.text = "[\"Failed to case NSString to String [WebDriverIO]\"]"
}
if let prettyNSStr = data.prettyPrintedJSONString as? String {
responseTextView.text = prettyNSStr
} else {
responseTextView.text = "[\"Failed to create pretty string from checkout data\"]"
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/PrimerSDK/Classes/Core/3DS/3DSService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,8 @@ class ThreeDSService: ThreeDSServiceProtocol, LogReporter {

// ⚠️ Property version doesn't exist on version before 1.1.0, so PrimerSDK won't build
// if Primer3DS is not equal or above 1.1.0
if Primer3DS.hardcodedVersion.compareWithVersion("1.1.1") == .orderedDescending ||
Primer3DS.hardcodedVersion.compareWithVersion("1.1.1") == .orderedSame {
if Primer3DS.version.compareWithVersion("1.1.1") == .orderedDescending ||
Primer3DS.version.compareWithVersion("1.1.1") == .orderedSame {
do {
primer3DS.is3DSSanityCheckEnabled = PrimerSettings.current.debugOptions.is3DSSanityCheckEnabled
try primer3DS.initializeSDK(apiKey: apiKey, certificates: certs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ extension PrimerKlarnaError: PrimerErrorProtocol {
.klarnaSdkError(_, let userInfo):
tmpUserInfo = tmpUserInfo.merging(userInfo ?? [:]) { (_, new) in new }
tmpUserInfo["diagnosticsId"] = self.diagnosticsId
default: break
}

return tmpUserInfo
Expand All @@ -34,6 +35,8 @@ extension PrimerKlarnaError: PrimerErrorProtocol {
return "klarna-user-not-approved"
case .klarnaSdkError:
return "klarna-sdk-error"
default:
return "klarna-unknown-error-id"
}
}

Expand Down
Loading