From dfa0b963f3d72f9e7baaa0566478497c9b9b4807 Mon Sep 17 00:00:00 2001 From: Vikas Chandra Date: Wed, 3 Jun 2020 11:27:02 +0530 Subject: [PATCH] - Bug fixes and improvements. - Updated App version to 2.0.1. --- .gitignore | 2 +- .../ESPRainMaker.xcodeproj/project.pbxproj | 65 +++-- .../AWSCognito/DeviceAssociation.swift | 30 ++- .../ESPRainMaker/Base.lproj/Login.storyboard | 51 ++-- .../ESPRainMaker/Base.lproj/Main.storyboard | 123 +++++----- .../ESPRainMaker-Bridging-Header.h | 1 + .../Interface/DocumentViewController.swift | 24 ++ .../Node Addition/ClaimViewController.swift | 2 +- .../ProvisionViewController.swift | 24 +- .../Node Addition/SuccessViewController.swift | 47 +++- .../Settings/SettingsPageViewController.swift | 2 +- .../SignInViewController.swift | 10 +- .../ESPRainMaker/Models/Attribute.swift | 29 +-- ESPRainMaker/ESPRainMaker/Models/Device.swift | 6 +- .../ESPRainMaker/Resources/GitVersion.h | 10 + .../zh-Hans.lproj/Localizable.strings | 7 - .../ESPRainMaker/Utilities/Errors.swift | 2 +- .../ESPRainMaker/Utilities/JSONParser.swift | 10 +- .../zh-Hans.lproj/DeviceDetail.strings | 51 ---- .../zh-Hans.lproj/LaunchScreen.strings | 1 - .../ESPRainMaker/zh-Hans.lproj/Login.strings | 114 --------- .../ESPRainMaker/zh-Hans.lproj/Main.strings | 222 ------------------ ESPRainMaker/Podfile | 6 +- 23 files changed, 266 insertions(+), 573 deletions(-) create mode 100644 ESPRainMaker/ESPRainMaker/Resources/GitVersion.h delete mode 100644 ESPRainMaker/ESPRainMaker/Resources/zh-Hans.lproj/Localizable.strings delete mode 100644 ESPRainMaker/ESPRainMaker/zh-Hans.lproj/DeviceDetail.strings delete mode 100644 ESPRainMaker/ESPRainMaker/zh-Hans.lproj/LaunchScreen.strings delete mode 100644 ESPRainMaker/ESPRainMaker/zh-Hans.lproj/Login.strings delete mode 100644 ESPRainMaker/ESPRainMaker/zh-Hans.lproj/Main.strings diff --git a/.gitignore b/.gitignore index 1dc8a3e2..935195db 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -ESPRainMaker/Pods +ESPRainMaker/Pods \ No newline at end of file diff --git a/ESPRainMaker/ESPRainMaker.xcodeproj/project.pbxproj b/ESPRainMaker/ESPRainMaker.xcodeproj/project.pbxproj index 6ebff865..4987021a 100644 --- a/ESPRainMaker/ESPRainMaker.xcodeproj/project.pbxproj +++ b/ESPRainMaker/ESPRainMaker.xcodeproj/project.pbxproj @@ -16,7 +16,7 @@ 143146B320EB22470017E119 /* ProvisionLandingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 143146B220EB22470017E119 /* ProvisionLandingViewController.swift */; }; 143146B520EB273B0017E119 /* ProvisionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 143146B420EB273B0017E119 /* ProvisionViewController.swift */; }; 144149442126AE09002AD5E1 /* SuccessViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 144149432126AE09002AD5E1 /* SuccessViewController.swift */; }; - B4BE2B3E72314E6C6D880118 /* Pods_ESPRainMakerAll_ESPRainMaker.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EFF4DFAD84E92C7176CD848B /* Pods_ESPRainMakerAll_ESPRainMaker.framework */; }; + 2145B87F01D00671F6028FCC /* Pods_ESPRainMaker.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0E78E823824B7739458B5136 /* Pods_ESPRainMaker.framework */; }; F1153F2A238E5E79009DF206 /* NetworkExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F1153F29238E5E79009DF206 /* NetworkExtension.framework */; }; F12261A022C61695004D049F /* DeviceAssociation.swift in Sources */ = {isa = PBXBuildFile; fileRef = F122619F22C61695004D049F /* DeviceAssociation.swift */; }; F12261A422C620ED004D049F /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = F12261A322C620ED004D049F /* User.swift */; }; @@ -90,6 +90,7 @@ /* Begin PBXFileReference section */ 0030BB08B79C9179217947A2 /* Pods-ESPRainMakerAll-ESPRainMakerTests.esprainmaker-release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ESPRainMakerAll-ESPRainMakerTests.esprainmaker-release.xcconfig"; path = "Target Support Files/Pods-ESPRainMakerAll-ESPRainMakerTests/Pods-ESPRainMakerAll-ESPRainMakerTests.esprainmaker-release.xcconfig"; sourceTree = ""; }; 07A32FA757DF690EF6657C35 /* Pods_ESPRainMakerAll_ESPRainMakerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ESPRainMakerAll_ESPRainMakerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 0E78E823824B7739458B5136 /* Pods_ESPRainMaker.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ESPRainMaker.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 1431462320DE994B0017E119 /* ESP RainMaker.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ESP RainMaker.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 1431462620DE994B0017E119 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 1431462B20DE994B0017E119 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; @@ -101,10 +102,11 @@ 143146B220EB22470017E119 /* ProvisionLandingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProvisionLandingViewController.swift; sourceTree = ""; }; 143146B420EB273B0017E119 /* ProvisionViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProvisionViewController.swift; sourceTree = ""; }; 144149432126AE09002AD5E1 /* SuccessViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SuccessViewController.swift; sourceTree = ""; }; + 187D4B6FA979D2D3D8B7C631 /* Pods-ESPRainMaker.esprainmaker-release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ESPRainMaker.esprainmaker-release.xcconfig"; path = "Target Support Files/Pods-ESPRainMaker/Pods-ESPRainMaker.esprainmaker-release.xcconfig"; sourceTree = ""; }; + 20EAA68DBEE10B9B45CB7E5B /* Pods-ESPRainMaker.esprainmaker-debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ESPRainMaker.esprainmaker-debug.xcconfig"; path = "Target Support Files/Pods-ESPRainMaker/Pods-ESPRainMaker.esprainmaker-debug.xcconfig"; sourceTree = ""; }; B8808920A07C54C0975F1844 /* Pods-ESPRainMakerAll-ESPRainMakerTests.esprainmaker-debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ESPRainMakerAll-ESPRainMakerTests.esprainmaker-debug.xcconfig"; path = "Target Support Files/Pods-ESPRainMakerAll-ESPRainMakerTests/Pods-ESPRainMakerAll-ESPRainMakerTests.esprainmaker-debug.xcconfig"; sourceTree = ""; }; BEE7825EF97282B6DCBD38F8 /* Pods-ESPRainMakerAll-ESPRainMaker.esprainmaker-release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ESPRainMakerAll-ESPRainMaker.esprainmaker-release.xcconfig"; path = "Target Support Files/Pods-ESPRainMakerAll-ESPRainMaker/Pods-ESPRainMakerAll-ESPRainMaker.esprainmaker-release.xcconfig"; sourceTree = ""; }; EF8004A653E60197A67C5A7F /* Pods-ESPRainMakerAll-ESPRainMaker.esprainmaker-debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ESPRainMakerAll-ESPRainMaker.esprainmaker-debug.xcconfig"; path = "Target Support Files/Pods-ESPRainMakerAll-ESPRainMaker/Pods-ESPRainMakerAll-ESPRainMaker.esprainmaker-debug.xcconfig"; sourceTree = ""; }; - EFF4DFAD84E92C7176CD848B /* Pods_ESPRainMakerAll_ESPRainMaker.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ESPRainMakerAll_ESPRainMaker.framework; sourceTree = BUILT_PRODUCTS_DIR; }; F1153F29238E5E79009DF206 /* NetworkExtension.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NetworkExtension.framework; path = System/Library/Frameworks/NetworkExtension.framework; sourceTree = SDKROOT; }; F122619F22C61695004D049F /* DeviceAssociation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceAssociation.swift; sourceTree = ""; }; F12261A322C620ED004D049F /* User.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; @@ -120,14 +122,9 @@ F151FF1924826E00006F514E /* AWSCognitoIdentityProviderASF.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = AWSCognitoIdentityProviderASF.framework; sourceTree = BUILT_PRODUCTS_DIR; }; F151FF1D24827343006F514E /* WifiListTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WifiListTableViewCell.swift; sourceTree = ""; }; F15EABF323E043DA008A766B /* CustomUIElements.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomUIElements.swift; sourceTree = ""; }; - F15EABFD23E05A16008A766B /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Main.strings"; sourceTree = ""; }; - F15EABFE23E05A16008A766B /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/LaunchScreen.strings"; sourceTree = ""; }; - F15EAC0023E05A51008A766B /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = ""; }; F15EAC0223E05A59008A766B /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; F15EAC0B23E198FF008A766B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Login.storyboard; sourceTree = ""; }; - F15EAC0E23E19909008A766B /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Login.strings"; sourceTree = ""; }; F15EAC1023E1994E008A766B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/DeviceDetail.storyboard; sourceTree = ""; }; - F15EAC1323E19976008A766B /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/DeviceDetail.strings"; sourceTree = ""; }; F15FFF872402643A00E72D01 /* NoInternetConnection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NoInternetConnection.swift; sourceTree = ""; }; F15FFF892402645200E72D01 /* NoInternetConnection.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = NoInternetConnection.xib; sourceTree = ""; }; F17581782418D1F400FF7407 /* amazonRootCA.der */ = {isa = PBXFileReference; lastKnownFileType = file; path = amazonRootCA.der; sourceTree = ""; }; @@ -150,6 +147,7 @@ F1AB511A23321B7E002401F9 /* JSONParser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONParser.swift; sourceTree = ""; }; F1B13AD723D85125006DD949 /* ChangePasswordViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChangePasswordViewController.swift; sourceTree = ""; }; F1B3558823B8DC4C004552FC /* ExtensionManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExtensionManager.swift; sourceTree = ""; }; + F1C77F1124911FD4000CE2FE /* GitVersion.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GitVersion.h; sourceTree = ""; }; F1C8082B22CA17790098F3B4 /* NetworkManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkManager.swift; sourceTree = ""; }; F1CB6085233B549F0001D509 /* BLEDeviceListViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BLEDeviceListViewCell.swift; sourceTree = ""; }; F1DB6F61232FA6CB004B1FA1 /* DevicesCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DevicesCollectionViewCell.swift; sourceTree = ""; }; @@ -192,7 +190,7 @@ 143146A520EA231B0017E119 /* SafariServices.framework in Frameworks */, F1153F2A238E5E79009DF206 /* NetworkExtension.framework in Frameworks */, 143146A320EA23150017E119 /* Security.framework in Frameworks */, - B4BE2B3E72314E6C6D880118 /* Pods_ESPRainMakerAll_ESPRainMaker.framework in Frameworks */, + 2145B87F01D00671F6028FCC /* Pods_ESPRainMaker.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -272,6 +270,8 @@ EF8004A653E60197A67C5A7F /* Pods-ESPRainMakerAll-ESPRainMaker.esprainmaker-debug.xcconfig */, 0030BB08B79C9179217947A2 /* Pods-ESPRainMakerAll-ESPRainMakerTests.esprainmaker-release.xcconfig */, B8808920A07C54C0975F1844 /* Pods-ESPRainMakerAll-ESPRainMakerTests.esprainmaker-debug.xcconfig */, + 187D4B6FA979D2D3D8B7C631 /* Pods-ESPRainMaker.esprainmaker-release.xcconfig */, + 20EAA68DBEE10B9B45CB7E5B /* Pods-ESPRainMaker.esprainmaker-debug.xcconfig */, ); path = Pods; sourceTree = ""; @@ -284,8 +284,8 @@ F1153F29238E5E79009DF206 /* NetworkExtension.framework */, 143146A420EA231B0017E119 /* SafariServices.framework */, 143146A220EA23150017E119 /* Security.framework */, - EFF4DFAD84E92C7176CD848B /* Pods_ESPRainMakerAll_ESPRainMaker.framework */, 07A32FA757DF690EF6657C35 /* Pods_ESPRainMakerAll_ESPRainMakerTests.framework */, + 0E78E823824B7739458B5136 /* Pods_ESPRainMaker.framework */, ); name = Frameworks; sourceTree = ""; @@ -436,6 +436,7 @@ isa = PBXGroup; children = ( F15EAC0123E05A51008A766B /* Localizable.strings */, + F1C77F1124911FD4000CE2FE /* GitVersion.h */, ); path = Resources; sourceTree = ""; @@ -475,6 +476,7 @@ 1431462120DE994B0017E119 /* Resources */, 1487EBE92123D8C4007F44A6 /* Format code */, BD0440008F6752DCBA91CC73 /* [CP] Embed Pods Frameworks */, + F1C77F0D2486DC91000CE2FE /* ShellScript */, ); buildRules = ( ); @@ -513,7 +515,6 @@ knownRegions = ( en, Base, - "zh-Hans", ); mainGroup = 1431461A20DE994B0017E119; productRefGroup = 1431462420DE994B0017E119 /* Products */; @@ -580,7 +581,7 @@ outputFileListPaths = ( ); outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-ESPRainMakerAll-ESPRainMaker-checkManifestLockResult.txt", + "$(DERIVED_FILE_DIR)/Pods-ESPRainMaker-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -593,17 +594,34 @@ files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-ESPRainMakerAll-ESPRainMaker/Pods-ESPRainMakerAll-ESPRainMaker-frameworks-${CONFIGURATION}-input-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-ESPRainMaker/Pods-ESPRainMaker-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-ESPRainMakerAll-ESPRainMaker/Pods-ESPRainMakerAll-ESPRainMaker-frameworks-${CONFIGURATION}-output-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-ESPRainMaker/Pods-ESPRainMaker-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ESPRainMakerAll-ESPRainMaker/Pods-ESPRainMakerAll-ESPRainMaker-frameworks.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ESPRainMaker/Pods-ESPRainMaker-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; + F1C77F0D2486DC91000CE2FE /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\n\n# gitversioning.sh\n# \n#\n# Created by sig on 28.10.13.\n#\n\nversion=$(git rev-parse --verify HEAD | cut -c 1-7)\ncurdate=$(date +\"%d.%m.%y\")\n\nfilesource=\"//\\n// GitVersion.h\\n\\n\\n#ifndef GitVersion_h\\n#define GitVersion_h\\n\\n#define GIT_SHA_VERSION @\\\"$version\\\"\\n\\n#endif\"\n\ntouch $SRCROOT/ESPRainMaker/Resources/GitVersion.h\necho \"$filesource\" > $SRCROOT/ESPRainMaker/Resources/GitVersion.h\n"; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -680,7 +698,6 @@ isa = PBXVariantGroup; children = ( 1431462B20DE994B0017E119 /* Base */, - F15EABFD23E05A16008A766B /* zh-Hans */, ); name = Main.storyboard; sourceTree = ""; @@ -689,7 +706,6 @@ isa = PBXVariantGroup; children = ( 1431463020DE994C0017E119 /* Base */, - F15EABFE23E05A16008A766B /* zh-Hans */, ); name = LaunchScreen.storyboard; sourceTree = ""; @@ -697,7 +713,6 @@ F15EAC0123E05A51008A766B /* Localizable.strings */ = { isa = PBXVariantGroup; children = ( - F15EAC0023E05A51008A766B /* zh-Hans */, F15EAC0223E05A59008A766B /* en */, ); name = Localizable.strings; @@ -707,7 +722,6 @@ isa = PBXVariantGroup; children = ( F15EAC0B23E198FF008A766B /* Base */, - F15EAC0E23E19909008A766B /* zh-Hans */, ); name = Login.storyboard; sourceTree = ""; @@ -716,7 +730,6 @@ isa = PBXVariantGroup; children = ( F15EAC1023E1994E008A766B /* Base */, - F15EAC1323E19976008A766B /* zh-Hans */, ); name = DeviceDetail.storyboard; sourceTree = ""; @@ -773,7 +786,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.4; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = NO; ONLY_ACTIVE_ARCH = NO; SDKROOT = iphoneos; @@ -785,7 +798,7 @@ }; F155A31E2397C37E007EEC33 /* ESPRainMaker-Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = EF8004A653E60197A67C5A7F /* Pods-ESPRainMakerAll-ESPRainMaker.esprainmaker-debug.xcconfig */; + baseConfigurationReference = 20EAA68DBEE10B9B45CB7E5B /* Pods-ESPRainMaker.esprainmaker-debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; AUTH_URL = "https://rainmaker-staging.auth.us-east-1.amazoncognito.com/oauth2/"; @@ -809,9 +822,10 @@ "@executable_path/Frameworks", ); LIBRARY_SEARCH_PATHS = "$(inherited)"; - MARKETING_VERSION = 2.0; + MARKETING_VERSION = 2.0.1; ONLY_ACTIVE_ARCH = NO; OTHER_SWIFT_FLAGS = "$(inherited)"; + PRODUCT_BUNDLE_IDENTIFIER = com.espressif.rainmaker.intsoftap; PRODUCT_NAME = "ESP RainMaker"; PROVISIONING_PROFILE_SPECIFIER = "RainMaker Beta App Development Profile"; REDIRECT_URL = "com.espressif.rainmaker.intsoftap://success"; @@ -873,7 +887,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.4; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = NO; ONLY_ACTIVE_ARCH = NO; SDKROOT = iphoneos; @@ -885,7 +899,7 @@ }; F172D299234352D3005F687A /* ESPRainMaker-Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = BEE7825EF97282B6DCBD38F8 /* Pods-ESPRainMakerAll-ESPRainMaker.esprainmaker-release.xcconfig */; + baseConfigurationReference = 187D4B6FA979D2D3D8B7C631 /* Pods-ESPRainMaker.esprainmaker-release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; AUTH_URL = "https://auth.rainmaker.espressif.com/oauth2/"; @@ -909,9 +923,10 @@ "@executable_path/Frameworks", ); LIBRARY_SEARCH_PATHS = "$(inherited)"; - MARKETING_VERSION = 2.0; + MARKETING_VERSION = 2.0.1; ONLY_ACTIVE_ARCH = NO; OTHER_SWIFT_FLAGS = "$(inherited) -DPROD"; + PRODUCT_BUNDLE_IDENTIFIER = com.espressif.rainmaker.softap; PRODUCT_NAME = "ESP RainMaker"; PROVISIONING_PROFILE_SPECIFIER = "ESP RainMaker SoftAp Provisioning Development"; REDIRECT_URL = "com.espressif.rainmaker.softap://success"; diff --git a/ESPRainMaker/ESPRainMaker/AWSCognito/DeviceAssociation.swift b/ESPRainMaker/ESPRainMaker/AWSCognito/DeviceAssociation.swift index 792a1ce7..edb603ac 100644 --- a/ESPRainMaker/ESPRainMaker/AWSCognito/DeviceAssociation.swift +++ b/ESPRainMaker/ESPRainMaker/AWSCognito/DeviceAssociation.swift @@ -20,8 +20,19 @@ import ESPProvision import Foundation import SwiftProtobuf +enum AssociationError: Error { + case runtimeError(String) + + var description: String { + switch self { + case let .runtimeError(message): + return message + } + } +} + protocol DeviceAssociationProtocol { - func deviceAssociationFinishedWith(success: Bool, nodeID: String?) + func deviceAssociationFinishedWith(success: Bool, nodeID: String?, error: AssociationError?) } class DeviceAssociation { @@ -51,16 +62,16 @@ class DeviceAssociation { if let data = payloadData { device.sendData(path: Constants.associationPath, data: data) { response, error in guard error == nil, response != nil else { - self.delegate?.deviceAssociationFinishedWith(success: false, nodeID: nil) + self.delegate?.deviceAssociationFinishedWith(success: false, nodeID: nil, error: AssociationError.runtimeError(error!.localizedDescription)) return } self.processResponse(responseData: response!) } } else { - delegate?.deviceAssociationFinishedWith(success: false, nodeID: nil) + delegate?.deviceAssociationFinishedWith(success: false, nodeID: nil, error: AssociationError.runtimeError("Unable to fetch request payload.")) } } catch { - delegate?.deviceAssociationFinishedWith(success: false, nodeID: nil) + delegate?.deviceAssociationFinishedWith(success: false, nodeID: nil, error: AssociationError.runtimeError("Unable to fetch request payload.")) } } @@ -70,16 +81,15 @@ class DeviceAssociation { /// - Parameters: /// - responseData: Response recieved from device after sending mapping payload func processResponse(responseData: Data) { - let decryptedResponse = (device.securityLayer.decrypt(data: responseData))! do { - let response = try Rainmaker_RMakerConfigPayload(serializedData: decryptedResponse) + let response = try Rainmaker_RMakerConfigPayload(serializedData: responseData) if response.respSetUserMapping.status == .success { - delegate?.deviceAssociationFinishedWith(success: true, nodeID: response.respSetUserMapping.nodeID) + delegate?.deviceAssociationFinishedWith(success: true, nodeID: response.respSetUserMapping.nodeID, error: nil) } else { - delegate?.deviceAssociationFinishedWith(success: false, nodeID: nil) + delegate?.deviceAssociationFinishedWith(success: false, nodeID: nil, error: AssociationError.runtimeError("User node mapping failed.")) } } catch { - delegate?.deviceAssociationFinishedWith(success: false, nodeID: nil) + delegate?.deviceAssociationFinishedWith(success: false, nodeID: nil, error: AssociationError.runtimeError(error.localizedDescription)) } } @@ -93,6 +103,6 @@ class DeviceAssociation { var payload = Rainmaker_RMakerConfigPayload() payload.msg = Rainmaker_RMakerConfigMsgType.typeCmdSetUserMapping payload.cmdSetUserMapping = configRequest - return try device.securityLayer.encrypt(data: payload.serializedData()) + return try payload.serializedData() } } diff --git a/ESPRainMaker/ESPRainMaker/Base.lproj/Login.storyboard b/ESPRainMaker/ESPRainMaker/Base.lproj/Login.storyboard index 03d57a69..6508a527 100644 --- a/ESPRainMaker/ESPRainMaker/Base.lproj/Login.storyboard +++ b/ESPRainMaker/ESPRainMaker/Base.lproj/Login.storyboard @@ -1,9 +1,9 @@ - + - + @@ -504,7 +504,7 @@ - + + - - + + + + - + + - + diff --git a/ESPRainMaker/ESPRainMaker/Base.lproj/Main.storyboard b/ESPRainMaker/ESPRainMaker/Base.lproj/Main.storyboard index 7765b282..0b65130f 100644 --- a/ESPRainMaker/ESPRainMaker/Base.lproj/Main.storyboard +++ b/ESPRainMaker/ESPRainMaker/Base.lproj/Main.storyboard @@ -12,15 +12,15 @@ - + - + -