diff --git a/SampleApp.xcodeproj b/SampleApp.xcodeproj deleted file mode 120000 index b2592be..0000000 --- a/SampleApp.xcodeproj +++ /dev/null @@ -1 +0,0 @@ -SampleApp/SampleApp.xcodeproj \ No newline at end of file diff --git a/SampleApp/SampleApp.xcodeproj/project.pbxproj b/SampleApp/SampleApp.xcodeproj/project.pbxproj deleted file mode 100644 index c48cb5b..0000000 --- a/SampleApp/SampleApp.xcodeproj/project.pbxproj +++ /dev/null @@ -1,642 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 60; - objects = { - -/* Begin PBXBuildFile section */ - 631269FD2BE087E60093E9BC /* DemoConnectionProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 631269FC2BE087E60093E9BC /* DemoConnectionProvider.swift */; }; - 6344C4562BE1C2FE0071A025 /* ErrorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6344C4552BE1C2FE0071A025 /* ErrorView.swift */; }; - 6344C45A2BE1C3130071A025 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6344C4582BE1C3130071A025 /* ContentView.swift */; }; - 635FF3712BBE1D4C0027D144 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BD9CEA642B9A90FD00928203 /* Assets.xcassets */; }; - 63AA55402BE1C7AC00F7C509 /* TransactionOutcomeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63AA553F2BE1C7AC00F7C509 /* TransactionOutcomeView.swift */; }; - 63AA55422BE1CB1A00F7C509 /* PaymentFormView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63AA55412BE1CB1A00F7C509 /* PaymentFormView.swift */; }; - 63D356FB2BE322F000EA7ECF /* ContentViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63D356FA2BE322F000EA7ECF /* ContentViewModel.swift */; }; - 63D356FD2BE3237100EA7ECF /* ResetButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63D356FC2BE3237100EA7ECF /* ResetButton.swift */; }; - 63D357042BE324EF00EA7ECF /* CloseButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63D357032BE324EF00EA7ECF /* CloseButton.swift */; }; - BD0A731D2B9E8FDB00659F82 /* RestClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD0A731C2B9E8FDB00659F82 /* RestClient.swift */; }; - BD0A738C2BA2B7B700659F82 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = BD0A738B2BA2B7B700659F82 /* Localizable.xcstrings */; }; - BD0DAA522BA8876A00100EC1 /* config_uat.env in Resources */ = {isa = PBXBuildFile; fileRef = BD0DAA512BA8876A00100EC1 /* config_uat.env */; }; - BD80AC7D2BB28991008C4B9C /* TyroTapToPaySDKPackage in Frameworks */ = {isa = PBXBuildFile; productRef = BD80AC742BB26225008C4B9C /* TyroTapToPaySDKPackage */; }; - BDABE9152BAAA6190054001F /* TransactionType.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDABE9142BAAA6190054001F /* TransactionType.swift */; }; - BDC05CC72B903FB50062C06D /* SampleApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDC05CBC2B903FB50062C06D /* SampleApp.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - BD1633812B9ACF6A00183BE7 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 8B76E0C82B5782500017B455 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 8B76E0CF2B5782500017B455; - remoteInfo = SampleApp; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 8B76E12C2B579E780017B455 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 631269FC2BE087E60093E9BC /* DemoConnectionProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DemoConnectionProvider.swift; sourceTree = ""; }; - 6344C4552BE1C2FE0071A025 /* ErrorView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ErrorView.swift; sourceTree = ""; }; - 6344C4582BE1C3130071A025 /* ContentView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; - 63AA553F2BE1C7AC00F7C509 /* TransactionOutcomeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransactionOutcomeView.swift; sourceTree = ""; }; - 63AA55412BE1CB1A00F7C509 /* PaymentFormView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PaymentFormView.swift; sourceTree = ""; }; - 63D356FA2BE322F000EA7ECF /* ContentViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentViewModel.swift; sourceTree = ""; }; - 63D356FC2BE3237100EA7ECF /* ResetButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResetButton.swift; sourceTree = ""; }; - 63D357032BE324EF00EA7ECF /* CloseButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CloseButton.swift; sourceTree = ""; }; - 8B76E0D02B5782500017B455 /* SampleApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SampleApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; - BD0A731C2B9E8FDB00659F82 /* RestClient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RestClient.swift; sourceTree = ""; }; - BD0A731F2B9F27E600659F82 /* SampleApp.entitlements */ = {isa = PBXFileReference; explicitFileType = text.plist.entitlements; path = SampleApp.entitlements; sourceTree = ""; }; - BD0A738B2BA2B7B700659F82 /* Localizable.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = Localizable.xcstrings; sourceTree = ""; }; - BD0DAA4E2BA8857E00100EC1 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - BD0DAA512BA8876A00100EC1 /* config_uat.env */ = {isa = PBXFileReference; lastKnownFileType = file; path = config_uat.env; sourceTree = ""; }; - BD16337D2B9ACF6A00183BE7 /* SampleAppTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SampleAppTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - BD9CEA642B9A90FD00928203 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - BD9CEA672B9A90FD00928203 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; - BDABE9142BAAA6190054001F /* TransactionType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransactionType.swift; sourceTree = ""; }; - BDC05CBC2B903FB50062C06D /* SampleApp.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SampleApp.swift; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 8B76E0CD2B5782500017B455 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - BD80AC7D2BB28991008C4B9C /* TyroTapToPaySDKPackage in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - BD16337A2B9ACF6A00183BE7 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 63D356FE2BE3238E00EA7ECF /* ViewModels */ = { - isa = PBXGroup; - children = ( - 63D356FA2BE322F000EA7ECF /* ContentViewModel.swift */, - ); - path = ViewModels; - sourceTree = ""; - }; - 63D357002BE3249E00EA7ECF /* Types */ = { - isa = PBXGroup; - children = ( - BDABE9142BAAA6190054001F /* TransactionType.swift */, - ); - path = Types; - sourceTree = ""; - }; - 63D357022BE324CD00EA7ECF /* Components */ = { - isa = PBXGroup; - children = ( - 63D356FC2BE3237100EA7ECF /* ResetButton.swift */, - 63D357032BE324EF00EA7ECF /* CloseButton.swift */, - ); - path = Components; - sourceTree = ""; - }; - 8B76E0C72B5782500017B455 = { - isa = PBXGroup; - children = ( - BDC05CB02B903FB50062C06D /* SampleApp */, - 8B76E0D12B5782500017B455 /* Products */, - ); - sourceTree = ""; - }; - 8B76E0D12B5782500017B455 /* Products */ = { - isa = PBXGroup; - children = ( - 8B76E0D02B5782500017B455 /* SampleApp.app */, - BD16337D2B9ACF6A00183BE7 /* SampleAppTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - BD0A731B2B9E8FA800659F82 /* POS */ = { - isa = PBXGroup; - children = ( - 631269FC2BE087E60093E9BC /* DemoConnectionProvider.swift */, - BD0A731C2B9E8FDB00659F82 /* RestClient.swift */, - ); - path = POS; - sourceTree = ""; - }; - BD0DAA4D2BA884DD00100EC1 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - BD0DAA512BA8876A00100EC1 /* config_uat.env */, - BD0DAA4E2BA8857E00100EC1 /* Info.plist */, - ); - path = "Supporting Files"; - sourceTree = ""; - }; - BD16336B2B9AC46800183BE7 /* Resources */ = { - isa = PBXGroup; - children = ( - BD9CEA642B9A90FD00928203 /* Assets.xcassets */, - BD0A738B2BA2B7B700659F82 /* Localizable.xcstrings */, - ); - path = Resources; - sourceTree = ""; - }; - BD9CEA4A2B982BB800928203 /* Views */ = { - isa = PBXGroup; - children = ( - 6344C4582BE1C3130071A025 /* ContentView.swift */, - 63AA553F2BE1C7AC00F7C509 /* TransactionOutcomeView.swift */, - 6344C4552BE1C2FE0071A025 /* ErrorView.swift */, - 63AA55412BE1CB1A00F7C509 /* PaymentFormView.swift */, - ); - path = Views; - sourceTree = ""; - }; - BD9CEA662B9A90FD00928203 /* Preview Content */ = { - isa = PBXGroup; - children = ( - BD9CEA672B9A90FD00928203 /* Preview Assets.xcassets */, - ); - path = "Preview Content"; - sourceTree = ""; - }; - BDC05CB02B903FB50062C06D /* SampleApp */ = { - isa = PBXGroup; - children = ( - BD0A731F2B9F27E600659F82 /* SampleApp.entitlements */, - BD9CEA662B9A90FD00928203 /* Preview Content */, - BD16336B2B9AC46800183BE7 /* Resources */, - BD0DAA4D2BA884DD00100EC1 /* Supporting Files */, - BD0A731B2B9E8FA800659F82 /* POS */, - 63D357002BE3249E00EA7ECF /* Types */, - 63D357022BE324CD00EA7ECF /* Components */, - 63D356FE2BE3238E00EA7ECF /* ViewModels */, - BD9CEA4A2B982BB800928203 /* Views */, - BDC05CBC2B903FB50062C06D /* SampleApp.swift */, - ); - path = SampleApp; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 8B76E0CF2B5782500017B455 /* SampleApp */ = { - isa = PBXNativeTarget; - buildConfigurationList = 8B76E0DE2B5782520017B455 /* Build configuration list for PBXNativeTarget "SampleApp" */; - buildPhases = ( - BDDDB1FB2BA95397004385DB /* ShellScript */, - 8B76E0CC2B5782500017B455 /* Sources */, - 8B76E0CD2B5782500017B455 /* Frameworks */, - 8B76E0CE2B5782500017B455 /* Resources */, - 8B76E12C2B579E780017B455 /* Embed Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = SampleApp; - packageProductDependencies = ( - BD80AC742BB26225008C4B9C /* TyroTapToPaySDKPackage */, - ); - productName = "tyro-tap-to-pay-sdk-ios-sample-app"; - productReference = 8B76E0D02B5782500017B455 /* SampleApp.app */; - productType = "com.apple.product-type.application"; - }; - BD16337C2B9ACF6A00183BE7 /* SampleAppTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = BD1633832B9ACF6A00183BE7 /* Build configuration list for PBXNativeTarget "SampleAppTests" */; - buildPhases = ( - BD1633792B9ACF6A00183BE7 /* Sources */, - BD16337A2B9ACF6A00183BE7 /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - BD1633822B9ACF6A00183BE7 /* PBXTargetDependency */, - ); - name = SampleAppTests; - packageProductDependencies = ( - ); - productName = SampleAppTests; - productReference = BD16337D2B9ACF6A00183BE7 /* SampleAppTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 8B76E0C82B5782500017B455 /* Project object */ = { - isa = PBXProject; - attributes = { - BuildIndependentTargetsInParallel = 1; - LastSwiftUpdateCheck = 1500; - LastUpgradeCheck = 1500; - TargetAttributes = { - 8B76E0CF2B5782500017B455 = { - CreatedOnToolsVersion = 15.0.1; - }; - BD16337C2B9ACF6A00183BE7 = { - CreatedOnToolsVersion = 15.0.1; - TestTargetID = 8B76E0CF2B5782500017B455; - }; - }; - }; - buildConfigurationList = 8B76E0CB2B5782500017B455 /* Build configuration list for PBXProject "SampleApp" */; - compatibilityVersion = "Xcode 14.0"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 8B76E0C72B5782500017B455; - packageReferences = ( - BD0E77F72BBD21D5008CED1E /* XCLocalSwiftPackageReference ".." */, - ); - productRefGroup = 8B76E0D12B5782500017B455 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 8B76E0CF2B5782500017B455 /* SampleApp */, - BD16337C2B9ACF6A00183BE7 /* SampleAppTests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 8B76E0CE2B5782500017B455 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - BD0DAA522BA8876A00100EC1 /* config_uat.env in Resources */, - 635FF3712BBE1D4C0027D144 /* Assets.xcassets in Resources */, - BD0A738C2BA2B7B700659F82 /* Localizable.xcstrings in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - BDDDB1FB2BA95397004385DB /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 8; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - ); - outputFileListPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 1; - shellPath = /bin/sh; - shellScript = "set -e\n\nswift package TyroTapToPaySDKPackage update\n"; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 8B76E0CC2B5782500017B455 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - BD0A731D2B9E8FDB00659F82 /* RestClient.swift in Sources */, - 63D356FD2BE3237100EA7ECF /* ResetButton.swift in Sources */, - 6344C45A2BE1C3130071A025 /* ContentView.swift in Sources */, - 631269FD2BE087E60093E9BC /* DemoConnectionProvider.swift in Sources */, - 63D357042BE324EF00EA7ECF /* CloseButton.swift in Sources */, - 63AA55402BE1C7AC00F7C509 /* TransactionOutcomeView.swift in Sources */, - BDABE9152BAAA6190054001F /* TransactionType.swift in Sources */, - 63D356FB2BE322F000EA7ECF /* ContentViewModel.swift in Sources */, - 63AA55422BE1CB1A00F7C509 /* PaymentFormView.swift in Sources */, - 6344C4562BE1C2FE0071A025 /* ErrorView.swift in Sources */, - BDC05CC72B903FB50062C06D /* SampleApp.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - BD1633792B9ACF6A00183BE7 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - BD1633822B9ACF6A00183BE7 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 8B76E0CF2B5782500017B455 /* SampleApp */; - targetProxy = BD1633812B9ACF6A00183BE7 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - 8B76E0DC2B5782520017B455 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - CREATE_INFOPLIST_SECTION_IN_BINARY = YES; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - ENABLE_USER_SCRIPT_SANDBOXING = YES; - GCC_C_LANGUAGE_STANDARD = gnu17; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = ""; - IPHONEOS_DEPLOYMENT_TARGET = 17.0; - LOCALIZATION_PREFERS_STRING_CATALOGS = YES; - MARKETING_VERSION = 0.7.0; - MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; - MTL_FAST_MATH = YES; - ONLY_ACTIVE_ARCH = YES; - PRODUCT_BUNDLE_IDENTIFIER = "com.tyro.tap-to-pay-sdk-ios.sample-app"; - SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - }; - name = Debug; - }; - 8B76E0DD2B5782520017B455 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - CREATE_INFOPLIST_SECTION_IN_BINARY = YES; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_USER_SCRIPT_SANDBOXING = YES; - GCC_C_LANGUAGE_STANDARD = gnu17; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = ""; - IPHONEOS_DEPLOYMENT_TARGET = 17.0; - LOCALIZATION_PREFERS_STRING_CATALOGS = YES; - MARKETING_VERSION = 0.7.0; - MTL_ENABLE_DEBUG_INFO = NO; - MTL_FAST_MATH = YES; - PRODUCT_BUNDLE_IDENTIFIER = "com.tyro.tap-to-pay-sdk-ios.sample-app"; - SDKROOT = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_VERSION = 5.0; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 8B76E0DF2B5782520017B455 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CODE_SIGN_ENTITLEMENTS = "$(SRCROOT)/$(TARGET_NAME)/$(TARGET_NAME).entitlements"; - CODE_SIGN_IDENTITY = "Apple Development"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = "${CURRENT_PROJECT_VERSION}"; - DEVELOPMENT_ASSET_PATHS = "\"SampleApp/Preview Content\""; - DEVELOPMENT_TEAM = AP4UA2XZ78; - ENABLE_PREVIEWS = YES; - INFOPLIST_FILE = "$(TARGET_NAME)/Supporting Files/Info.plist"; - INFOPLIST_KEY_CFBundleDisplayName = "Tyro Tap to Pay on iPhone Demo"; - INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.reference"; - INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; - INFOPLIST_KEY_UILaunchStoryboardName = ""; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; - INFOPLIST_OUTPUT_FORMAT = XML; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - MARKETING_VERSION = 0.4.0; - PRODUCT_BUNDLE_IDENTIFIER = "$(PRODUCT_BUNDLE_IDENTIFIER)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = ""; - SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; - SUPPORTS_MACCATALYST = NO; - SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; - SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = 1; - }; - name = Debug; - }; - 8B76E0E02B5782520017B455 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CODE_SIGN_ENTITLEMENTS = "$(SRCROOT)/$(TARGET_NAME)/$(TARGET_NAME).entitlements"; - CODE_SIGN_IDENTITY = "Apple Development"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = "${CURRENT_PROJECT_VERSION}"; - DEVELOPMENT_ASSET_PATHS = "\"SampleApp/Preview Content\""; - DEVELOPMENT_TEAM = AP4UA2XZ78; - ENABLE_PREVIEWS = YES; - INFOPLIST_FILE = "$(TARGET_NAME)/Supporting Files/Info.plist"; - INFOPLIST_KEY_CFBundleDisplayName = "Tyro Tap to Pay on iPhone Demo"; - INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.reference"; - INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; - INFOPLIST_KEY_UILaunchStoryboardName = ""; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; - INFOPLIST_OUTPUT_FORMAT = XML; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - MARKETING_VERSION = 0.4.0; - PRODUCT_BUNDLE_IDENTIFIER = "$(PRODUCT_BUNDLE_IDENTIFIER)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = ""; - SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; - SUPPORTS_MACCATALYST = NO; - SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; - SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = 1; - }; - name = Release; - }; - BD1633842B9ACF6A00183BE7 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = AP4UA2XZ78; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.tyro.SampleAppTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SampleApp.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/SampleApp"; - }; - name = Debug; - }; - BD1633852B9ACF6A00183BE7 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = AP4UA2XZ78; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.tyro.SampleAppTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SampleApp.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/SampleApp"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 8B76E0CB2B5782500017B455 /* Build configuration list for PBXProject "SampleApp" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 8B76E0DC2B5782520017B455 /* Debug */, - 8B76E0DD2B5782520017B455 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 8B76E0DE2B5782520017B455 /* Build configuration list for PBXNativeTarget "SampleApp" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 8B76E0DF2B5782520017B455 /* Debug */, - 8B76E0E02B5782520017B455 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - BD1633832B9ACF6A00183BE7 /* Build configuration list for PBXNativeTarget "SampleAppTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - BD1633842B9ACF6A00183BE7 /* Debug */, - BD1633852B9ACF6A00183BE7 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - -/* Begin XCLocalSwiftPackageReference section */ - BD0E77F72BBD21D5008CED1E /* XCLocalSwiftPackageReference ".." */ = { - isa = XCLocalSwiftPackageReference; - relativePath = ..; - }; -/* End XCLocalSwiftPackageReference section */ - -/* Begin XCSwiftPackageProductDependency section */ - BD80AC742BB26225008C4B9C /* TyroTapToPaySDKPackage */ = { - isa = XCSwiftPackageProductDependency; - productName = TyroTapToPaySDKPackage; - }; -/* End XCSwiftPackageProductDependency section */ - }; - rootObject = 8B76E0C82B5782500017B455 /* Project object */; -} diff --git a/SampleApp/SampleApp.xcodeproj/xcshareddata/xcschemes/SampleApp.xcscheme b/SampleApp/SampleApp.xcodeproj/xcshareddata/xcschemes/SampleApp.xcscheme deleted file mode 100644 index ac16cec..0000000 --- a/SampleApp/SampleApp.xcodeproj/xcshareddata/xcschemes/SampleApp.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/SampleApp/SampleApp/POS/DemoConnectionProvider.swift b/SampleApp/SampleApp/POS/DemoConnectionProvider.swift index ccfe0fe..0d71532 100644 --- a/SampleApp/SampleApp/POS/DemoConnectionProvider.swift +++ b/SampleApp/SampleApp/POS/DemoConnectionProvider.swift @@ -11,16 +11,17 @@ import TyroTapToPaySDK // Create an endpoint on your server to generate the connection secret let DEMO_CONNECTION_SECRET_ENDPOINT_URL = "https://api.tyro.com/connect/tap-to-pay/demo/connections" -// Create the reader id and set it here -// Only one reader can be used on one device at any time otherwise transactions will fail -let DEMO_READER_ID = "f310e43b-a6c9-4c43-9535-ff68b2b9c4a1" - final class DemoConnectionProvider: ConnectionProvider { static let timeoutIntervalSeconds: TimeInterval = 10 private let restClient = RestClient() + private var readerId: String + + init(readerId: String) { + self.readerId = readerId + } func createConnection() async throws -> String { - let payload = try JSONEncoder().encode(DemoConnectionRequest(readerId: DEMO_READER_ID)) + let payload = try JSONEncoder().encode(DemoConnectionRequest(readerId: self.readerId)) let response = try await restClient.post( requestUrl: DEMO_CONNECTION_SECRET_ENDPOINT_URL, payload: payload diff --git a/SampleApp/SampleApp/Resources/Localizable.xcstrings b/SampleApp/SampleApp/Resources/Localizable.xcstrings deleted file mode 100644 index f36f23a..0000000 --- a/SampleApp/SampleApp/Resources/Localizable.xcstrings +++ /dev/null @@ -1,76 +0,0 @@ -{ - "sourceLanguage" : "en", - "strings" : { - "" : { - - }, - "Actions" : { - - }, - "Admin" : { - - }, - "ALERT_BTN_OK" : { - "extractionState" : "manual", - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Dismiss" - } - } - } - }, - "Amount" : { - - }, - "APPLICATION_NAME" : { - "extractionState" : "manual", - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Tyro Tap to Pay for iPhone" - } - } - } - }, - "Close" : { - - }, - "email" : { - - }, - "Email" : { - - }, - "Home" : { - - }, - "Outcome: %@" : { - - }, - "Payment" : { - - }, - "Receipt" : { - - }, - "Refund" : { - - }, - "Reset" : { - - }, - "Send receipt" : { - - }, - "Transact" : { - - }, - "Tyro Settings" : { - - } - }, - "version" : "1.0" -} \ No newline at end of file diff --git a/SampleApp/SampleApp/SampleApp.swift b/SampleApp/SampleApp/SampleApp.swift index 3486286..6293bea 100644 --- a/SampleApp/SampleApp/SampleApp.swift +++ b/SampleApp/SampleApp/SampleApp.swift @@ -10,90 +10,96 @@ import TyroTapToPaySDK @main struct SampleApp: App { - var body: some Scene { - WindowGroup { - Home() - .navigationBarHidden(true) - } - } -} + @State var readerId: String? -struct Home : View { - @Environment(\.scenePhase) private var scenePhase: ScenePhase - @ObservedObject var tapToPaySdk: TyroTapToPay - private var contentViewModel: ContentViewModel + var body: some Scene { + WindowGroup { + if readerId != nil { + Home(readerId: readerId!) + .navigationBarHidden(true) + } else { + EnterReaderIdView(onSubmitReaderId: { readerId in + self.readerId = readerId + }) + } + } + } +} - @State private var isSettingsPresented = false +struct Home: View { + @Environment(\.scenePhase) private var scenePhase: ScenePhase + @ObservedObject var tapToPaySdk: TyroTapToPay + private var contentViewModel: ContentViewModel - @State private var selectedIndex: Int = 0; + @State private var isSettingsPresented = false + @State private var selectedIndex: Int = 0 - init() { - do { - let tapToPaySdk = try TyroTapToPay( - environment: .sandbox, - connectionProvider: DemoConnectionProvider() - ) - contentViewModel = ContentViewModel(tapToPaySdk: tapToPaySdk) - self.tapToPaySdk = tapToPaySdk - } catch { - fatalError(error.localizedDescription) - } - } + init(readerId: String) { + do { + let tapToPaySdk = try TyroTapToPay( + environment: .sandbox, + connectionProvider: DemoConnectionProvider(readerId: readerId) + ) + contentViewModel = ContentViewModel(tapToPaySdk: tapToPaySdk) + self.tapToPaySdk = tapToPaySdk + } catch { + fatalError(error.localizedDescription) + } + } - var body: some View { - TabView(selection: $selectedIndex) { - NavigationStack { - VStack { - HStack { - Spacer(minLength: 0) - Image(.tyroLogo) - .resizable() - .aspectRatio(contentMode: .fit) - .frame(maxWidth: 100) - .padding() - Spacer(minLength: 0) - Button(action: { - isSettingsPresented.toggle() - }) { - Image(systemName: "gear") - .renderingMode(.template) - .resizable() - .frame(width: 25, height: 25) + var body: some View { + TabView(selection: $selectedIndex) { + NavigationStack { + VStack { + HStack { + Spacer(minLength: 0) + Image(.tyroLogo) + .resizable() + .aspectRatio(contentMode: .fit) + .frame(maxWidth: 100) + .padding() + Spacer(minLength: 0) + Button(action: { + isSettingsPresented.toggle() + }) { + Image(systemName: "gear") + .renderingMode(.template) + .resizable() + .frame(width: 25, height: 25) + }.fullScreenCover(isPresented: $isSettingsPresented) { + TyroSettingsViewWrapper() + } + }.padding() + ContentView(viewModel: contentViewModel) + }.navigationTitle("") + }.tabItem { + Label("Home", systemImage: "house") + }.tag(0) - }.fullScreenCover(isPresented: $isSettingsPresented) { - TyroSettingsViewWrapper() - } - }.padding() - ContentView(viewModel: contentViewModel) - }.navigationTitle("") - }.tabItem { - Label("Home", systemImage: "house") - }.tag(0) - - NavigationStack { - TyroSettingsView().navigationTitle("Tyro Settings") - }.tabItem { - Label("Admin", systemImage: "gear") - }.tag(1) - } - } + NavigationStack { + TyroSettingsView().navigationTitle("Tyro Settings") + }.tabItem { + Label("Admin", systemImage: "gear") + }.tag(1) + } + } } struct TyroSettingsViewWrapper: View { - @Environment(\.dismiss) var dismiss - var body: some View { - NavigationStack { - ZStack { - TyroSettingsView() - }.toolbar(content: { - Button { - dismiss() - } label: { - Image(systemName: "xmark") - } - }) - } - } + @Environment(\.dismiss) var dismiss + var body: some View { + NavigationStack { + ZStack { + TyroSettingsView() + }.toolbar(content: { + Button { + dismiss() + } label: { + Image(systemName: "xmark") + } + }) + } + } } extension TyroTapToPay: ObservableObject { diff --git a/SampleApp/SampleApp/ViewModels/ContentViewModel.swift b/SampleApp/SampleApp/ViewModels/ContentViewModel.swift index 7501cfe..f9a7780 100644 --- a/SampleApp/SampleApp/ViewModels/ContentViewModel.swift +++ b/SampleApp/SampleApp/ViewModels/ContentViewModel.swift @@ -5,9 +5,9 @@ // Created by Sanjay Narayana on 2/5/2024. // +import Combine import Foundation import TyroTapToPaySDK -import Combine class ContentViewModel: ObservableObject { @Published var state: LoadingState = .loading("Loading...") @@ -32,11 +32,11 @@ class ContentViewModel: ObservableObject { switch event { case .updateStarted: self.state = .loading("Reader update started") - case .updateInProgress(progress: let progress): + case .updateInProgress(let progress): self.state = .loading("Updating reader: \(progress)%") case .updateCompleted: self.state = .loading("Reader update complete") - case .updateFailed(error: let error): + case .updateFailed(let error): self.state = .error("Reader update failed: \(error)") @unknown default: self.state = .loading("Unknown reader update event: \(event)") @@ -63,9 +63,10 @@ class ContentViewModel: ObservableObject { } catch TapToPaySDKError.fetchSdkDataError(let errorMessage) { self.state = .error("fetchSdkDataError: \(errorMessage)") } catch TapToPaySDKError.noProximityReaderFound { - self.state = .error("noProximityReaderFound" + - "\n\n" + - "Please ensure you are using an iPhone with Tap to Pay on iPhone hardware capability (iPhone XS or above)") + self.state = .error( + "noProximityReaderFound" + "\n\n" + + "Please ensure you are using an iPhone with Tap to Pay on iPhone hardware capability (iPhone XS or above)" + ) } catch { self.state = .error(error.localizedDescription) } diff --git a/SampleApp/SampleApp/Views/EnterReaderIdView.swift b/SampleApp/SampleApp/Views/EnterReaderIdView.swift new file mode 100644 index 0000000..f6bbb18 --- /dev/null +++ b/SampleApp/SampleApp/Views/EnterReaderIdView.swift @@ -0,0 +1,133 @@ +// +// EnterReaderIdView.swift +// Tyro Embedded Sample App +// +// Created by Sanjay Narayana on 2/7/2024. +// + +import Foundation +import SwiftUI + +struct EnterReaderIdView: View { + @State private var viewModel: ViewModel + @FocusState private var isFocused: Bool + var onSubmitReaderId: (_ readerId: String) -> Void + + init(onSubmitReaderId: @escaping (_: String) -> Void) { + self.viewModel = ViewModel() + self.onSubmitReaderId = onSubmitReaderId + } + + var body: some View { + Text("Enter your Reader ID below") + Form { + Section(header: Text("Reader id")) { + VStack { + TextField("", text: $viewModel.readerId) + .focused($isFocused) + .autocapitalization(.none) + .onAppear { + DispatchQueue.main.asyncAfter(deadline: .now() + 0.01) { + self.isFocused = true + } + } + } + } + Section { + ForEach(viewModel.savedReaders.reversed(), id: \.self) { readerId in + Button { + viewModel.selectReader(selectedReaderId: readerId) + } label: { + HStack { + Image(systemName: "clock") + Text(readerId) + .scaledToFit() + } + } + .font(.subheadline) + .foregroundColor(.gray) + } + + if viewModel.savedReaders.count > 0 { + Button { + viewModel.clearSavedReaders() + } label: { + Text("Clear saved readers") + .frame(maxWidth: .infinity, minHeight: 30) + .font(.subheadline) + } + .padding(.horizontal) + .buttonStyle(.plain) + } + } + } + + Button { + if viewModel.isValidReaderId() { + isFocused = false + viewModel.saveReader() + self.onSubmitReaderId(viewModel.readerId) + } + } label: { + Text("Confirm") + .frame(maxWidth: .infinity, minHeight: 40) + .font(.title2) + .ignoresSafeArea() + } + .padding() + .buttonStyle(.borderedProminent) + .disabled(!viewModel.isValidReaderId()) + } +} + +extension EnterReaderIdView { + @Observable + class ViewModel: ObservableObject { + let SAVED_READERS_KEY = "tyro-reader-ids" + var savedReaders: [String] = [] + var readerId: String = "" + var isPresented: Bool = false + + init() { + savedReaders = + UserDefaults.standard.object(forKey: SAVED_READERS_KEY) as? [String] ?? [String]() + if savedReaders.count > 0 { + readerId = savedReaders.last ?? "" + } + } + + func isValidReaderId() -> Bool { + return readerId.count > 0 + } + + func saveReader() { + var readersToSave = savedReaders + readersToSave.append(readerId) + readersToSave = readersToSave.unique() + UserDefaults.standard.set(readersToSave, forKey: SAVED_READERS_KEY) + savedReaders = readersToSave + } + + func selectReader(selectedReaderId: String) { + self.readerId = selectedReaderId + } + + func clearSavedReaders() { + savedReaders = [] + UserDefaults.standard.set([], forKey: SAVED_READERS_KEY) + } + } +} + +extension Sequence where Iterator.Element: Hashable { + func unique() -> [Iterator.Element] { + var visited: Set = [] + return filter { visited.insert($0).inserted } + } +} + +#Preview { + EnterReaderIdView(onSubmitReaderId: { + print($0) + }) +} diff --git a/SampleApp/Tyro Embedded Sample App.xcodeproj/project.pbxproj b/SampleApp/Tyro Embedded Sample App.xcodeproj/project.pbxproj new file mode 100644 index 0000000..3efa5b4 --- /dev/null +++ b/SampleApp/Tyro Embedded Sample App.xcodeproj/project.pbxproj @@ -0,0 +1,509 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 56; + objects = { + +/* Begin PBXBuildFile section */ + 6395409C2C251191004D6C9A /* TyroTapToPaySDKPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 6395409B2C251191004D6C9A /* TyroTapToPaySDKPackage */; }; + 639540B02C25485E004D6C9A /* ContentViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6395409E2C25485E004D6C9A /* ContentViewModel.swift */; }; + 639540B12C25485E004D6C9A /* CloseButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 639540A02C25485E004D6C9A /* CloseButton.swift */; }; + 639540B22C25485E004D6C9A /* ResetButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 639540A12C25485E004D6C9A /* ResetButton.swift */; }; + 639540B32C25485E004D6C9A /* DemoConnectionProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 639540A32C25485E004D6C9A /* DemoConnectionProvider.swift */; }; + 639540B42C25485E004D6C9A /* RestClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = 639540A42C25485E004D6C9A /* RestClient.swift */; }; + 639540B52C25485E004D6C9A /* TransactionType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 639540A62C25485E004D6C9A /* TransactionType.swift */; }; + 639540B62C25485E004D6C9A /* PaymentFormView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 639540A82C25485E004D6C9A /* PaymentFormView.swift */; }; + 639540B72C25485E004D6C9A /* TransactionOutcomeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 639540A92C25485E004D6C9A /* TransactionOutcomeView.swift */; }; + 639540B82C25485E004D6C9A /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 639540AB2C25485E004D6C9A /* ContentView.swift */; }; + 639540B92C25485E004D6C9A /* ErrorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 639540AC2C25485E004D6C9A /* ErrorView.swift */; }; + 639540BA2C25485E004D6C9A /* config_uat.env in Resources */ = {isa = PBXBuildFile; fileRef = 639540AE2C25485E004D6C9A /* config_uat.env */; }; + 63A8602C2C3395FF0027053B /* EnterReaderIdView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63A8602B2C3395FF0027053B /* EnterReaderIdView.swift */; }; + 63A860312C339AAE0027053B /* Tyro-Embedded-Sample-App-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 63A860302C339AAE0027053B /* Tyro-Embedded-Sample-App-Info.plist */; }; + 63B6C0202C2505FF001FCC3C /* SampleApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63B6C01F2C2505FF001FCC3C /* SampleApp.swift */; }; + 63B6C0242C250601001FCC3C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 63B6C0232C250601001FCC3C /* Assets.xcassets */; }; + 63B6C0282C250601001FCC3C /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 63B6C0272C250601001FCC3C /* Preview Assets.xcassets */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 6395409E2C25485E004D6C9A /* ContentViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContentViewModel.swift; sourceTree = ""; }; + 639540A02C25485E004D6C9A /* CloseButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CloseButton.swift; sourceTree = ""; }; + 639540A12C25485E004D6C9A /* ResetButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ResetButton.swift; sourceTree = ""; }; + 639540A32C25485E004D6C9A /* DemoConnectionProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DemoConnectionProvider.swift; sourceTree = ""; }; + 639540A42C25485E004D6C9A /* RestClient.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RestClient.swift; sourceTree = ""; }; + 639540A62C25485E004D6C9A /* TransactionType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransactionType.swift; sourceTree = ""; }; + 639540A82C25485E004D6C9A /* PaymentFormView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PaymentFormView.swift; sourceTree = ""; }; + 639540A92C25485E004D6C9A /* TransactionOutcomeView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransactionOutcomeView.swift; sourceTree = ""; }; + 639540AB2C25485E004D6C9A /* ContentView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 639540AC2C25485E004D6C9A /* ErrorView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ErrorView.swift; sourceTree = ""; }; + 639540AE2C25485E004D6C9A /* config_uat.env */ = {isa = PBXFileReference; lastKnownFileType = file; path = config_uat.env; sourceTree = ""; }; + 639540AF2C25485E004D6C9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 63A8602B2C3395FF0027053B /* EnterReaderIdView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnterReaderIdView.swift; sourceTree = ""; }; + 63A860302C339AAE0027053B /* Tyro-Embedded-Sample-App-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Tyro-Embedded-Sample-App-Info.plist"; sourceTree = ""; }; + 63B6C01C2C2505FF001FCC3C /* Tyro Embedded Sample App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Tyro Embedded Sample App.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 63B6C01F2C2505FF001FCC3C /* SampleApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleApp.swift; sourceTree = ""; }; + 63B6C0232C250601001FCC3C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 63B6C0252C250601001FCC3C /* SampleApp.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = SampleApp.entitlements; sourceTree = ""; }; + 63B6C0272C250601001FCC3C /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 63B6C0192C2505FF001FCC3C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 6395409C2C251191004D6C9A /* TyroTapToPaySDKPackage in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 6395409D2C25485E004D6C9A /* ViewModels */ = { + isa = PBXGroup; + children = ( + 6395409E2C25485E004D6C9A /* ContentViewModel.swift */, + ); + path = ViewModels; + sourceTree = ""; + }; + 6395409F2C25485E004D6C9A /* Components */ = { + isa = PBXGroup; + children = ( + 639540A02C25485E004D6C9A /* CloseButton.swift */, + 639540A12C25485E004D6C9A /* ResetButton.swift */, + ); + path = Components; + sourceTree = ""; + }; + 639540A22C25485E004D6C9A /* POS */ = { + isa = PBXGroup; + children = ( + 639540A32C25485E004D6C9A /* DemoConnectionProvider.swift */, + 639540A42C25485E004D6C9A /* RestClient.swift */, + ); + path = POS; + sourceTree = ""; + }; + 639540A52C25485E004D6C9A /* Types */ = { + isa = PBXGroup; + children = ( + 639540A62C25485E004D6C9A /* TransactionType.swift */, + ); + path = Types; + sourceTree = ""; + }; + 639540A72C25485E004D6C9A /* Views */ = { + isa = PBXGroup; + children = ( + 639540A82C25485E004D6C9A /* PaymentFormView.swift */, + 63A8602B2C3395FF0027053B /* EnterReaderIdView.swift */, + 639540A92C25485E004D6C9A /* TransactionOutcomeView.swift */, + 639540AB2C25485E004D6C9A /* ContentView.swift */, + 639540AC2C25485E004D6C9A /* ErrorView.swift */, + ); + path = Views; + sourceTree = ""; + }; + 639540AD2C25485E004D6C9A /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 639540AE2C25485E004D6C9A /* config_uat.env */, + 639540AF2C25485E004D6C9A /* Info.plist */, + ); + path = "Supporting Files"; + sourceTree = ""; + }; + 639540BC2C254B2B004D6C9A /* Resources */ = { + isa = PBXGroup; + children = ( + 63B6C0232C250601001FCC3C /* Assets.xcassets */, + ); + path = Resources; + sourceTree = ""; + }; + 63B6C0132C2505FF001FCC3C = { + isa = PBXGroup; + children = ( + 63B6C01E2C2505FF001FCC3C /* SampleApp */, + 63B6C01D2C2505FF001FCC3C /* Products */, + ); + sourceTree = ""; + }; + 63B6C01D2C2505FF001FCC3C /* Products */ = { + isa = PBXGroup; + children = ( + 63B6C01C2C2505FF001FCC3C /* Tyro Embedded Sample App.app */, + ); + name = Products; + sourceTree = ""; + }; + 63B6C01E2C2505FF001FCC3C /* SampleApp */ = { + isa = PBXGroup; + children = ( + 6395409F2C25485E004D6C9A /* Components */, + 639540A22C25485E004D6C9A /* POS */, + 639540AD2C25485E004D6C9A /* Supporting Files */, + 639540A52C25485E004D6C9A /* Types */, + 6395409D2C25485E004D6C9A /* ViewModels */, + 639540A72C25485E004D6C9A /* Views */, + 63B6C0262C250601001FCC3C /* Preview Content */, + 639540BC2C254B2B004D6C9A /* Resources */, + 63A860302C339AAE0027053B /* Tyro-Embedded-Sample-App-Info.plist */, + 63B6C0252C250601001FCC3C /* SampleApp.entitlements */, + 63B6C01F2C2505FF001FCC3C /* SampleApp.swift */, + ); + path = SampleApp; + sourceTree = ""; + }; + 63B6C0262C250601001FCC3C /* Preview Content */ = { + isa = PBXGroup; + children = ( + 63B6C0272C250601001FCC3C /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 63B6C01B2C2505FF001FCC3C /* Tyro Embedded Sample App */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63B6C02B2C250601001FCC3C /* Build configuration list for PBXNativeTarget "Tyro Embedded Sample App" */; + buildPhases = ( + 63B6C0182C2505FF001FCC3C /* Sources */, + 63B6C0192C2505FF001FCC3C /* Frameworks */, + 63B6C01A2C2505FF001FCC3C /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Tyro Embedded Sample App"; + packageProductDependencies = ( + 6395409B2C251191004D6C9A /* TyroTapToPaySDKPackage */, + ); + productName = SampleApp; + productReference = 63B6C01C2C2505FF001FCC3C /* Tyro Embedded Sample App.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 63B6C0142C2505FF001FCC3C /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1510; + LastUpgradeCheck = 1510; + TargetAttributes = { + 63B6C01B2C2505FF001FCC3C = { + CreatedOnToolsVersion = 15.1; + }; + }; + }; + buildConfigurationList = 63B6C0172C2505FF001FCC3C /* Build configuration list for PBXProject "Tyro Embedded Sample App" */; + compatibilityVersion = "Xcode 14.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 63B6C0132C2505FF001FCC3C; + packageReferences = ( + 6395409A2C251191004D6C9A /* XCRemoteSwiftPackageReference "tyro-tap-to-pay-sdk-ios" */, + ); + productRefGroup = 63B6C01D2C2505FF001FCC3C /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 63B6C01B2C2505FF001FCC3C /* Tyro Embedded Sample App */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 63B6C01A2C2505FF001FCC3C /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 63A860312C339AAE0027053B /* Tyro-Embedded-Sample-App-Info.plist in Resources */, + 639540BA2C25485E004D6C9A /* config_uat.env in Resources */, + 63B6C0282C250601001FCC3C /* Preview Assets.xcassets in Resources */, + 63B6C0242C250601001FCC3C /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 63B6C0182C2505FF001FCC3C /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 639540B62C25485E004D6C9A /* PaymentFormView.swift in Sources */, + 639540B82C25485E004D6C9A /* ContentView.swift in Sources */, + 639540B52C25485E004D6C9A /* TransactionType.swift in Sources */, + 639540B72C25485E004D6C9A /* TransactionOutcomeView.swift in Sources */, + 639540B22C25485E004D6C9A /* ResetButton.swift in Sources */, + 63B6C0202C2505FF001FCC3C /* SampleApp.swift in Sources */, + 639540B92C25485E004D6C9A /* ErrorView.swift in Sources */, + 639540B32C25485E004D6C9A /* DemoConnectionProvider.swift in Sources */, + 639540B12C25485E004D6C9A /* CloseButton.swift in Sources */, + 639540B42C25485E004D6C9A /* RestClient.swift in Sources */, + 639540B02C25485E004D6C9A /* ContentViewModel.swift in Sources */, + 63A8602C2C3395FF0027053B /* EnterReaderIdView.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 63B6C0292C250601001FCC3C /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 63B6C02A2C250601001FCC3C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SWIFT_COMPILATION_MODE = wholemodule; + }; + name = Release; + }; + 63B6C02C2C250601001FCC3C /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = SampleApp/SampleApp.entitlements; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"SampleApp/Preview Content\""; + DEVELOPMENT_TEAM = AP4UA2XZ78; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_CFBundleDisplayName = "Tyro Tap to Pay on iPhone Demo"; + INFOPLIST_KEY_LSApplicationCategoryType = ""; + INFOPLIST_KEY_NSBluetoothAlwaysUsageDescription = "Bluetooth usage"; + INFOPLIST_KEY_NSCameraUsageDescription = "Camera usage"; + INFOPLIST_KEY_NSLocationAlwaysAndWhenInUseUsageDescription = "Location usage"; + INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "Location usage"; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphoneos*]" = UIStatusBarStyleDefault; + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 17.2; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 14.2; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "com.tyro.tap-to-pay-sdk-ios.sample-app"; + PRODUCT_NAME = "Tyro Embedded Sample App"; + SDKROOT = auto; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 1; + }; + name = Debug; + }; + 63B6C02D2C250601001FCC3C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = SampleApp/SampleApp.entitlements; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"SampleApp/Preview Content\""; + DEVELOPMENT_TEAM = AP4UA2XZ78; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_CFBundleDisplayName = "Tyro Tap to Pay on iPhone Demo"; + INFOPLIST_KEY_LSApplicationCategoryType = ""; + INFOPLIST_KEY_NSBluetoothAlwaysUsageDescription = "Bluetooth usage"; + INFOPLIST_KEY_NSCameraUsageDescription = "Camera usage"; + INFOPLIST_KEY_NSLocationAlwaysAndWhenInUseUsageDescription = "Location usage"; + INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "Location usage"; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphoneos*]" = UIStatusBarStyleDefault; + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 17.2; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 14.2; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "com.tyro.tap-to-pay-sdk-ios.sample-app"; + PRODUCT_NAME = "Tyro Embedded Sample App"; + SDKROOT = auto; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 1; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 63B6C0172C2505FF001FCC3C /* Build configuration list for PBXProject "Tyro Embedded Sample App" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63B6C0292C250601001FCC3C /* Debug */, + 63B6C02A2C250601001FCC3C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63B6C02B2C250601001FCC3C /* Build configuration list for PBXNativeTarget "Tyro Embedded Sample App" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63B6C02C2C250601001FCC3C /* Debug */, + 63B6C02D2C250601001FCC3C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + +/* Begin XCRemoteSwiftPackageReference section */ + 6395409A2C251191004D6C9A /* XCRemoteSwiftPackageReference "tyro-tap-to-pay-sdk-ios" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/tyro/tyro-tap-to-pay-sdk-ios"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 0.15.1; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 6395409B2C251191004D6C9A /* TyroTapToPaySDKPackage */ = { + isa = XCSwiftPackageProductDependency; + package = 6395409A2C251191004D6C9A /* XCRemoteSwiftPackageReference "tyro-tap-to-pay-sdk-ios" */; + productName = TyroTapToPaySDKPackage; + }; +/* End XCSwiftPackageProductDependency section */ + }; + rootObject = 63B6C0142C2505FF001FCC3C /* Project object */; +} diff --git a/SampleApp/SampleApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/SampleApp/Tyro Embedded Sample App.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from SampleApp/SampleApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to SampleApp/Tyro Embedded Sample App.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/SampleApp/SampleApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/SampleApp/Tyro Embedded Sample App.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from SampleApp/SampleApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to SampleApp/Tyro Embedded Sample App.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/Tests/TyroTapToPaySDKTests/TyroTapToPaySDKTests.swift b/Tests/TyroTapToPaySDKTests/TyroTapToPaySDKTests.swift index 84f0a49..048ba94 100644 --- a/Tests/TyroTapToPaySDKTests/TyroTapToPaySDKTests.swift +++ b/Tests/TyroTapToPaySDKTests/TyroTapToPaySDKTests.swift @@ -1,11 +1,12 @@ import XCTest + @testable import TyroTapToPaySDK final class TyroTapToPaySDKPackageTests: XCTestCase { func testExample() throws { // XCTest Documentation // https://developer.apple.com/documentation/xctest - + // Defining Test Cases and Test Methods // https://developer.apple.com/documentation/xctest/defining_test_cases_and_test_methods }