Skip to content

Commit

Permalink
Update to 0.3.0-alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
tureck1y committed Oct 31, 2019
1 parent d3573af commit 1e2d760
Show file tree
Hide file tree
Showing 35 changed files with 583 additions and 462 deletions.
33 changes: 7 additions & 26 deletions Example/TangemSdkExample copy-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,17 @@
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
<key>UISceneStoryboardFile</key>
<string>Main</string>
</dict>
</array>
</dict>
</dict>
<key>NFCReaderUsageDescription</key>
<string>Some reason</string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
<string>nfc</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
Expand All @@ -56,13 +44,6 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>NFCReaderUsageDescription</key>
<string>Some reason</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
<string>nfc</string>
</array>
<key>com.apple.developer.nfc.readersession.iso7816.select-identifiers</key>
<array>
<string>A000000812010208</string>
Expand Down
14 changes: 4 additions & 10 deletions Example/TangemSdkExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@
/* Begin PBXBuildFile section */
1877E1352A87AB5A10A9DEEB /* Pods_TangemSdkExample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1FBA83D46E372E8B3A786303 /* Pods_TangemSdkExample.framework */; };
5D78C1BA234F435B008D7478 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D78C1B9234F435B008D7478 /* AppDelegate.swift */; };
5D78C1BC234F435B008D7478 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D78C1BB234F435B008D7478 /* SceneDelegate.swift */; };
5D78C1BE234F435B008D7478 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D78C1BD234F435B008D7478 /* ViewController.swift */; };
5D78C1C1234F435B008D7478 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5D78C1BF234F435B008D7478 /* Main.storyboard */; };
5D78C1C3234F435C008D7478 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5D78C1C2234F435C008D7478 /* Assets.xcassets */; };
5D78C1C6234F435C008D7478 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5D78C1C4234F435C008D7478 /* LaunchScreen.storyboard */; };
5DBC25B9235F053F005F0C79 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D78C1BD234F435B008D7478 /* ViewController.swift */; };
5DBC25BA235F053F005F0C79 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D78C1B9234F435B008D7478 /* AppDelegate.swift */; };
5DBC25BB235F053F005F0C79 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D78C1BB234F435B008D7478 /* SceneDelegate.swift */; };
5DBC25BF235F053F005F0C79 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5D78C1C4234F435C008D7478 /* LaunchScreen.storyboard */; };
5DBC25C0235F053F005F0C79 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5D78C1C2234F435C008D7478 /* Assets.xcassets */; };
5DBC25C1235F053F005F0C79 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5D78C1BF234F435B008D7478 /* Main.storyboard */; };
Expand All @@ -43,7 +41,6 @@
376DED5F3D14F5D1CA98D5F2 /* Pods-TangemSdkExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TangemSdkExample.debug.xcconfig"; path = "Target Support Files/Pods-TangemSdkExample/Pods-TangemSdkExample.debug.xcconfig"; sourceTree = "<group>"; };
5D78C1B6234F435B008D7478 /* TangemSdkExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TangemSdkExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
5D78C1B9234F435B008D7478 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
5D78C1BB234F435B008D7478 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
5D78C1BD234F435B008D7478 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
5D78C1C0234F435B008D7478 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
5D78C1C2234F435C008D7478 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
Expand Down Expand Up @@ -101,7 +98,6 @@
children = (
5D7FE136234F7D6700A1F440 /* TangemSdkExample.entitlements */,
5D78C1B9234F435B008D7478 /* AppDelegate.swift */,
5D78C1BB234F435B008D7478 /* SceneDelegate.swift */,
5D78C1BD234F435B008D7478 /* ViewController.swift */,
5D78C1BF234F435B008D7478 /* Main.storyboard */,
5D78C1C2234F435C008D7478 /* Assets.xcassets */,
Expand Down Expand Up @@ -184,7 +180,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 @@ -275,7 +271,6 @@
files = (
5D78C1BE234F435B008D7478 /* ViewController.swift in Sources */,
5D78C1BA234F435B008D7478 /* AppDelegate.swift in Sources */,
5D78C1BC234F435B008D7478 /* SceneDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -285,7 +280,6 @@
files = (
5DBC25B9235F053F005F0C79 /* ViewController.swift in Sources */,
5DBC25BA235F053F005F0C79 /* AppDelegate.swift in Sources */,
5DBC25BB235F053F005F0C79 /* SceneDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -361,7 +355,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.1;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -415,7 +409,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.1;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -506,7 +500,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
19 changes: 2 additions & 17 deletions Example/TangemSdkExample/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import TangemSdk
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {



var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.

Expand All @@ -22,20 +22,5 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
return true
}

// MARK: UISceneSession Lifecycle

func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
// Called when a new scene session is being created.
// Use this method to select a configuration to create the new scene with.
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}

func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
// Called when the user discards a scene session.
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
}


}

33 changes: 7 additions & 26 deletions Example/TangemSdkExample/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,17 @@
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
<key>UISceneStoryboardFile</key>
<string>Main</string>
</dict>
</array>
</dict>
</dict>
<key>NFCReaderUsageDescription</key>
<string>Some reason</string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
<string>nfc</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
Expand All @@ -56,13 +44,6 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>NFCReaderUsageDescription</key>
<string>Some reason</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
<string>nfc</string>
</array>
<key>com.apple.developer.nfc.readersession.iso7816.select-identifiers</key>
<array>
<string>A000000812010208</string>
Expand Down
53 changes: 0 additions & 53 deletions Example/TangemSdkExample/SceneDelegate.swift

This file was deleted.

44 changes: 24 additions & 20 deletions Example/TangemSdkExample/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import UIKit
import TangemSdk
import CoreNFC

class ViewController: UIViewController {

Expand Down Expand Up @@ -41,28 +40,33 @@ class ViewController: UIViewController {
}

@IBAction func signHashesTapped(_ sender: Any) {
let hash1 = Data(repeating: 1, count: 32) //dummy hashes
let hash2 = Data(repeating: 2, count: 32)
let hashes = [hash1, hash2]
guard let cardId = card?.cardId else {
print("Please, scan card before")
return
}

cardManager.sign(hashes: hashes, cardId: cardId) { taskEvent in
switch taskEvent {
case .event(let signResponse):
print(signResponse)
case .completion(let error):
if let error = error {
if case .userCancelled = error {
//silence user cancelled
} else {
print("completed with error: \(error.localizedDescription)")
if #available(iOS 13.0, *) {
let hash1 = Data(repeating: 1, count: 32) //dummy hashes
let hash2 = Data(repeating: 2, count: 32)
let hashes = [hash1, hash2]
guard let cardId = card?.cardId else {
print("Please, scan card before")
return
}

cardManager.sign(hashes: hashes, cardId: cardId) { taskEvent in
switch taskEvent {
case .event(let signResponse):
print(signResponse)
case .completion(let error):
if let error = error {
if case .userCancelled = error {
//silence user cancelled
} else {
print("completed with error: \(error.localizedDescription)")
}
}
//handle completion. Unlock UI, etc.
}
//handle completion. Unlock UI, etc.
}
} else {
// Fallback on earlier versions
print("Only iOS 13+")
}
}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The Tangem card is a self-custodial hardware wallet for blockchain assets. The m
## Getting Started

### Requirements
iOS 11+ (CoreNFC is required)
iOS 11+ (CoreNFC is required), Xcode 11+

### Installation

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 = '0.2.0-alpha'
s.version = '0.3.0-alpha'
s.summary = 'Use TangemSdk for Tangem cards integration'

# This description is used to generate tags and improve search results.
Expand Down
Loading

0 comments on commit 1e2d760

Please sign in to comment.