Commit 7b821f42 authored by Wei Han's avatar Wei Han

code update

parent 14d0d71c
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
44006126336D83DB220E7214 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */; }; 44006126336D83DB220E7214 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */; };
4EC822DE2B433513F31AFB3E /* libPods-example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 40EB36954DDA100CF0424A89 /* libPods-example.a */; };
761780ED2CA45674006654EE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 761780EC2CA45674006654EE /* AppDelegate.swift */; }; 761780ED2CA45674006654EE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 761780EC2CA45674006654EE /* AppDelegate.swift */; };
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
AFC1B725D41173F56B62FA3B /* libPods-example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F2A6CDBD96A29E1979EF0BD3 /* libPods-example.a */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
...@@ -19,12 +19,12 @@ ...@@ -19,12 +19,12 @@
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = example/Images.xcassets; sourceTree = "<group>"; }; 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = example/Images.xcassets; sourceTree = "<group>"; };
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = example/Info.plist; sourceTree = "<group>"; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = example/Info.plist; sourceTree = "<group>"; };
13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = PrivacyInfo.xcprivacy; path = example/PrivacyInfo.xcprivacy; sourceTree = "<group>"; }; 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = PrivacyInfo.xcprivacy; path = example/PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
31FDB50C78AE137D41CF411D /* Pods-example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.debug.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.debug.xcconfig"; sourceTree = "<group>"; };
40EB36954DDA100CF0424A89 /* libPods-example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-example.a"; sourceTree = BUILT_PRODUCTS_DIR; };
761780EC2CA45674006654EE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = example/AppDelegate.swift; sourceTree = "<group>"; }; 761780EC2CA45674006654EE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = example/AppDelegate.swift; sourceTree = "<group>"; };
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = example/LaunchScreen.storyboard; sourceTree = "<group>"; }; 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = example/LaunchScreen.storyboard; sourceTree = "<group>"; };
824AEC708BA04F5AD482851A /* Pods-example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.release.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.release.xcconfig"; sourceTree = "<group>"; }; 9585DFA7130596921EB0F5A6 /* Pods-example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.release.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.release.xcconfig"; sourceTree = "<group>"; };
C92BFB68E35543E7EF3282FC /* Pods-example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.debug.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.debug.xcconfig"; sourceTree = "<group>"; };
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
F2A6CDBD96A29E1979EF0BD3 /* libPods-example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-example.a"; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
4EC822DE2B433513F31AFB3E /* libPods-example.a in Frameworks */, AFC1B725D41173F56B62FA3B /* libPods-example.a in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
ED297162215061F000B7C4FE /* JavaScriptCore.framework */, ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
40EB36954DDA100CF0424A89 /* libPods-example.a */, F2A6CDBD96A29E1979EF0BD3 /* libPods-example.a */,
); );
name = Frameworks; name = Frameworks;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -92,8 +92,8 @@ ...@@ -92,8 +92,8 @@
BBD78D7AC51CEA395F1C20DB /* Pods */ = { BBD78D7AC51CEA395F1C20DB /* Pods */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
31FDB50C78AE137D41CF411D /* Pods-example.debug.xcconfig */, C92BFB68E35543E7EF3282FC /* Pods-example.debug.xcconfig */,
824AEC708BA04F5AD482851A /* Pods-example.release.xcconfig */, 9585DFA7130596921EB0F5A6 /* Pods-example.release.xcconfig */,
); );
path = Pods; path = Pods;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -105,13 +105,13 @@ ...@@ -105,13 +105,13 @@
isa = PBXNativeTarget; isa = PBXNativeTarget;
buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "example" */; buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "example" */;
buildPhases = ( buildPhases = (
B87419CC63186335BB42ACC9 /* [CP] Check Pods Manifest.lock */, 94C2598371F476B4E1E60F33 /* [CP] Check Pods Manifest.lock */,
13B07F871A680F5B00A75B9A /* Sources */, 13B07F871A680F5B00A75B9A /* Sources */,
13B07F8C1A680F5B00A75B9A /* Frameworks */, 13B07F8C1A680F5B00A75B9A /* Frameworks */,
13B07F8E1A680F5B00A75B9A /* Resources */, 13B07F8E1A680F5B00A75B9A /* Resources */,
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
7EA22330F9EEADB32B8DCA0C /* [CP] Embed Pods Frameworks */, 97557091BD8C2C7B4B6F7AD4 /* [CP] Embed Pods Frameworks */,
CF5916958D0840FF3C063407 /* [CP] Copy Pods Resources */, 052C3E3D9666B087C0F21867 /* [CP] Copy Pods Resources */,
); );
buildRules = ( buildRules = (
); );
...@@ -183,24 +183,24 @@ ...@@ -183,24 +183,24 @@
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "set -e\n\nWITH_ENVIRONMENT=\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"$REACT_NATIVE_PATH/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n"; shellScript = "set -e\n\nWITH_ENVIRONMENT=\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"$REACT_NATIVE_PATH/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n";
}; };
7EA22330F9EEADB32B8DCA0C /* [CP] Embed Pods Frameworks */ = { 052C3E3D9666B087C0F21867 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
); );
inputFileListPaths = ( inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks-${CONFIGURATION}-input-files.xcfilelist", "${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources-${CONFIGURATION}-input-files.xcfilelist",
); );
name = "[CP] Embed Pods Frameworks"; name = "[CP] Copy Pods Resources";
outputFileListPaths = ( outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks-${CONFIGURATION}-output-files.xcfilelist", "${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources-${CONFIGURATION}-output-files.xcfilelist",
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks.sh\"\n"; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources.sh\"\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
B87419CC63186335BB42ACC9 /* [CP] Check Pods Manifest.lock */ = { 94C2598371F476B4E1E60F33 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
...@@ -222,21 +222,21 @@ ...@@ -222,21 +222,21 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
CF5916958D0840FF3C063407 /* [CP] Copy Pods Resources */ = { 97557091BD8C2C7B4B6F7AD4 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
); );
inputFileListPaths = ( inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources-${CONFIGURATION}-input-files.xcfilelist", "${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks-${CONFIGURATION}-input-files.xcfilelist",
); );
name = "[CP] Copy Pods Resources"; name = "[CP] Embed Pods Frameworks";
outputFileListPaths = ( outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources-${CONFIGURATION}-output-files.xcfilelist", "${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks-${CONFIGURATION}-output-files.xcfilelist",
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources.sh\"\n"; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks.sh\"\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
/* End PBXShellScriptBuildPhase section */ /* End PBXShellScriptBuildPhase section */
...@@ -255,7 +255,7 @@ ...@@ -255,7 +255,7 @@
/* Begin XCBuildConfiguration section */ /* Begin XCBuildConfiguration section */
13B07F941A680F5B00A75B9A /* Debug */ = { 13B07F941A680F5B00A75B9A /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 31FDB50C78AE137D41CF411D /* Pods-example.debug.xcconfig */; baseConfigurationReference = C92BFB68E35543E7EF3282FC /* Pods-example.debug.xcconfig */;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
...@@ -283,7 +283,7 @@ ...@@ -283,7 +283,7 @@
}; };
13B07F951A680F5B00A75B9A /* Release */ = { 13B07F951A680F5B00A75B9A /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 824AEC708BA04F5AD482851A /* Pods-example.release.xcconfig */; baseConfigurationReference = 9585DFA7130596921EB0F5A6 /* Pods-example.release.xcconfig */;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<dict> <dict>
<key>Assets.car</key> <key>Assets.car</key>
<data> <data>
mDeq0E4lblXfFuIgkojjE5zY6hk= nz4CVgVrIgti3Z6dGyfqT52lO7E=
</data> </data>
<key>Headers/QmsPlugin.h</key> <key>Headers/QmsPlugin.h</key>
<data> <data>
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</data> </data>
<key>Info.plist</key> <key>Info.plist</key>
<data> <data>
/JZsUWwwr7A+ZF0o001HQXRnzpI= t43yRjSptMFTXQfSxY21jokBVtU=
</data> </data>
<key>Modules/module.modulemap</key> <key>Modules/module.modulemap</key>
<data> <data>
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<dict> <dict>
<key>hash2</key> <key>hash2</key>
<data> <data>
0+eonZqFOeyimWUH94CuUhfXNEulhfi9YeuUE/wnX0s= J60ydBHIUa66OEr3jc21333AHp87l+VEFvKU7h3lu2M=
</data> </data>
</dict> </dict>
<key>Headers/QmsPlugin.h</key> <key>Headers/QmsPlugin.h</key>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<dict> <dict>
<key>Assets.car</key> <key>Assets.car</key>
<data> <data>
mDeq0E4lblXfFuIgkojjE5zY6hk= nz4CVgVrIgti3Z6dGyfqT52lO7E=
</data> </data>
<key>Headers/QmsPlugin.h</key> <key>Headers/QmsPlugin.h</key>
<data> <data>
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</data> </data>
<key>Info.plist</key> <key>Info.plist</key>
<data> <data>
4pQwOIuYwsUH4Iiw1M402s3Ii8Y= CSlwpYePP8U03s3cRC5622W7ESM=
</data> </data>
<key>Modules/module.modulemap</key> <key>Modules/module.modulemap</key>
<data> <data>
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<dict> <dict>
<key>hash2</key> <key>hash2</key>
<data> <data>
0+eonZqFOeyimWUH94CuUhfXNEulhfi9YeuUE/wnX0s= J60ydBHIUa66OEr3jc21333AHp87l+VEFvKU7h3lu2M=
</data> </data>
</dict> </dict>
<key>Headers/QmsPlugin.h</key> <key>Headers/QmsPlugin.h</key>
......
// AccessAppointmentViewController.h
#import <UIKit/UIKit.h>
@interface AccessAppointmentViewController : UIViewController
@property (nonatomic, strong) NSDictionary *appointmentData;
@end
// AccessItemAPIClient.h
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface AccessItemAPIClient : NSObject
+ (void)fetchAccessItem:(NSString *)unitId
completion:(void(^)(BOOL success, NSDictionary * _Nullable response, NSError * _Nullable error))completion;
@end
NS_ASSUME_NONNULL_END
// AccessItemAPIClient.mm
#import "AccessItemAPIClient.h"
@implementation AccessItemAPIClient
+ (void)fetchAccessItem:(NSString *)unitId
completion:(void(^)(BOOL success, NSDictionary * _Nullable response, NSError * _Nullable error))completion {
NSString *urlString = @"https://kitadev.commudesk.com/api/owner/plan/getAccessItem?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6ImF0aGlyYWh6YWlkaUBjb252ZXAuY29tIiwicGFzc3dvcmQiOiIkMnkkMTAkNU9xYklqMnZ6UHJwckJrcVd5c3I2LmJCc1hVYS9Hd014eUhnL3RhUUhPUkNQcGdmTG8yakciLCJzdWIiOjIxNzAsImlzcyI6Imh0dHBzOi8va2l0YWRldi5jb21tdWRlc2suY29tL2FwaS9vd25lci9hdXRoL3Bhc3N3b3JkbGVzc19sb2dpbiIsImlhdCI6MTc2MDMxNTM1MiwiZXhwIjoyMDc1ODg0ODcyLCJuYmYiOjE3NjAzMTUzNTIsImp0aSI6IktoQmNyQnJEdDVNdDZlWmMifQ.JnxGbZ7hTeoOr6oibIzZMphgyKtTo2Aq9Efx6mrGfFA";
NSURL *url = [NSURL URLWithString:urlString];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
request.HTTPMethod = @"POST";
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
NSDictionary *deviceInfo = @{
@"OS": @"AND",
@"IMEI": @"AND:2a2f13ff17b1cbb5",
@"OS_VERSION": @"35",
@"MODEL": @"2306EPN60G",
@"APP_VERSION": @"1.22.26"
};
NSDictionary *jsonBody = @{
@"data": @{
@"os": @"AND",
@"drawing_plan_id": unitId ?: @"",
@"information": deviceInfo,
}
};
NSLog(@"🌍 SUBMIT URL: %@", urlString);
NSLog(@"📦 SUBMIT Body JSON: %@", jsonBody);
NSError *jsonError;
NSData *bodyData = [NSJSONSerialization dataWithJSONObject:jsonBody options:0 error:&jsonError];
if (jsonError) {
NSLog(@"❌ JSON Serialization Error: %@", jsonError);
if (completion) completion(NO, nil, jsonError);
return;
}
request.HTTPBody = bodyData;
NSLog(@"🔄 SUBMIT (NO REP) Request started...");
NSURLSessionDataTask *task = [[NSURLSession sharedSession]
dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"❌ Network Error: %@", error);
dispatch_async(dispatch_get_main_queue(), ^{
completion(NO, nil, error);
});
return;
}
NSError *parseError;
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
if (parseError) {
NSLog(@"⚠️ JSON Parse Error: %@", parseError);
dispatch_async(dispatch_get_main_queue(), ^{
completion(NO, nil, parseError);
});
return;
}
NSLog(@"✅ SUBMIT (NO REP) API Response:\n%@", json);
dispatch_async(dispatch_get_main_queue(), ^{
completion(YES, json, nil);
});
}];
[task resume];
}
@end
// AccessItemViewController.h
#import <UIKit/UIKit.h>
typedef NS_ENUM(NSInteger, DisplayPage) {
DisplayPageAccessItem,
DisplayPageTransactionContent,
DisplayPageAppointmentContent
};
@interface AccessItemViewController : UIViewController
// Data
@property (nonatomic, strong) NSArray *submittedItems;
@property (nonatomic, strong) NSArray *transactionItems;
@property (nonatomic, strong) NSDictionary *selectedTransaction;
@property (nonatomic, strong) NSString *unitID;
@property (nonatomic, strong) NSString *unitName;
@end
// AccessTransactionViewController.h
#import <UIKit/UIKit.h>
@interface AccessTransactionViewController : UIViewController
@property (nonatomic, strong) NSDictionary *transactionData;
@property (nonatomic, strong) NSArray *items;
@property (nonatomic, strong) NSString *termsName;
@property (nonatomic, strong) NSString *termsContent;
@property (nonatomic, strong) NSString *unitID;
@end
...@@ -58,8 +58,6 @@ ...@@ -58,8 +58,6 @@
// Log the path so you can find it // Log the path so you can find it
NSLog(@"📁 issueData saved as plain text to: %@", filePath); NSLog(@"📁 issueData saved as plain text to: %@", filePath);
NSDictionary *locData = self.locationData; NSDictionary *locData = self.locationData;
if ([locData isKindOfClass:[NSDictionary class]]) { if ([locData isKindOfClass:[NSDictionary class]]) {
self.categories = locData[@"category"]; self.categories = locData[@"category"];
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#import "AppointmentDetailsViewController.h" #import "AppointmentDetailsViewController.h"
#import "AppointmentViewMoreViewController.h" #import "AppointmentViewMoreViewController.h"
#import "GeneralInfoViewController.h" #import "GeneralInfoViewController.h"
#import "AccessItemViewController.h"
@interface DashboardViewController () @interface DashboardViewController ()
...@@ -342,6 +343,11 @@ ...@@ -342,6 +343,11 @@
} }
case 2: { case 2: {
NSLog(@"Navigating to Access Item"); NSLog(@"Navigating to Access Item");
AccessItemViewController *nextVC = [[AccessItemViewController alloc] init];
nextVC.unitID = self.projectCode;
nextVC.unitName = self.projectName;
nextVC.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentViewController:nextVC animated:YES completion:nil];
} }
default: default:
break; break;
......
...@@ -561,10 +561,25 @@ typedef struct { ...@@ -561,10 +561,25 @@ typedef struct {
self.owners = general[@"unit_owner"] ?: @[]; self.owners = general[@"unit_owner"] ?: @[];
self.jointOwners = general[@"joint_unit_owner"] ?: @[]; self.jointOwners = general[@"joint_unit_owner"] ?: @[];
self.unitDocuments = general[@"owner_document_unit"] ?: @[];
self.layoutDocuments = general[@"owner_document_phase"] ?: @[]; self.layoutDocuments = general[@"owner_document_phase"] ?: @[];
self.generalDocuments = general[@"owner_document_project"] ?: @[]; self.generalDocuments = general[@"owner_document_project"] ?: @[];
NSArray *rawUnitDocs = general[@"owner_document_unit"];
NSMutableArray *unitDocs = rawUnitDocs ? [rawUnitDocs mutableCopy] : [NSMutableArray array];
// clearance_letter_attachment is a DICTIONARY
NSDictionary *clearanceDict = general[@"clearance_letter_attachment"];
if (clearanceDict &&
[clearanceDict isKindOfClass:[NSDictionary class]] &&
[clearanceDict[@"file"] isKindOfClass:[NSString class]] &&
[clearanceDict[@"file"] length] > 0)
{
[unitDocs addObject:clearanceDict];
}
self.unitDocuments = unitDocs;
self.forms = general[@"contactless_form"] ?: @[]; self.forms = general[@"contactless_form"] ?: @[];
self.layoutType = general[@"layout"] ?: @""; self.layoutType = general[@"layout"] ?: @"";
...@@ -925,7 +940,6 @@ typedef struct { ...@@ -925,7 +940,6 @@ typedef struct {
UIButton *btn = [self collapsibleHeaderWithTitle:title]; UIButton *btn = [self collapsibleHeaderWithTitle:title];
btn.translatesAutoresizingMaskIntoConstraints = NO; btn.translatesAutoresizingMaskIntoConstraints = NO;
[self.documentsContainer addSubview:btn];
UIStackView *stack = [[UIStackView alloc] init]; UIStackView *stack = [[UIStackView alloc] init];
stack.axis = UILayoutConstraintAxisVertical; stack.axis = UILayoutConstraintAxisVertical;
...@@ -937,22 +951,18 @@ typedef struct { ...@@ -937,22 +951,18 @@ typedef struct {
stack.layoutMargins = UIEdgeInsetsMake(12, 12, 12, 12); stack.layoutMargins = UIEdgeInsetsMake(12, 12, 12, 12);
stack.layoutMarginsRelativeArrangement = YES; stack.layoutMarginsRelativeArrangement = YES;
[self.documentsContainer addSubview:stack];
objc_setAssociatedObject(btn, "sectionStack", stack, OBJC_ASSOCIATION_RETAIN); objc_setAssociatedObject(btn, "sectionStack", stack, OBJC_ASSOCIATION_RETAIN);
[btn addTarget:self action:@selector(toggleSection:) forControlEvents:UIControlEventTouchUpInside]; [btn addTarget:self action:@selector(toggleSection:) forControlEvents:UIControlEventTouchUpInside];
UIImageView *arrow = objc_getAssociatedObject(btn, "arrowView"); UIImageView *arrow = objc_getAssociatedObject(btn, "arrowView");
if (arrow) { if (arrow) {
arrow.transform = CGAffineTransformMakeRotation(M_PI); // expanded state (chevron.up) arrow.transform = CGAffineTransformMakeRotation(M_PI);
} }
for (NSDictionary *doc in items) { for (NSDictionary *doc in items) {
NSString *fileURL = doc[@"file"]; NSString *fileURL = doc[@"file"];
NSString *name = doc[@"name"] ?: @"Document"; NSString *name = doc[@"name"] ?: @"Document";
// Card container
UIView *card = [[UIView alloc] init]; UIView *card = [[UIView alloc] init];
card.backgroundColor = UIColor.whiteColor; card.backgroundColor = UIColor.whiteColor;
card.layer.cornerRadius = 8; card.layer.cornerRadius = 8;
...@@ -960,7 +970,6 @@ typedef struct { ...@@ -960,7 +970,6 @@ typedef struct {
card.layer.borderColor = UIColor.lightGrayColor.CGColor; card.layer.borderColor = UIColor.lightGrayColor.CGColor;
card.translatesAutoresizingMaskIntoConstraints = NO; card.translatesAutoresizingMaskIntoConstraints = NO;
// Add label inside card
UILabel *lbl = [[UILabel alloc] init]; UILabel *lbl = [[UILabel alloc] init];
lbl.text = name; lbl.text = name;
lbl.font = [UIFont systemFontOfSize:15]; lbl.font = [UIFont systemFontOfSize:15];
...@@ -976,12 +985,10 @@ typedef struct { ...@@ -976,12 +985,10 @@ typedef struct {
[lbl.bottomAnchor constraintEqualToAnchor:card.bottomAnchor constant:-10], [lbl.bottomAnchor constraintEqualToAnchor:card.bottomAnchor constant:-10],
]]; ]];
// Attach PDF URL to card if ([fileURL length] > 0) {
if (fileURL && ![fileURL isKindOfClass:[NSNull class]] && fileURL.length > 0) {
objc_setAssociatedObject(card, "pdfURL", fileURL, OBJC_ASSOCIATION_RETAIN_NONATOMIC); objc_setAssociatedObject(card, "pdfURL", fileURL, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
objc_setAssociatedObject(card, "pdfName", name, OBJC_ASSOCIATION_RETAIN_NONATOMIC); objc_setAssociatedObject(card, "pdfName", name, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
// Add tap gesture
UITapGestureRecognizer *tap = UITapGestureRecognizer *tap =
[[UITapGestureRecognizer alloc] initWithTarget:self [[UITapGestureRecognizer alloc] initWithTarget:self
action:@selector(openPDFFromView:)]; action:@selector(openPDFFromView:)];
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<dict> <dict>
<key>Assets.car</key> <key>Assets.car</key>
<data> <data>
mDeq0E4lblXfFuIgkojjE5zY6hk= nz4CVgVrIgti3Z6dGyfqT52lO7E=
</data> </data>
<key>Headers/QmsPlugin.h</key> <key>Headers/QmsPlugin.h</key>
<data> <data>
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</data> </data>
<key>Info.plist</key> <key>Info.plist</key>
<data> <data>
/JZsUWwwr7A+ZF0o001HQXRnzpI= t43yRjSptMFTXQfSxY21jokBVtU=
</data> </data>
<key>Modules/module.modulemap</key> <key>Modules/module.modulemap</key>
<data> <data>
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<dict> <dict>
<key>hash2</key> <key>hash2</key>
<data> <data>
0+eonZqFOeyimWUH94CuUhfXNEulhfi9YeuUE/wnX0s= J60ydBHIUa66OEr3jc21333AHp87l+VEFvKU7h3lu2M=
</data> </data>
</dict> </dict>
<key>Headers/QmsPlugin.h</key> <key>Headers/QmsPlugin.h</key>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<dict> <dict>
<key>Assets.car</key> <key>Assets.car</key>
<data> <data>
mDeq0E4lblXfFuIgkojjE5zY6hk= nz4CVgVrIgti3Z6dGyfqT52lO7E=
</data> </data>
<key>Headers/QmsPlugin.h</key> <key>Headers/QmsPlugin.h</key>
<data> <data>
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</data> </data>
<key>Info.plist</key> <key>Info.plist</key>
<data> <data>
4pQwOIuYwsUH4Iiw1M402s3Ii8Y= CSlwpYePP8U03s3cRC5622W7ESM=
</data> </data>
<key>Modules/module.modulemap</key> <key>Modules/module.modulemap</key>
<data> <data>
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<dict> <dict>
<key>hash2</key> <key>hash2</key>
<data> <data>
0+eonZqFOeyimWUH94CuUhfXNEulhfi9YeuUE/wnX0s= J60ydBHIUa66OEr3jc21333AHp87l+VEFvKU7h3lu2M=
</data> </data>
</dict> </dict>
<key>Headers/QmsPlugin.h</key> <key>Headers/QmsPlugin.h</key>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment