Skip to content

Commit

Permalink
Merge pull request #352 from tangem/release/3.10.0
Browse files Browse the repository at this point in the history
Release version 3.10.0
  • Loading branch information
tureck1y authored May 7, 2024
2 parents fd4902c + dde7808 commit 62df39a
Show file tree
Hide file tree
Showing 22 changed files with 213 additions and 366 deletions.
344 changes: 25 additions & 319 deletions CHANGELOG

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions Example/PrivacyInfo.xcprivacy
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?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>NSPrivacyTracking</key>
<false/>
<key>NSPrivacyTrackingDomains</key>
<array/>
<key>NSPrivacyCollectedDataTypes</key>
<array/>
<key>NSPrivacyAccessedAPITypes</key>
<array/>
</dict>
</plist>
18 changes: 16 additions & 2 deletions Example/TangemSdkExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
DC23EDA02912DD520023E626 /* ResetToFactorySettingsTask.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC23ED9E2912DD0D0023E626 /* ResetToFactorySettingsTask.swift */; };
DC28E0F22877F84B00AE7A84 /* DebugLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC28E0F12877F84B00AE7A84 /* DebugLogger.swift */; };
DC28E0F32877F9BA00AE7A84 /* DebugLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC28E0F12877F84B00AE7A84 /* DebugLogger.swift */; };
DC4512802BD17F8F00DE6F94 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = DC45127F2BD17F8F00DE6F94 /* PrivacyInfo.xcprivacy */; };
DC4512822BD17F9D00DE6F94 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = DC45127F2BD17F8F00DE6F94 /* PrivacyInfo.xcprivacy */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -99,6 +101,7 @@
B6B9589B2B2FCA9900E7B74E /* Podfile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Podfile; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
DC23ED9E2912DD0D0023E626 /* ResetToFactorySettingsTask.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResetToFactorySettingsTask.swift; sourceTree = "<group>"; };
DC28E0F12877F84B00AE7A84 /* DebugLogger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DebugLogger.swift; sourceTree = "<group>"; };
DC45127F2BD17F8F00DE6F94 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
E53EB3E423F2C7C90079CC11 /* TangemSdkExampleDevelopmentUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TangemSdkExampleDevelopmentUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
E53EB3E623F2C7C90079CC11 /* TangemSdkExampleDevelopmentUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TangemSdkExampleDevelopmentUITests.swift; sourceTree = "<group>"; };
E53EB3EE23F2CD860079CC11 /* RobotApi.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RobotApi.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -162,6 +165,7 @@
5D78C1AD234F435B008D7478 = {
isa = PBXGroup;
children = (
DC45127F2BD17F8F00DE6F94 /* PrivacyInfo.xcprivacy */,
B6B9589A2B2FCA9900E7B74E /* Gemfile */,
B6B9589B2B2FCA9900E7B74E /* Podfile */,
5D78C1B8234F435B008D7478 /* TangemSdkExample */,
Expand Down Expand Up @@ -301,7 +305,7 @@
};
};
};
buildConfigurationList = 5D78C1B1234F435B008D7478 /* Build configuration list for PBXProject "TangemSdkExample" */;
buildConfigurationList = 5D78C1B1234F435B008D7478 /* Build configuration list for PBXProject "TangemSDKExample" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
Expand Down Expand Up @@ -329,6 +333,7 @@
B6B9589C2B2FCA9900E7B74E /* Gemfile in Resources */,
5D78C1C6234F435C008D7478 /* LaunchScreen.storyboard in Resources */,
B6B9589D2B2FCA9900E7B74E /* Podfile in Resources */,
DC4512822BD17F9D00DE6F94 /* PrivacyInfo.xcprivacy in Resources */,
5D78C1C3234F435C008D7478 /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -337,6 +342,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
DC4512802BD17F8F00DE6F94 /* PrivacyInfo.xcprivacy in Resources */,
5DBC25BF235F053F005F0C79 /* LaunchScreen.storyboard in Resources */,
5DBC25C0235F053F005F0C79 /* Assets.xcassets in Resources */,
);
Expand Down Expand Up @@ -641,6 +647,10 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.tangem.TangemSDKExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
};
Expand All @@ -661,6 +671,10 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.tangem.TangemSDKExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
};
Expand Down Expand Up @@ -709,7 +723,7 @@
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
5D78C1B1234F435B008D7478 /* Build configuration list for PBXProject "TangemSdkExample" */ = {
5D78C1B1234F435B008D7478 /* Build configuration list for PBXProject "TangemSDKExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
5D78C1C8234F435C008D7478 /* Debug */,
Expand Down
2 changes: 1 addition & 1 deletion TangemSdk.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'TangemSdk'
s.version = '3.9.0'
s.version = '3.10.0'
s.summary = 'Use TangemSdk for Tangem cards integration'
s.description = <<-DESC
Tangem is a Swiss-based secure hardware wallet manufacturer that enables blockchain-based assets to be kept in custody within smart physical banknotes and accessed via NFC technology. Tangem’s mission is to make digital assets accessible, affordable and convenient for consumers.
Expand Down
8 changes: 8 additions & 0 deletions TangemSdk/TangemSdk.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2448,6 +2448,10 @@
PRODUCT_BUNDLE_IDENTIFIER = com.tangem.tangemSdk.example;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_INCLUDE_PATHS = "$(SRCROOT)/TangemSdk/";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
Expand Down Expand Up @@ -2497,6 +2501,10 @@
PRODUCT_BUNDLE_IDENTIFIER = com.tangem.tangemSdk.example;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_INCLUDE_PATHS = "$(SRCROOT)/TangemSdk/";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
Expand Down
3 changes: 1 addition & 2 deletions TangemSdk/TangemSdk/Common/Core/CardSession.swift
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ public class CardSession {
/// - Parameter error: The error to show
public func stop(error: Error, completion: (() -> Void)?) {
Log.session("Stop session")
reader.stopSession(with: error.localizedDescription)
reader.stopSession(with: error)
sessionDidStop(completion: completion)
}

Expand Down Expand Up @@ -321,7 +321,6 @@ public class CardSession {
.sink(receiveCompletion: {[weak self] readerCompletion in
self?.sendSubscription = []
if case let .failure(error) = readerCompletion {
Log.error(error)
completion(.failure(error))
}
}, receiveValue: {[weak self] responseApdu in
Expand Down
7 changes: 5 additions & 2 deletions TangemSdk/TangemSdk/Common/Core/TangemSdkError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -511,9 +511,12 @@ public enum TangemSdkError: Error, LocalizedError, Encodable {
case .backupFailedNotEmptyWallets: return "error_backup_not_empty_wallets".localized
case .backupFailedWrongIssuer, .backupFailedHDWalletSettings, .backupFailedNotEnoughCurves,
.backupFailedNotEnoughWallets, .backupFailedFirmware, .backupNotAllowed,
.backupFailedIncompatibleBatch, .backupFailedIncompatibleFirmware, .backupFailedKeysImportSettings,
.backupFailedAlreadyCreated:
.backupFailedIncompatibleBatch, .backupFailedIncompatibleFirmware, .backupFailedKeysImportSettings:
return "error_backup_wrong_card".localized("\(self.code)")
case .backupFailedAlreadyCreated:
return "error_backup_failed_already_created".localized
case .noActiveBackup:
return "error_no_active_backup".localized
case .resetPinWrongCard:
return "error_reset_wrong_card".localized("\(self.code)")
case .oldCard: return "error_old_card".localized
Expand Down
26 changes: 21 additions & 5 deletions TangemSdk/TangemSdk/Common/Extensions/TangemSdk+Combine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,36 @@ extension NFCTagReaderSession {
}

@available(iOS 13.0, *)
extension TangemSdk {
public extension TangemSdk {
/// Combine wrapper for `startSession` method.
/// - Parameters:
/// - runnable: A custom task, adopting `CardSessionRunnable` protocol
/// - cardId: CID, Unique Tangem card ID number. If not nil, the SDK will check that you tapped the card with this cardID and will return the `wrongCard` error' otherwise
/// - initialMessage: A custom description that shows at the beginning of the NFC session. If nil, default message will be used
/// - accessCode: Access code that will be used for a card session initialization. If nil, Tangem SDK will handle it automatically.
/// - Returns: `AnyPublisher<T.Response, TangemSdkError>`
public func startSessionPublisher<T: CardSessionRunnable>(with runnable: T,
cardId: String? = nil,
initialMessage: Message? = nil,
accessCode: String? = nil) -> AnyPublisher<T.Response, TangemSdkError> {
func startSessionPublisher<T: CardSessionRunnable>(with runnable: T,
cardId: String?,
initialMessage: Message? = nil,
accessCode: String? = nil) -> AnyPublisher<T.Response, TangemSdkError> {
return Deferred { Future() {
self.startSession(with: runnable, cardId: cardId, initialMessage: initialMessage, accessCode: accessCode, completion: $0)
}}.eraseToAnyPublisher()
}

/// Combine wrapper for `startSession` method.
/// - Parameters:
/// - runnable: A custom task, adopting `CardSessionRunnable` protocol
/// - filter: Filters card to be read. Optional.
/// - initialMessage: A custom description that shows at the beginning of the NFC session. If nil, default message will be used
/// - accessCode: Access code that will be used for a card session initialization. If nil, Tangem SDK will handle it automatically.
/// - Returns: `AnyPublisher<T.Response, TangemSdkError>`
func startSessionPublisher<T: CardSessionRunnable>(with runnable: T,
filter: SessionFilter?,
initialMessage: Message? = nil,
accessCode: String? = nil) -> AnyPublisher<T.Response, TangemSdkError> {
return Deferred { Future() {
self.startSession(with: runnable, filter: filter, initialMessage: initialMessage, accessCode: accessCode, completion: $0)
}}.eraseToAnyPublisher()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
"common_warning" = "Warning";
"error_already_created" = "Ein Wallet ist bereits erstellt worden";
"error_backup_card_already_added" = "This card has already been added to the list";
"error_backup_failed_already_created" = "This card cannot be used as a backup because it already contains a wallet. Ensure that no funds are stored on the card by scanning it in the app. Then, reset it to factory settings.";
"error_backup_not_empty_wallets" = "This card already has a wallet. If you want to proceed you have to reset it to factory settings first.";
"error_backup_wrong_card" = "This card can't be used as a backup card. Error code: %@.";
"error_card_verification_failed" = "Die Kartenverifizierung ist fehlgeschlagen";
"error_file_not_found" = "File not found";
"error_no_active_backup" = "The selected card cannot be used to reset the card access code, because there is no backup on it. Please contact support team.";
"error_old_card" = "Tangem cards issued before September 2019 cannot sign data using an iPhone due to iOS restrictions";
"error_pin_cannot_be_changed_format" = "%@ cannot be changed";
"error_pin_cannot_be_default_format" = "%@ cannot be changed to this value. Please, enter another one.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
"common_warning" = "Warning";
"error_already_created" = "A wallet has already been created";
"error_backup_card_already_added" = "This card has already been added to the list";
"error_backup_failed_already_created" = "This card cannot be used as a backup because it already contains a wallet. Ensure that no funds are stored on the card by scanning it in the app. Then, reset it to factory settings.";
"error_backup_not_empty_wallets" = "This card already has a wallet. If you want to proceed you have to reset it to factory settings first.";
"error_backup_wrong_card" = "This card can't be used as a backup card. Error code: %@.";
"error_card_verification_failed" = "Card verification failed";
"error_file_not_found" = "File not found";
"error_no_active_backup" = "The selected card cannot be used to reset the card access code, because there is no backup on it. Please contact support team.";
"error_old_card" = "Tangem cards issued before September 2019 cannot sign data using an iPhone due to iOS restrictions";
"error_pin_cannot_be_changed_format" = "%@ cannot be changed";
"error_pin_cannot_be_default_format" = "%@ cannot be changed to this value. Please, enter another one.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
"common_warning" = "Warning";
"error_already_created" = "Le portefeuille a déjà été créé";
"error_backup_card_already_added" = "This card has already been added to the list";
"error_backup_failed_already_created" = "This card cannot be used as a backup because it already contains a wallet. Ensure that no funds are stored on the card by scanning it in the app. Then, reset it to factory settings.";
"error_backup_not_empty_wallets" = "This card already has a wallet. If you want to proceed you have to reset it to factory settings first.";
"error_backup_wrong_card" = "This card can't be used as a backup card. Error code: %@.";
"error_card_verification_failed" = "Erreur de validation de la carte";
"error_file_not_found" = "File not found";
"error_no_active_backup" = "The selected card cannot be used to reset the card access code, because there is no backup on it. Please contact support team.";
"error_old_card" = "Tangem cards issued before September 2019 cannot sign data using an iPhone due to iOS restrictions";
"error_pin_cannot_be_changed_format" = "%@ cannot be changed";
"error_pin_cannot_be_default_format" = "%@ cannot be changed to this value. Please, enter another one.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
"common_warning" = "Warning";
"error_already_created" = "Portafoglio già creato";
"error_backup_card_already_added" = "This card has already been added to the list";
"error_backup_failed_already_created" = "This card cannot be used as a backup because it already contains a wallet. Ensure that no funds are stored on the card by scanning it in the app. Then, reset it to factory settings.";
"error_backup_not_empty_wallets" = "This card already has a wallet. If you want to proceed you have to reset it to factory settings first.";
"error_backup_wrong_card" = "This card can't be used as a backup card. Error code: %@.";
"error_card_verification_failed" = "Non è stata eseguita la verifica della carta";
"error_file_not_found" = "File not found";
"error_no_active_backup" = "The selected card cannot be used to reset the card access code, because there is no backup on it. Please contact support team.";
"error_old_card" = "Tangem cards issued before September 2019 cannot sign data using an iPhone due to iOS restrictions";
"error_pin_cannot_be_changed_format" = "%@ cannot be changed";
"error_pin_cannot_be_default_format" = "%@ cannot be changed to this value. Please, enter another one.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
"common_warning" = "Предупреждение";
"error_already_created" = "Кошелек уже создан";
"error_backup_card_already_added" = "Эта карта уже добавлена в список";
"error_backup_failed_already_created" = "Резервное копирование не возможно, на выбранной карте уже создан кошелек. Пожалуйста, убедитесь, что на этой карте нет средств, отсканировав её в приложении, и затем сбросьте её до заводских настроек.";
"error_backup_not_empty_wallets" = "На этой карте уже создан кошелёк. Если вы хотите продолжить, сбросьте карту к заводским настройкам.";
"error_backup_wrong_card" = "Эту карту нельзя использовать для резервного копирования. Код ошибки: %@.";
"error_card_verification_failed" = "Ошибка проверки карты";
"error_file_not_found" = "Файл не найден";
"error_no_active_backup" = "Выбранная карта не может использоваться для сброса кода доступа карты, т.к. на ней нет резервного копирования. Обратитесь, пожалуйста, в поддержку.";
"error_old_card" = "Карты Tangem, выпущенные до сентября 2019 года, не могут подписывать данные с помощью iPhone из-за ограничений iOS.";
"error_pin_cannot_be_changed_format" = "%@ не может быть изменен";
"error_pin_cannot_be_default_format" = "%@ нельзя изменить на это значение. Пожалуйста, введите другое";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
"common_warning" = "警告";
"error_already_created" = "已創建錢包";
"error_backup_card_already_added" = "此卡已添加到列表中";
"error_backup_failed_already_created" = "This card cannot be used as a backup because it already contains a wallet. Ensure that no funds are stored on the card by scanning it in the app. Then, reset it to factory settings.";
"error_backup_not_empty_wallets" = "這張卡已經有錢包了。如果要繼續,您必須先將其重置為出廠設置";
"error_backup_wrong_card" = "此卡不能作為備用卡使用。錯誤代碼:%@。";
"error_card_verification_failed" = "卡驗證失敗";
"error_file_not_found" = "文件未找到";
"error_no_active_backup" = "The selected card cannot be used to reset the card access code, because there is no backup on it. Please contact support team.";
"error_old_card" = "由於 iOS 限制,2019 年 9 月之前發行的 Tangem 卡無法使用 iPhone 簽署數據";
"error_pin_cannot_be_changed_format" = "%@ 無法更改";
"error_pin_cannot_be_default_format" = "%@ 不能更改為此值。 請輸入另一個";
Expand Down
1 change: 1 addition & 0 deletions TangemSdk/TangemSdk/Common/NFC/CardReader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public protocol CardReader: AnyObject {
func resumeSession()
func stopSession(with errorMessage: String?)
func pauseSession(with errorMessage: String?)
func stopSession(with error: Error)
func sendPublisher(apdu: CommandApdu) -> AnyPublisher<ResponseApdu, TangemSdkError>
func restartPolling(silent: Bool)
}
Expand Down
Loading

0 comments on commit 62df39a

Please sign in to comment.