Explorar o código

update nuCore dan fix APN

alqindiirsyam hai 6 meses
pai
achega
2722b415e4

BIN=BIN
.DS_Store


BIN=BIN
AppBuilder/.DS_Store


+ 53 - 187
AppBuilder/AppBuilder.xcodeproj/project.pbxproj

@@ -14,7 +14,7 @@
 		2401CEA1275490DB00B323BB /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2401CE9F275490DB00B323BB /* Main.storyboard */; };
 		2401CEA3275490E600B323BB /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2401CEA2275490E600B323BB /* Assets.xcassets */; };
 		2401CEA6275490E600B323BB /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2401CEA4275490E600B323BB /* LaunchScreen.storyboard */; };
-		97CE94031DAB5279520168B7 /* Pods_AppBuilder.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AC609786ACEC0341CC921B30 /* Pods_AppBuilder.framework */; };
+		5E96FB76884562D8D9229EDB /* Pods_AppBuilder.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 187C913CD69AB39558A1C591 /* Pods_AppBuilder.framework */; };
 		A413B18727EACB20006D16EB /* PrefsUtil.swift in Sources */ = {isa = PBXBuildFile; fileRef = A413B18627EACB20006D16EB /* PrefsUtil.swift */; };
 		A42ED92227F30BA200B0FAB7 /* FirstTabViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A42ED92127F30BA200B0FAB7 /* FirstTabViewController.swift */; };
 		A42ED92427F3FC2F00B0FAB7 /* SecondTabViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A42ED92327F3FC2F00B0FAB7 /* SecondTabViewController.swift */; };
@@ -30,20 +30,8 @@
 		CD9D59E12BEE1D30008014B4 /* disini_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = CD9D59D62BEE1D30008014B4 /* disini_icon.png */; };
 		CD9D59E22BEE1D30008014B4 /* kmi_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = CD9D59D72BEE1D30008014B4 /* kmi_icon.png */; };
 		CD9D59E32BEE1D30008014B4 /* nu_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = CD9D59D82BEE1D30008014B4 /* nu_icon.png */; };
-		CDEE3DCC29B06E1E00B420E5 /* NotificationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDEE3DCB29B06E1E00B420E5 /* NotificationService.swift */; };
-		CDEE3DD029B06E1E00B420E5 /* NotificationService.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = CDEE3DC929B06E1E00B420E5 /* NotificationService.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
 /* End PBXBuildFile section */
 
-/* Begin PBXContainerItemProxy section */
-		CDEE3DCE29B06E1E00B420E5 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 2401CE8E275490DB00B323BB /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = CDEE3DC829B06E1E00B420E5;
-			remoteInfo = NotificationService;
-		};
-/* End PBXContainerItemProxy section */
-
 /* Begin PBXCopyFilesBuildPhase section */
 		247E0A722796969200430E5F /* Embed Frameworks */ = {
 			isa = PBXCopyFilesBuildPhase;
@@ -61,7 +49,6 @@
 			dstPath = "";
 			dstSubfolderSpec = 13;
 			files = (
-				CDEE3DD029B06E1E00B420E5 /* NotificationService.appex in Embed Foundation Extensions */,
 			);
 			name = "Embed Foundation Extensions";
 			runOnlyForDeploymentPostprocessing = 0;
@@ -69,7 +56,9 @@
 /* End PBXCopyFilesBuildPhase section */
 
 /* Begin PBXFileReference section */
+		08F5DF9A7B8CA1560B8878A0 /* Pods-AppBuilder.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AppBuilder.release.xcconfig"; path = "Target Support Files/Pods-AppBuilder/Pods-AppBuilder.release.xcconfig"; sourceTree = "<group>"; };
 		12960ADF2892361000A467DD /* FourthTabViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FourthTabViewController.swift; sourceTree = "<group>"; };
+		187C913CD69AB39558A1C591 /* Pods_AppBuilder.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_AppBuilder.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 		2401CE96275490DB00B323BB /* AppBuilder.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AppBuilder.app; sourceTree = BUILT_PRODUCTS_DIR; };
 		2401CE99275490DB00B323BB /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
 		2401CE9B275490DB00B323BB /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
@@ -78,13 +67,11 @@
 		2401CEA2275490E600B323BB /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
 		2401CEA5275490E600B323BB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
 		2401CEA7275490E600B323BB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
-		4541B48357BC75B7A8C1B96A /* Pods-AppBuilder.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AppBuilder.release.xcconfig"; path = "Target Support Files/Pods-AppBuilder/Pods-AppBuilder.release.xcconfig"; sourceTree = "<group>"; };
+		7C79883C9EF677263426AD2E /* Pods-AppBuilder.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AppBuilder.debug.xcconfig"; path = "Target Support Files/Pods-AppBuilder/Pods-AppBuilder.debug.xcconfig"; sourceTree = "<group>"; };
 		A413B18627EACB20006D16EB /* PrefsUtil.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrefsUtil.swift; sourceTree = "<group>"; };
 		A42ED92127F30BA200B0FAB7 /* FirstTabViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FirstTabViewController.swift; sourceTree = "<group>"; };
 		A42ED92327F3FC2F00B0FAB7 /* SecondTabViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecondTabViewController.swift; sourceTree = "<group>"; };
 		A42ED92527F439A200B0FAB7 /* ThirdTabViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThirdTabViewController.swift; sourceTree = "<group>"; };
-		AC609786ACEC0341CC921B30 /* Pods_AppBuilder.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_AppBuilder.framework; sourceTree = BUILT_PRODUCTS_DIR; };
-		BF569AE8FC2850F8F59938BC /* Pods-AppBuilder.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AppBuilder.debug.xcconfig"; path = "Target Support Files/Pods-AppBuilder/Pods-AppBuilder.debug.xcconfig"; sourceTree = "<group>"; };
 		CD9D59CE2BEE1D2F008014B4 /* digisales_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = digisales_icon.png; sourceTree = "<group>"; };
 		CD9D59CF2BEE1D2F008014B4 /* ikn_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ikn_icon.png; sourceTree = "<group>"; };
 		CD9D59D02BEE1D2F008014B4 /* gudeg_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = gudeg_icon.png; sourceTree = "<group>"; };
@@ -96,9 +83,7 @@
 		CD9D59D62BEE1D30008014B4 /* disini_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = disini_icon.png; sourceTree = "<group>"; };
 		CD9D59D72BEE1D30008014B4 /* kmi_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = kmi_icon.png; sourceTree = "<group>"; };
 		CD9D59D82BEE1D30008014B4 /* nu_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = nu_icon.png; sourceTree = "<group>"; };
-		CDEE3DC929B06E1E00B420E5 /* NotificationService.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = NotificationService.appex; sourceTree = BUILT_PRODUCTS_DIR; };
-		CDEE3DCB29B06E1E00B420E5 /* NotificationService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationService.swift; sourceTree = "<group>"; };
-		CDEE3DCD29B06E1E00B420E5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+		CDE27BA42D53641D006298BD /* AppBuilder.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = AppBuilder.entitlements; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -106,28 +91,28 @@
 			isa = PBXFrameworksBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				97CE94031DAB5279520168B7 /* Pods_AppBuilder.framework in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		CDEE3DC629B06E1E00B420E5 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
+				5E96FB76884562D8D9229EDB /* Pods_AppBuilder.framework in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 /* End PBXFrameworksBuildPhase section */
 
 /* Begin PBXGroup section */
+		2203E7E4447BFC430EE46F72 /* Frameworks */ = {
+			isa = PBXGroup;
+			children = (
+				187C913CD69AB39558A1C591 /* Pods_AppBuilder.framework */,
+			);
+			name = Frameworks;
+			sourceTree = "<group>";
+		};
 		2401CE8D275490DB00B323BB = {
 			isa = PBXGroup;
 			children = (
 				2401CE98275490DB00B323BB /* AppBuilder */,
-				CDEE3DCA29B06E1E00B420E5 /* NotificationService */,
-				2401CE97275490DB00B323BB /* Products */,
 				6E32BCCF4DE50EE1A90E8AAE /* Pods */,
-				4055E37109B5A1180A3BAA3C /* Frameworks */,
+				2401CE97275490DB00B323BB /* Products */,
+				2203E7E4447BFC430EE46F72 /* Frameworks */,
 			);
 			sourceTree = "<group>";
 		};
@@ -135,7 +120,6 @@
 			isa = PBXGroup;
 			children = (
 				2401CE96275490DB00B323BB /* AppBuilder.app */,
-				CDEE3DC929B06E1E00B420E5 /* NotificationService.appex */,
 			);
 			name = Products;
 			sourceTree = "<group>";
@@ -143,6 +127,7 @@
 		2401CE98275490DB00B323BB /* AppBuilder */ = {
 			isa = PBXGroup;
 			children = (
+				CDE27BA42D53641D006298BD /* AppBuilder.entitlements */,
 				CD9D59D42BEE1D30008014B4 /* bi_icon.png */,
 				CD9D59D32BEE1D30008014B4 /* bpkh_icon.png */,
 				CD9D59D52BEE1D30008014B4 /* diginets_icon.png */,
@@ -170,32 +155,15 @@
 			path = AppBuilder;
 			sourceTree = "<group>";
 		};
-		4055E37109B5A1180A3BAA3C /* Frameworks */ = {
-			isa = PBXGroup;
-			children = (
-				AC609786ACEC0341CC921B30 /* Pods_AppBuilder.framework */,
-			);
-			name = Frameworks;
-			sourceTree = "<group>";
-		};
 		6E32BCCF4DE50EE1A90E8AAE /* Pods */ = {
 			isa = PBXGroup;
 			children = (
-				BF569AE8FC2850F8F59938BC /* Pods-AppBuilder.debug.xcconfig */,
-				4541B48357BC75B7A8C1B96A /* Pods-AppBuilder.release.xcconfig */,
+				7C79883C9EF677263426AD2E /* Pods-AppBuilder.debug.xcconfig */,
+				08F5DF9A7B8CA1560B8878A0 /* Pods-AppBuilder.release.xcconfig */,
 			);
 			path = Pods;
 			sourceTree = "<group>";
 		};
-		CDEE3DCA29B06E1E00B420E5 /* NotificationService */ = {
-			isa = PBXGroup;
-			children = (
-				CDEE3DCB29B06E1E00B420E5 /* NotificationService.swift */,
-				CDEE3DCD29B06E1E00B420E5 /* Info.plist */,
-			);
-			path = NotificationService;
-			sourceTree = "<group>";
-		};
 /* End PBXGroup section */
 
 /* Begin PBXNativeTarget section */
@@ -203,56 +171,35 @@
 			isa = PBXNativeTarget;
 			buildConfigurationList = 2401CEC0275490E600B323BB /* Build configuration list for PBXNativeTarget "AppBuilder" */;
 			buildPhases = (
-				55F7B6EB91289342CF0B558C /* [CP] Check Pods Manifest.lock */,
+				BCAB5948E2E15FB18EE7AF7D /* [CP] Check Pods Manifest.lock */,
 				2401CE92275490DB00B323BB /* Sources */,
 				2401CE93275490DB00B323BB /* Frameworks */,
 				2401CE94275490DB00B323BB /* Resources */,
 				247E0A722796969200430E5F /* Embed Frameworks */,
 				CDEE3DD129B06E1E00B420E5 /* Embed Foundation Extensions */,
-				A786313812243B4782A0082F /* [CP] Embed Pods Frameworks */,
+				2C6EDAE79F7A5261B33B05F7 /* [CP] Embed Pods Frameworks */,
 			);
 			buildRules = (
 			);
 			dependencies = (
-				CDEE3DCF29B06E1E00B420E5 /* PBXTargetDependency */,
 			);
 			name = AppBuilder;
 			productName = TestQmeraLite;
 			productReference = 2401CE96275490DB00B323BB /* AppBuilder.app */;
 			productType = "com.apple.product-type.application";
 		};
-		CDEE3DC829B06E1E00B420E5 /* NotificationService */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = CDEE3DD429B06E1E00B420E5 /* Build configuration list for PBXNativeTarget "NotificationService" */;
-			buildPhases = (
-				CDEE3DC529B06E1E00B420E5 /* Sources */,
-				CDEE3DC629B06E1E00B420E5 /* Frameworks */,
-				CDEE3DC729B06E1E00B420E5 /* Resources */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = NotificationService;
-			productName = NotificationService;
-			productReference = CDEE3DC929B06E1E00B420E5 /* NotificationService.appex */;
-			productType = "com.apple.product-type.app-extension";
-		};
 /* End PBXNativeTarget section */
 
 /* Begin PBXProject section */
 		2401CE8E275490DB00B323BB /* Project object */ = {
 			isa = PBXProject;
 			attributes = {
-				LastSwiftUpdateCheck = 1420;
+				LastSwiftUpdateCheck = 1620;
 				LastUpgradeCheck = 1250;
 				TargetAttributes = {
 					2401CE95275490DB00B323BB = {
 						CreatedOnToolsVersion = 12.5.1;
 					};
-					CDEE3DC829B06E1E00B420E5 = {
-						CreatedOnToolsVersion = 14.2;
-					};
 				};
 			};
 			buildConfigurationList = 2401CE91275490DB00B323BB /* Build configuration list for PBXProject "AppBuilder" */;
@@ -269,7 +216,6 @@
 			projectRoot = "";
 			targets = (
 				2401CE95275490DB00B323BB /* AppBuilder */,
-				CDEE3DC829B06E1E00B420E5 /* NotificationService */,
 			);
 		};
 /* End PBXProject section */
@@ -296,53 +242,46 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
-		CDEE3DC729B06E1E00B420E5 /* Resources */ = {
-			isa = PBXResourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
 /* End PBXResourcesBuildPhase section */
 
 /* Begin PBXShellScriptBuildPhase section */
-		55F7B6EB91289342CF0B558C /* [CP] Check Pods Manifest.lock */ = {
+		2C6EDAE79F7A5261B33B05F7 /* [CP] Embed Pods Frameworks */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
 			);
 			inputFileListPaths = (
+				"${PODS_ROOT}/Target Support Files/Pods-AppBuilder/Pods-AppBuilder-frameworks-${CONFIGURATION}-input-files.xcfilelist",
 			);
-			inputPaths = (
-				"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
-				"${PODS_ROOT}/Manifest.lock",
-			);
-			name = "[CP] Check Pods Manifest.lock";
+			name = "[CP] Embed Pods Frameworks";
 			outputFileListPaths = (
-			);
-			outputPaths = (
-				"$(DERIVED_FILE_DIR)/Pods-AppBuilder-checkManifestLockResult.txt",
+				"${PODS_ROOT}/Target Support Files/Pods-AppBuilder/Pods-AppBuilder-frameworks-${CONFIGURATION}-output-files.xcfilelist",
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			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 = "\"${PODS_ROOT}/Target Support Files/Pods-AppBuilder/Pods-AppBuilder-frameworks.sh\"\n";
 			showEnvVarsInLog = 0;
 		};
-		A786313812243B4782A0082F /* [CP] Embed Pods Frameworks */ = {
+		BCAB5948E2E15FB18EE7AF7D /* [CP] Check Pods Manifest.lock */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
 			);
 			inputFileListPaths = (
-				"${PODS_ROOT}/Target Support Files/Pods-AppBuilder/Pods-AppBuilder-frameworks-${CONFIGURATION}-input-files.xcfilelist",
 			);
-			name = "[CP] Embed Pods Frameworks";
+			inputPaths = (
+				"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
+				"${PODS_ROOT}/Manifest.lock",
+			);
+			name = "[CP] Check Pods Manifest.lock";
 			outputFileListPaths = (
-				"${PODS_ROOT}/Target Support Files/Pods-AppBuilder/Pods-AppBuilder-frameworks-${CONFIGURATION}-output-files.xcfilelist",
+			);
+			outputPaths = (
+				"$(DERIVED_FILE_DIR)/Pods-AppBuilder-checkManifestLockResult.txt",
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-AppBuilder/Pods-AppBuilder-frameworks.sh\"\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;
 		};
 /* End PBXShellScriptBuildPhase section */
@@ -363,24 +302,8 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
-		CDEE3DC529B06E1E00B420E5 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				CDEE3DCC29B06E1E00B420E5 /* NotificationService.swift in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
 /* End PBXSourcesBuildPhase section */
 
-/* Begin PBXTargetDependency section */
-		CDEE3DCF29B06E1E00B420E5 /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = CDEE3DC829B06E1E00B420E5 /* NotificationService */;
-			targetProxy = CDEE3DCE29B06E1E00B420E5 /* PBXContainerItemProxy */;
-		};
-/* End PBXTargetDependency section */
-
 /* Begin PBXVariantGroup section */
 		2401CE9F275490DB00B323BB /* Main.storyboard */ = {
 			isa = PBXVariantGroup;
@@ -519,12 +442,12 @@
 		};
 		2401CEC1275490E600B323BB /* Debug */ = {
 			isa = XCBuildConfiguration;
-			baseConfigurationReference = BF569AE8FC2850F8F59938BC /* Pods-AppBuilder.debug.xcconfig */;
+			baseConfigurationReference = 7C79883C9EF677263426AD2E /* Pods-AppBuilder.debug.xcconfig */;
 			buildSettings = {
-				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				BUILD_LIBRARY_FOR_DISTRIBUTION = NO;
+				CODE_SIGN_ENTITLEMENTS = AppBuilder/AppBuilder.entitlements;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 5;
@@ -540,10 +463,14 @@
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				MARKETING_VERSION = 5.0.1;
-				PRODUCT_BUNDLE_IDENTIFIER = io.newuniverse.AppBuilder1;
+				MARKETING_VERSION = 5.0.3;
+				PRODUCT_BUNDLE_IDENTIFIER = io.newuniverse.AppBuilder;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE_SPECIFIER = "";
+				SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
+				SUPPORTS_MACCATALYST = NO;
+				SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
+				SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
 				SWIFT_VERSION = 5.0;
 				TARGETED_DEVICE_FAMILY = 1;
 			};
@@ -551,12 +478,12 @@
 		};
 		2401CEC2275490E600B323BB /* Release */ = {
 			isa = XCBuildConfiguration;
-			baseConfigurationReference = 4541B48357BC75B7A8C1B96A /* Pods-AppBuilder.release.xcconfig */;
+			baseConfigurationReference = 08F5DF9A7B8CA1560B8878A0 /* Pods-AppBuilder.release.xcconfig */;
 			buildSettings = {
-				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				BUILD_LIBRARY_FOR_DISTRIBUTION = NO;
+				CODE_SIGN_ENTITLEMENTS = AppBuilder/AppBuilder.entitlements;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 5;
@@ -572,71 +499,19 @@
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				MARKETING_VERSION = 5.0.1;
-				PRODUCT_BUNDLE_IDENTIFIER = io.newuniverse.AppBuilder1;
+				MARKETING_VERSION = 5.0.3;
+				PRODUCT_BUNDLE_IDENTIFIER = io.newuniverse.AppBuilder;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE_SPECIFIER = "";
+				SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
+				SUPPORTS_MACCATALYST = NO;
+				SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
+				SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
 				SWIFT_VERSION = 5.0;
 				TARGETED_DEVICE_FAMILY = 1;
 			};
 			name = Release;
 		};
-		CDEE3DD229B06E1E00B420E5 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
-				CODE_SIGN_IDENTITY = "Apple Development";
-				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1;
-				DEVELOPMENT_TEAM = FR2C2CZUYZ;
-				GENERATE_INFOPLIST_FILE = YES;
-				INFOPLIST_FILE = NotificationService/Info.plist;
-				INFOPLIST_KEY_CFBundleDisplayName = NotificationService;
-				INFOPLIST_KEY_NSHumanReadableCopyright = "";
-				IPHONEOS_DEPLOYMENT_TARGET = 14.0;
-				LD_RUNPATH_SEARCH_PATHS = (
-					"$(inherited)",
-					"@executable_path/Frameworks",
-					"@executable_path/../../Frameworks",
-				);
-				MARKETING_VERSION = 1.0;
-				PRODUCT_BUNDLE_IDENTIFIER = io.newuniverse.AppBuilder1.NotificationService;
-				PRODUCT_NAME = "$(TARGET_NAME)";
-				SKIP_INSTALL = YES;
-				SWIFT_EMIT_LOC_STRINGS = YES;
-				SWIFT_VERSION = 5.0;
-				TARGETED_DEVICE_FAMILY = "1,2";
-			};
-			name = Debug;
-		};
-		CDEE3DD329B06E1E00B420E5 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
-				CODE_SIGN_IDENTITY = "Apple Development";
-				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1;
-				DEVELOPMENT_TEAM = FR2C2CZUYZ;
-				GENERATE_INFOPLIST_FILE = YES;
-				INFOPLIST_FILE = NotificationService/Info.plist;
-				INFOPLIST_KEY_CFBundleDisplayName = NotificationService;
-				INFOPLIST_KEY_NSHumanReadableCopyright = "";
-				IPHONEOS_DEPLOYMENT_TARGET = 14.0;
-				LD_RUNPATH_SEARCH_PATHS = (
-					"$(inherited)",
-					"@executable_path/Frameworks",
-					"@executable_path/../../Frameworks",
-				);
-				MARKETING_VERSION = 1.0;
-				PRODUCT_BUNDLE_IDENTIFIER = io.newuniverse.AppBuilder1.NotificationService;
-				PRODUCT_NAME = "$(TARGET_NAME)";
-				SKIP_INSTALL = YES;
-				SWIFT_EMIT_LOC_STRINGS = YES;
-				SWIFT_VERSION = 5.0;
-				TARGETED_DEVICE_FAMILY = "1,2";
-			};
-			name = Release;
-		};
 /* End XCBuildConfiguration section */
 
 /* Begin XCConfigurationList section */
@@ -658,15 +533,6 @@
 			defaultConfigurationIsVisible = 0;
 			defaultConfigurationName = Release;
 		};
-		CDEE3DD429B06E1E00B420E5 /* Build configuration list for PBXNativeTarget "NotificationService" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				CDEE3DD229B06E1E00B420E5 /* Debug */,
-				CDEE3DD329B06E1E00B420E5 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
 /* End XCConfigurationList section */
 	};
 	rootObject = 2401CE8E275490DB00B323BB /* Project object */;

+ 101 - 0
AppBuilder/AppBuilder.xcodeproj/xcshareddata/xcschemes/AppBuilderShare.xcscheme

@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+   LastUpgradeVersion = "1620"
+   wasCreatedForAppExtension = "YES"
+   version = "2.0">
+   <BuildAction
+      parallelizeBuildables = "YES"
+      buildImplicitDependencies = "YES"
+      buildArchitectures = "Automatic">
+      <BuildActionEntries>
+         <BuildActionEntry
+            buildForTesting = "YES"
+            buildForRunning = "YES"
+            buildForProfiling = "YES"
+            buildForArchiving = "YES"
+            buildForAnalyzing = "YES">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "CD2585A22D5486B4002AB416"
+               BuildableName = "AppBuilderShare.appex"
+               BlueprintName = "AppBuilderShare"
+               ReferencedContainer = "container:AppBuilder.xcodeproj">
+            </BuildableReference>
+         </BuildActionEntry>
+         <BuildActionEntry
+            buildForTesting = "YES"
+            buildForRunning = "YES"
+            buildForProfiling = "YES"
+            buildForArchiving = "YES"
+            buildForAnalyzing = "YES">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "2401CE95275490DB00B323BB"
+               BuildableName = "AppBuilder.app"
+               BlueprintName = "AppBuilder"
+               ReferencedContainer = "container:AppBuilder.xcodeproj">
+            </BuildableReference>
+         </BuildActionEntry>
+      </BuildActionEntries>
+   </BuildAction>
+   <TestAction
+      buildConfiguration = "Debug"
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      shouldUseLaunchSchemeArgsEnv = "YES"
+      shouldAutocreateTestPlan = "YES">
+   </TestAction>
+   <LaunchAction
+      buildConfiguration = "Debug"
+      selectedDebuggerIdentifier = ""
+      selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
+      launchStyle = "0"
+      askForAppToLaunch = "Yes"
+      useCustomWorkingDirectory = "NO"
+      ignoresPersistentStateOnLaunch = "NO"
+      debugDocumentVersioning = "YES"
+      debugServiceExtension = "internal"
+      allowLocationSimulation = "YES"
+      launchAutomaticallySubstyle = "2">
+      <RemoteRunnable
+         runnableDebuggingMode = "1"
+         BundleIdentifier = "com.apple.mobileslideshow"
+         RemotePath = "/Applications/MobileSlideShow.app">
+      </RemoteRunnable>
+      <MacroExpansion>
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "2401CE95275490DB00B323BB"
+            BuildableName = "AppBuilder.app"
+            BlueprintName = "AppBuilder"
+            ReferencedContainer = "container:AppBuilder.xcodeproj">
+         </BuildableReference>
+      </MacroExpansion>
+   </LaunchAction>
+   <ProfileAction
+      buildConfiguration = "Release"
+      shouldUseLaunchSchemeArgsEnv = "YES"
+      savedToolIdentifier = ""
+      useCustomWorkingDirectory = "NO"
+      debugDocumentVersioning = "YES"
+      askForAppToLaunch = "Yes"
+      launchAutomaticallySubstyle = "2">
+      <BuildableProductRunnable
+         runnableDebuggingMode = "0">
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "2401CE95275490DB00B323BB"
+            BuildableName = "AppBuilder.app"
+            BlueprintName = "AppBuilder"
+            ReferencedContainer = "container:AppBuilder.xcodeproj">
+         </BuildableReference>
+      </BuildableProductRunnable>
+   </ProfileAction>
+   <AnalyzeAction
+      buildConfiguration = "Debug">
+   </AnalyzeAction>
+   <ArchiveAction
+      buildConfiguration = "Release"
+      revealArchiveInOrganizer = "YES">
+   </ArchiveAction>
+</Scheme>

+ 10 - 0
AppBuilder/AppBuilder/AppBuilder.entitlements

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>aps-environment</key>
+	<string>development</string>
+	<key>com.apple.developer.calling-app</key>
+	<true/>
+</dict>
+</plist>

+ 44 - 72
AppBuilder/AppBuilder/SecondTabViewController.swift

@@ -36,9 +36,9 @@ class SecondTabViewController: UIViewController, UIScrollViewDelegate, UIGesture
     var noData = false
     
     let textViewSearch = UITextField()
-    let imageVoiceSb = UIImageView()
+    let buttonImageVoiceSb = UIButton(type: .custom)
     let imageNewChatSb = UIImageView()
-    let imageClearSearch = UIImageView()
+    let buttonImageClearSearch = UIButton(type: .custom)
     @IBOutlet weak var viewToolbar: UIView!
     @IBOutlet weak var heightToolbar: NSLayoutConstraint!
     var viewCategorySearch: UIScrollView!
@@ -179,7 +179,7 @@ class SecondTabViewController: UIViewController, UIScrollViewDelegate, UIGesture
         })
         
 //        var childrenMenu : [UIAction] = []
-//        
+//
 //        if(isAdmin){
 //            childrenMenu.append(UIAction(title: "Broadcast Message".localized(), image: UIImage(systemName: "envelope.open"), handler: {[weak self](_) in
 //                let controller = AppStoryBoard.Palio.instance.instantiateViewController(identifier: "broadcastNav")
@@ -195,7 +195,7 @@ class SecondTabViewController: UIViewController, UIScrollViewDelegate, UIGesture
 //        let viewbrodcast = UIButton(frame: CGRect(x: 0, y: 0, width: brodcastIcon.size.width, height: brodcastIcon.size.height))
 //        viewbrodcast.setImage(brodcastIcon, for: .normal)
 //        viewbrodcast.addTarget(self, action: #selector(openBroadcast), for: .touchUpInside)
-//        
+//
 //        menuItem = UIBarButtonItem(customView: viewStartConv)
 //        menuBroadcast = UIBarButtonItem(customView: viewbrodcast)
         
@@ -291,29 +291,30 @@ class SecondTabViewController: UIViewController, UIScrollViewDelegate, UIGesture
             imageText.font = .systemFont(ofSize: 15)
         }
         
-        let imageSetting = UIImageView(image: UIImage(named: "nx_setting_sb", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!)
-        imageSetting.contentMode = .scaleToFill
-        imageViewSearch.addSubview(imageSetting)
-        imageSetting.anchor(right: imageViewSearch.rightAnchor, paddingRight: 15, centerY: imageViewSearch.centerYAnchor, width: 20, height: 20)
-        imageSetting.isUserInteractionEnabled = true
-        imageSetting.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(settingTapped)))
+        let buttonImageSetting = UIButton(type: .custom)
+        let imageSetting = UIImage(named: "nx_setting_sb", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!
+        buttonImageSetting.backgroundColor = .clear
+        buttonImageSetting.setImage(imageSetting, for: .normal)
+        imageViewSearch.addSubview(buttonImageSetting)
+        buttonImageSetting.anchor(right: imageViewSearch.rightAnchor, paddingRight: 15, centerY: imageViewSearch.centerYAnchor, width: 20, height: 20)
+        buttonImageSetting.addTarget(self, action: #selector(settingTapped), for: .touchUpInside)
         
-        imageVoiceSb.image = UIImage(named: "nx_mic", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!
-        imageVoiceSb.contentMode = .scaleAspectFit
-        imageViewSearch.addSubview(imageVoiceSb)
-        imageVoiceSb.anchor(right: imageSetting.leftAnchor, paddingRight: 10, centerY: imageViewSearch.centerYAnchor, width: 20, height: 20)
-        imageVoiceSb.isUserInteractionEnabled = true
-        imageVoiceSb.isHidden = true
-        imageVoiceSb.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(recordAudio)))
+        let imageVoiceSb = UIImage(named: "nx_mic", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!
+        buttonImageVoiceSb.setImage(imageVoiceSb, for: .normal)
+        buttonImageVoiceSb.imageView?.contentMode = .scaleAspectFit
+        imageViewSearch.addSubview(buttonImageVoiceSb)
+        buttonImageVoiceSb.anchor(right: buttonImageSetting.leftAnchor, paddingRight: 10, centerY: imageViewSearch.centerYAnchor, width: 20, height: 20)
+        buttonImageVoiceSb.isHidden = true
+        buttonImageVoiceSb.addTarget(self, action: #selector(recordAudio), for: .touchUpInside)
         
-        imageClearSearch.image = UIImage(systemName: "xmark")
-        imageClearSearch.contentMode = .scaleAspectFit
-        imageClearSearch.tintColor = .gray
-        imageViewSearch.addSubview(imageClearSearch)
-        imageClearSearch.anchor(right: imageVoiceSb.leftAnchor, paddingRight: 5, centerY: imageViewSearch.centerYAnchor, width: 20, height: 20)
-        imageClearSearch.isUserInteractionEnabled = true
-        imageClearSearch.isHidden = true
-        imageClearSearch.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(clearSearch)))
+        let imageClearSearch = UIImage(systemName: "xmark")
+        buttonImageClearSearch.setImage(imageClearSearch, for: .normal)
+        buttonImageClearSearch.imageView?.contentMode = .scaleAspectFit
+        buttonImageClearSearch.tintColor = .gray
+        imageViewSearch.addSubview(buttonImageClearSearch)
+        buttonImageClearSearch.anchor(right: buttonImageVoiceSb.leftAnchor, paddingRight: 5, centerY: imageViewSearch.centerYAnchor, width: 20, height: 20)
+        buttonImageClearSearch.isHidden = true
+        buttonImageClearSearch.addTarget(self, action: #selector(clearSearch), for: .touchUpInside)
         
         textViewSearch.placeholder = "Search...".localized()
         textViewSearch.isUserInteractionEnabled = true
@@ -389,10 +390,10 @@ class SecondTabViewController: UIViewController, UIScrollViewDelegate, UIGesture
             tableView.isHidden = false
         }
         textViewSearch.text = ""
-        imageClearSearch.isHidden = true
+        buttonImageClearSearch.isHidden = true
         if !textViewSearch.isFirstResponder {
             viewCategorySearch.isHidden = true
-            imageVoiceSb.isHidden = true
+            buttonImageVoiceSb.isHidden = true
             heightToolbar.constant = 45
             filterContentForSearchText("")
         } else if heightToolbar.constant == 45 {
@@ -642,10 +643,10 @@ class SecondTabViewController: UIViewController, UIScrollViewDelegate, UIGesture
         if textField == textViewSearch {
             var textSerch = textField.text ?? ""
             textSerch = textSerch.trimmingCharacters(in: .whitespacesAndNewlines)
-            if !textSerch.isEmpty && imageClearSearch.isHidden {
-                imageClearSearch.isHidden = false
-            } else if textSerch.isEmpty && !imageClearSearch.isHidden {
-                imageClearSearch.isHidden = true
+            if !textSerch.isEmpty && buttonImageClearSearch.isHidden {
+                buttonImageClearSearch.isHidden = false
+            } else if textSerch.isEmpty && !buttonImageClearSearch.isHidden {
+                buttonImageClearSearch.isHidden = true
             }
             if textField.text?.count == 1 && leftTVSearch.constant != 20 {
                 selectedTag = 0
@@ -673,7 +674,7 @@ class SecondTabViewController: UIViewController, UIScrollViewDelegate, UIGesture
             if segment.selectedSegmentIndex == 0 && (viewCatInTV == nil || !viewCatInTV.isDescendant(of: imageViewSearch)) {
                 heightToolbar.constant = 85
                 viewCategorySearch.isHidden = false
-                imageVoiceSb.isHidden = false
+                buttonImageVoiceSb.isHidden = false
             }
         }
     }
@@ -683,7 +684,7 @@ class SecondTabViewController: UIViewController, UIScrollViewDelegate, UIGesture
             if let text = textField.text {
                 if text.isEmpty {
                     viewCategorySearch.isHidden = true
-                    imageVoiceSb.isHidden = true
+                    buttonImageVoiceSb.isHidden = true
                     heightToolbar.constant = 45
                 }
             }
@@ -796,42 +797,8 @@ class SecondTabViewController: UIViewController, UIScrollViewDelegate, UIGesture
     }
     
     @objc func onReceiveMessage(notification: NSNotification) {
-        DispatchQueue.main.async { [self] in
-            let data:[AnyHashable : Any] = notification.userInfo!
-            if let dataMessage = data["message"] as? TMessage {
-                let chatData = dataMessage.mBodies
-                if chatData[CoreMessage_TMessageKey.IS_CALL_CENTER] == nil || chatData[CoreMessage_TMessageKey.IS_CALL_CENTER] == "0" {
-                    var indexChat: Int?
-                    if chatData[CoreMessage_TMessageKey.MESSAGE_SCOPE_ID] == "3" {
-                        let f_pin = chatData[CoreMessage_TMessageKey.F_PIN] != User.getMyPin() ? chatData[CoreMessage_TMessageKey.F_PIN] : chatData[CoreMessage_TMessageKey.L_PIN]
-                        indexChat = chats.firstIndex(where: { $0.pin == f_pin })
-                    } else if chatData[CoreMessage_TMessageKey.MESSAGE_SCOPE_ID] == "4" && chatData[CoreMessage_TMessageKey.F_PIN] != User.getMyPin() {
-                        indexChat = chats.firstIndex(where: { (chatData[CoreMessage_TMessageKey.CHAT_ID] ?? "").isEmpty ? $0.pin == chatData[CoreMessage_TMessageKey.L_PIN] : $0.pin == chatData[CoreMessage_TMessageKey.CHAT_ID] })
-                    }
-                    let newChat = Chat.getData(messageId: chatData[CoreMessage_TMessageKey.MESSAGE_ID] ?? "")
-                    if newChat.count > 0 {
-                        if indexChat != nil {
-                            chats.remove(at: indexChat!)
-                            chats.insert(newChat[0], at: 0)
-                            if segment.selectedSegmentIndex == 0 {
-                                let indexPathToMove = IndexPath(row: indexChat!, section: 0)
-                                let indexPathNewPosition = IndexPath(row: 0, section: 0)
-                                tableView.performBatchUpdates({
-                                    tableView.moveRow(at: indexPathToMove, to: indexPathNewPosition)
-                                }, completion: nil)
-                                tableView.beginUpdates()
-                                tableView.reloadRows(at: [IndexPath(row: 0, section: 0)], with: .none)
-                                tableView.endUpdates()
-                            } else {
-                                tableView.reloadData()
-                            }
-                        } else {
-                            chats.insert(newChat[0], at: 0)
-                            tableView.reloadData()
-                        }
-                    }
-                }
-            }
+        DispatchQueue.main.async {
+            self.getData()
         }
     }
     
@@ -1802,7 +1769,7 @@ extension SecondTabViewController: UITableViewDelegate, UITableViewDataSource {
             messageView.translatesAutoresizingMaskIntoConstraints = false
             NSLayoutConstraint.activate([
                 messageView.leadingAnchor.constraint(equalTo: imageView.trailingAnchor, constant: 10.0),
-                messageView.topAnchor.constraint(equalTo: titleView.bottomAnchor, constant: 5.0),
+                messageView.topAnchor.constraint(equalTo: titleView.bottomAnchor),
                 messageView.trailingAnchor.constraint(equalTo: content.trailingAnchor, constant: -40.0),
             ])
             messageView.textColor = .gray
@@ -1836,7 +1803,7 @@ extension SecondTabViewController: UITableViewDelegate, UITableViewDataSource {
                         } else {
                             imageStatus.image = UIImage(named: "double-checklist", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!.withTintColor(UIColor.systemBlue)
                         }
-                        imageStatus.bounds = CGRect(x: 0, y: -2, width: 15, height: 15)
+                        imageStatus.bounds = CGRect(x: 0, y: -5, width: 15, height: 15)
                         let imageStatusString = NSAttributedString(attachment: imageStatus)
                         stringMessage.append(imageStatusString)
                         stringMessage.append(NSAttributedString(string: " "))
@@ -1847,7 +1814,12 @@ extension SecondTabViewController: UITableViewDelegate, UITableViewDataSource {
                     }
                 } else {
                     if data.messageScope == "4" {
-                        stringMessage.append(NSAttributedString(string: User.getData(pin: data.fpin)!.firstName + ": ", attributes: [NSAttributedString.Key.font: UIFont.systemFont(ofSize: 12, weight: .medium)]))
+                        var fullname = User.getData(pin: data.fpin, lPin: data.pin)!.fullName
+                        let components = fullname.split(separator: " ")
+                        if components.count >= 2 {
+                            fullname = components.prefix(2).joined(separator: " ")
+                        }
+                        stringMessage.append(NSAttributedString(string: fullname + ": ", attributes: [NSAttributedString.Key.font: UIFont.systemFont(ofSize: 12, weight: .medium)]))
                     }
                     if data.lock == "1" {
                         stringMessage.append(("🚫 _"+"This message was deleted".localized()+"_").richText())

+ 0 - 21
AppBuilder/NotificationService/Info.plist

@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>NSExtension</key>
-	<dict>
-		<key>NSExtensionAttributes</key>
-		<dict>
-			<key>IntentsSupported</key>
-			<array>
-				<string>INSendMessageIntent</string>
-				<string></string>
-			</array>
-		</dict>
-		<key>NSExtensionPointIdentifier</key>
-		<string>com.apple.usernotifications.service</string>
-		<key>NSExtensionPrincipalClass</key>
-		<string>$(PRODUCT_MODULE_NAME).NotificationService</string>
-	</dict>
-</dict>
-</plist>

+ 0 - 81
AppBuilder/NotificationService/NotificationService.swift

@@ -1,81 +0,0 @@
-//
-//  NotificationService.swift
-//  BeautifulIndonesiaNotificationService
-//
-//  Created by Akhmad Al Qindi Irsyam on 01/03/23.
-//
-
-import UserNotifications
-import Intents
-import UIKit
-
-class NotificationService: UNNotificationServiceExtension {
-
-    var contentHandler: ((UNNotificationContent) -> Void)?
-    var bestAttemptContent: UNMutableNotificationContent?
-
-    override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
-        self.contentHandler = contentHandler
-        bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent)
-        
-        guard let bestAttemptContent = bestAttemptContent else {
-            return
-        }
-        
-        // Check if the notification is a communication notification
-        let categoryIdentifier = bestAttemptContent.categoryIdentifier
-        if categoryIdentifier != "chat" {
-            contentHandler(bestAttemptContent)
-            return
-        }
-        
-        let avatarDefault = INImage(imageData: UIImage(systemName: "person.circle.fill")!.withTintColor(.gray).pngData()!)
-        var sender = INPerson(personHandle: INPersonHandle(value: "02cdfdfdac", type: .unknown), nameComponents: nil, displayName: "Meme", image: avatarDefault, contactIdentifier: "02cdfdfdac", customIdentifier: "02cdfdfdac")
-        
-//        sender = INPerson(personHandle: INPersonHandle(value: "02cdfdfdac", type: .unknown), nameComponents: nil, displayName: "Meme", image: INImage(url: URL(string: "https://i.pinimg.com/474x/69/77/b7/6977b70a129ec184527433bbdf9fe457.jpg")!), contactIdentifier: "02cdfdfdac", customIdentifier: nil)
-        
-//        let nsDocumentDirectory = FileManager.SearchPathDirectory.documentDirectory
-//        let nsUserDomainMask = FileManager.SearchPathDomainMask.userDomainMask
-//        let paths = NSSearchPathForDirectoriesInDomains(nsDocumentDirectory, nsUserDomainMask, true)
-//        if let dirPath = paths.first {
-//            let fileURL = URL(fileURLWithPath: dirPath).appendingPathComponent("6977b70a129ec184527433bbdf9fe457.jpg")
-//            if FileManager.default.fileExists(atPath: fileURL.path) {
-//                sender = INPerson(personHandle: INPersonHandle(value: "02cdfdfdac", type: .unknown), nameComponents: nil, displayName: "Hansen", image: INImage(url: ), contactIdentifier: "02cdfdfdac", customIdentifier: nil)
-//            }
-//        }
-
-        let incomingMessageIntent = INSendMessageIntent(recipients: [sender], outgoingMessageType: .outgoingMessageText, content: nil, speakableGroupName: INSpeakableString(spokenPhrase: "Test Group"), conversationIdentifier: "Test Group", serviceName: nil, sender: sender, attachments: nil)
-        incomingMessageIntent.setImage(avatarDefault, forParameterNamed: \.speakableGroupName)
-
-        let interaction = INInteraction(intent: incomingMessageIntent, response: nil)
-        interaction.direction = .incoming
-        interaction.donate { error in
-            if let error = error {
-                contentHandler(bestAttemptContent)
-                return
-            }
-            
-            let content = UNMutableNotificationContent()
-            content.subtitle = "testing subTitle"
-            content.body = "testing body"
-            content.sound = .default
-            let myRequest = UNNotificationRequest(identifier: "02cdfdfdac", content: content, trigger: nil)
-            let myContent = myRequest.content
-
-            do {
-                // Update notification content before displaying the
-                // communication notification.
-                if #available(iOSApplicationExtension 15.0, *) {
-                    let updatedContent = try myContent.updating(from: incomingMessageIntent)
-                    contentHandler(updatedContent)
-                } else {
-                    contentHandler(bestAttemptContent)
-                }
-
-            } catch {
-                contentHandler(bestAttemptContent)
-            }
-        }
-    }
-
-}

+ 1 - 1
AppBuilder/Podfile

@@ -1,5 +1,5 @@
 # Uncomment the next line to define a global platform for your project
-# platform :ios, '9.0'
+platform :ios, '14.0'
 
 target 'AppBuilder' do
   # Comment the next line if you don't want to use dynamic frameworks

+ 1 - 1
NexilisLite/NexilisLite.podspec

@@ -24,7 +24,7 @@ Pod::Spec.new do |spec|
   spec.resource_bundles = { 'NexilisLite' => ['NexilisLite/Resource/**/*']}
   spec.swift_version = '5.5.1'
   spec.dependency 'FMDB', '~> 2.7.12'
-  spec.dependency 'nuSDKService', '~> 3.0.3'
+  spec.dependency 'nuSDKService', '~> 4.0.2'
   spec.dependency 'NotificationBannerSwift', '~> 3.1.0'
   spec.dependency 'Alamofire', '~> 5.10.1'
   spec.dependency 'SDWebImage', '~> 5.20.0'

+ 135 - 120
NexilisLite/NexilisLite/Source/APIS.swift

@@ -833,141 +833,156 @@ public class APIS: NSObject {
 //            }
 //        }
         if checkAppStateisBackground() {
-            print("showNotificationNexilis1: \(userInfo)")
-            if let payload = userInfo["payload"] as? [String: Any] {
-                if let messagePayload = payload["message"] as? [String: Any] {
-                    if let data = messagePayload["data"] as? [String: Any] {
-                        let code = data["nx_code"] as? String ?? ""
-                        if code == "CL01" {
-                            if let message = data["bodies"] as? [String: Any] {
-                                var text = message[CoreMessage_TMessageKey.MESSAGE_TEXT] as? String ?? ""
-                                let nameUser = message[CoreMessage_TMessageKey.F_DISPLAY_NAME] as? String ?? ""
-                                let threadIdentifier = message[CoreMessage_TMessageKey.OPPOSITE_PIN] as? String ?? ""
-                                var nameSubtitle = ""
-                                let imageId = CoreMessage_TMessageKey.IMAGE_ID
-                                let videoId = CoreMessage_TMessageKey.VIDEO_ID
-                                let fileId = CoreMessage_TMessageKey.FILE_ID
-                                let audioId = CoreMessage_TMessageKey.AUDIO_ID
-                                let attachmentFlag = CoreMessage_TMessageKey.ATTACHMENT_FLAG
-                                let messageScopeId = CoreMessage_TMessageKey.MESSAGE_SCOPE_ID
-                                let credential = CoreMessage_TMessageKey.CREDENTIAL
-                                let gif_id = CoreMessage_TMessageKey.GIF_ID
-                                let is_secret = CoreMessage_TMessageKey.IS_SECRET
-                                if (message[is_secret] as? String ?? "") == "1" {
-                                  text = "You got messages..."
-                                } else if (message[gif_id] as? String ?? "") != "" {
-                                  text = "Sent GIF 🎬"
-                                } else if !(message[imageId] as? String ?? "").isEmpty {
-                                    text = "Sent Image 📷"
-                                } else if (message[attachmentFlag] as? String ?? "") == "11" {
-                                    text = "Sent Sticker ❤️"
-                                } else if !(message[videoId] as? String ?? "").isEmpty {
-                                    text = "Sent Video 📹"
-                                } else if !(message[fileId] as? String ?? "").isEmpty {
-                                    if (message[messageScopeId] as? String ?? "") == "18" {
-                                        text = "Sent Form 📄"
-                                    } else {
-                                        text = "Sent File 📄"
+            do {
+                let id = Utils.getConnectionID()
+                try API.initConnection(bSwitchIP: false, sAPIK: Nexilis.sAPIKey, aAppMain: nil, cbiI: Callback(), sTCPAddr: Nexilis.ADDRESS, nTCPPort: Nexilis.PORT, sUserID: id, sStartWH: "09:00")
+            } catch {
+                
+            }
+            DispatchQueue.main.async {
+                while (!API.bnuSDKServiceReady() || API.nGetCLXConnState() == 0) {
+                    Thread.sleep(forTimeInterval: 1)
+                }
+                if let payload = userInfo["payload"] as? [String: Any] {
+                    if let messagePayload = payload["message"] as? [String: Any] {
+                        if let data = messagePayload["data"] as? [String: Any] {
+                            let code = data["nx_code"] as? String ?? ""
+                            if code == "CL01" {
+                                if let message = data["bodies"] as? [String: String] {
+                                    let messageToSave = TMessage()
+                                    messageToSave.mBodies = message
+                                    Nexilis.saveMessage(message: messageToSave, withStatus: false, fromAPNS: true)
+                                    _ = Nexilis.write(message: CoreMessage_TMessageBank.getAckMessage(messageId: message[CoreMessage_TMessageKey.MESSAGE_ID] ?? ""))
+                                    var text = message[CoreMessage_TMessageKey.MESSAGE_TEXT] ?? ""
+                                    text = text.toNormalString()
+                                    let nameUser = message[CoreMessage_TMessageKey.F_DISPLAY_NAME] ?? ""
+                                    let threadIdentifier = message[CoreMessage_TMessageKey.OPPOSITE_PIN] ?? ""
+                                    var nameSubtitle = ""
+                                    let imageId = CoreMessage_TMessageKey.IMAGE_ID
+                                    let videoId = CoreMessage_TMessageKey.VIDEO_ID
+                                    let fileId = CoreMessage_TMessageKey.FILE_ID
+                                    let audioId = CoreMessage_TMessageKey.AUDIO_ID
+                                    let attachmentFlag = CoreMessage_TMessageKey.ATTACHMENT_FLAG
+                                    let messageScopeId = CoreMessage_TMessageKey.MESSAGE_SCOPE_ID
+                                    let credential = CoreMessage_TMessageKey.CREDENTIAL
+                                    let gif_id = CoreMessage_TMessageKey.GIF_ID
+                                    let is_secret = CoreMessage_TMessageKey.IS_SECRET
+                                    if (message[is_secret] ?? "") == "1" {
+                                      text = "You got messages..."
+                                    } else if (message[gif_id] ?? "") != "" {
+                                      text = "Sent GIF 🎬"
+                                    } else if !(message[imageId] ?? "").isEmpty {
+                                        text = "Sent Image 📷"
+                                    } else if (message[attachmentFlag] ?? "") == "11" {
+                                        text = "Sent Sticker ❤️"
+                                    } else if !(message[videoId] ?? "").isEmpty {
+                                        text = "Sent Video 📹"
+                                    } else if !(message[fileId] ?? "").isEmpty {
+                                        if (message[messageScopeId] ?? "") == "18" {
+                                            text = "Sent Form 📄"
+                                        } else {
+                                            text = "Sent File 📄"
+                                        }
+                                    } else if !(message[audioId] ?? "").isEmpty {
+                                        text = "Sent Audio ♫"
+                                    } else if text.contains("Share%20location%20") {
+                                        text = "Sent Location 📌"
+                                    } else if (message[attachmentFlag] ?? "") == "27" {
+                                        text = "Sent Live Streaming"
+                                    } else if (message[attachmentFlag] ?? "") == "26" {
+                                        text = "Sent Seminar"
+                                    } else if (message[attachmentFlag] ?? "") == "25" {
+                                        text = "Sent Video Conference Room"
+                                    } else if (message[attachmentFlag] ?? "") == "24" {
+                                        text = "Sent Quiz"
+                                    } else if (message[credential] ?? "") == "1" {
+                                        text = "Sent Confidential Message"
+                                    }
+                                    let center = UNUserNotificationCenter.current()
+                                    let content = UNMutableNotificationContent()
+                                    content.title = nameUser
+                                    content.body = text
+                                    content.sound = .default
+                                    var type = "1"
+                                    if (message[messageScopeId] ?? "") == "3" || (message[messageScopeId] ?? "") == "18" || (message[messageScopeId] ?? "") == "5"{
+                                        type = "0"
+                                    }
+                                    var nameTopic = "Lounge".localized()
+                                    var idGroup = ""
+                                    Database.shared.database?.inTransaction({ (fmdb, rollback) in
+                                        do {
+                                            if let cursor = Database.shared.getRecords(fmdb: fmdb, query: "SELECT title, group_id FROM DISCUSSION_FORUM WHERE chat_id='\(threadIdentifier)'"), cursor.next() {
+                                                nameTopic = cursor.string(forColumnIndex: 0) ?? ""
+                                                idGroup = cursor.string(forColumnIndex: 1) ?? ""
+                                                cursor.close()
+                                            }
+                                            if idGroup.isEmpty {
+                                                idGroup = threadIdentifier
+                                            }
+                                            if let cursorGroup = Database.shared.getRecords(fmdb: fmdb, query: "SELECT f_name, image_id FROM GROUPZ WHERE group_id='\(idGroup)'"), cursorGroup.next() {
+                                                let nameGroup = cursorGroup.string(forColumnIndex: 0) ?? ""
+                                                nameSubtitle = "\(nameGroup)(\(nameTopic))"
+                                                cursorGroup.close()
+                                            }
+                                        } catch {
+                                            rollback.pointee = true
+                                            print("Access database error: \(error.localizedDescription)")
+                                        }
+                                    })
+                                    if type == "1" {
+                                        content.subtitle = nameSubtitle
+                                    }
+                                    content.userInfo = ["id" : threadIdentifier, "type" : type]
+                                    content.sound = UNNotificationSound(named: UNNotificationSoundName("pb_call_in.mp3"))
+                                    let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 1, repeats: false)
+                                    let request = UNNotificationRequest(identifier: threadIdentifier, content: content, trigger: trigger)
+                                    center.add(request) { error in
+                                        if let error = error {
+                                            print("Error scheduling notification: \(error.localizedDescription)")
+                                        }
                                     }
-                                } else if !(message[audioId] as? String ?? "").isEmpty {
-                                    text = "Sent Audio ♫"
-                                } else if text.contains("Share%20location%20") {
-                                    text = "Sent Location 📌"
-                                } else if (message[attachmentFlag] as? String ?? "") == "27" {
-                                    text = "Sent Live Streaming"
-                                } else if (message[attachmentFlag] as? String ?? "") == "26" {
-                                    text = "Sent Seminar"
-                                } else if (message[attachmentFlag] as? String ?? "") == "25" {
-                                    text = "Sent Video Conference Room"
-                                } else if (message[attachmentFlag] as? String ?? "") == "24" {
-                                    text = "Sent Quiz"
-                                } else if (message[credential] as? String ?? "") == "1" {
-                                    text = "Sent Confidential Message"
                                 }
+                            } else if code == "CL03" {
+                                let callFromName = data["call-from-name"] as? String ?? ""
+                                let callFrom = data["call-from"] as? String ?? ""
+                                let callType = data["call-type"] as? String ?? ""
+                                uuidCall = UUID()
+                                fpinCall = callFrom
+                                Nexilis.callAPNActivated = true
+    //                                    CallManager.shared.reportIncomingCall(uuid: uuidCall!, callerName: callFromName, callerId: callFrom, isVideo: callType != "1") { error in
+    //                                        if let error = error {
+    //                                            print("Error reporting incoming call: \(error.localizedDescription)")
+    //                                        } else {
+    //                                            print("Incoming call reported successfully")
+    //                                        }
+    //                                    }
                                 copySoundToLocalPath()
                                 let center = UNUserNotificationCenter.current()
                                 let content = UNMutableNotificationContent()
-                                content.title = nameUser
-                                content.body = text
-                                var type = "1"
-                                if (message[messageScopeId] as? String ?? "") == "3" || (message[messageScopeId] as? String ?? "") == "18" || (message[messageScopeId] as? String ?? "") == "5"{
-                                    type = "0"
-                                }
-                                var nameTopic = "Lounge".localized()
-                                var idGroup = ""
-                                Database.shared.database?.inTransaction({ (fmdb, rollback) in
-                                    do {
-                                        if let cursor = Database.shared.getRecords(fmdb: fmdb, query: "SELECT title, group_id FROM DISCUSSION_FORUM WHERE chat_id='\(threadIdentifier)'"), cursor.next() {
-                                            nameTopic = cursor.string(forColumnIndex: 0) ?? ""
-                                            idGroup = cursor.string(forColumnIndex: 1) ?? ""
-                                            cursor.close()
-                                        }
-                                        if idGroup.isEmpty {
-                                            idGroup = threadIdentifier
-                                        }
-                                        if let cursorGroup = Database.shared.getRecords(fmdb: fmdb, query: "SELECT f_name, image_id FROM GROUPZ WHERE group_id='\(idGroup)'"), cursorGroup.next() {
-                                            let nameGroup = cursorGroup.string(forColumnIndex: 0) ?? ""
-                                            nameSubtitle = "\(nameGroup)(\(nameTopic))"
-                                            cursorGroup.close()
-                                        }
-                                    } catch {
-                                        rollback.pointee = true
-                                        print("Access database error: \(error.localizedDescription)")
-                                    }
-                                })
-                                if type == "1" {
-                                    content.subtitle = nameSubtitle
+                                content.title = callFromName
+                                if callType == "1" {
+                                    content.body = "Incoming Audio Call".localized()
+                                } else {
+                                    content.body = "Incoming Video Call".localized()
                                 }
-                                content.userInfo = ["id" : threadIdentifier, "type" : type]
+                                content.userInfo = ["id" : callFrom, "type" : code, "callType": callType]
                                 content.sound = UNNotificationSound(named: UNNotificationSoundName("pb_call_in.mp3"))
                                 let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 1, repeats: false)
-                                let request = UNNotificationRequest(identifier: threadIdentifier, content: content, trigger: trigger)
+                                let request = UNNotificationRequest(identifier: "\(uuidCall!)", content: content, trigger: trigger)
                                 center.add(request) { error in
                                     if let error = error {
                                         print("Error scheduling notification: \(error.localizedDescription)")
                                     }
                                 }
-                            }
-                        } else if code == "CL03" {
-                            let callFromName = data["call-from-name"] as? String ?? ""
-                            let callFrom = data["call-from"] as? String ?? ""
-                            let callType = data["call-type"] as? String ?? ""
-                            uuidCall = UUID()
-                            fpinCall = callFrom
-                            Nexilis.callAPNActivated = true
-//                                    CallManager.shared.reportIncomingCall(uuid: uuidCall!, callerName: callFromName, callerId: callFrom, isVideo: callType != "1") { error in
-//                                        if let error = error {
-//                                            print("Error reporting incoming call: \(error.localizedDescription)")
-//                                        } else {
-//                                            print("Incoming call reported successfully")
-//                                        }
-//                                    }
-                            copySoundToLocalPath()
-                            let center = UNUserNotificationCenter.current()
-                            let content = UNMutableNotificationContent()
-                            content.title = callFromName
-                            if callType == "1" {
-                                content.body = "Incoming Audio Call".localized()
-                            } else {
-                                content.body = "Incoming Video Call".localized()
-                            }
-                            content.userInfo = ["id" : callFrom, "type" : code, "callType": callType]
-                            content.sound = UNNotificationSound(named: UNNotificationSoundName("pb_call_in.mp3"))
-                            let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 1, repeats: false)
-                            let request = UNNotificationRequest(identifier: "\(uuidCall!)", content: content, trigger: trigger)
-                            center.add(request) { error in
-                                if let error = error {
-                                    print("Error scheduling notification: \(error.localizedDescription)")
+                            } else if code == "CL02" {
+                                if let uuidCall = uuidCall {
+                                    Nexilis.callAPNActivated = false
+                                    let center = UNUserNotificationCenter.current()
+                                    center.removePendingNotificationRequests(withIdentifiers: ["\(uuidCall)"])
+                                    center.removeDeliveredNotifications(withIdentifiers: ["\(uuidCall)"])
+    //                                    CallManager.shared.endCall(with: uuidCall)
                                 }
                             }
-                        } else if code == "CL02" {
-                            if let uuidCall = uuidCall {
-                                Nexilis.callAPNActivated = false
-                                let center = UNUserNotificationCenter.current()
-                                center.removePendingNotificationRequests(withIdentifiers: ["\(uuidCall)"])
-                                center.removeDeliveredNotifications(withIdentifiers: ["\(uuidCall)"])
-//                                    CallManager.shared.endCall(with: uuidCall)
-                            }
                         }
                     }
                 }

+ 0 - 1
NexilisLite/NexilisLite/Source/Extension.swift

@@ -760,7 +760,6 @@ extension String {
         let boldItalicFont = UIFont.systemFont(ofSize: 12, weight: .semibold)
         let textUTF8 = String(self.utf8)
         let finalText = NSMutableAttributedString(string: textUTF8, attributes: [NSAttributedString.Key.font: font])
-// finalText.addAttribute(.foregroundColor, value: UIApplication.shared.visibleViewController?.traitCollection.userInterfaceStyle == .dark ? UIColor.white : UIColor.black, range: NSRange(location: 0, length: finalText.length + textUTF8.countEmojiCharacter()))
         let boldSign: Character = "*"
         let italicSign: Character = "_"
         let underlineSign: Character = "^"

+ 2 - 0
NexilisLite/NexilisLite/Source/IncomingThread.swift

@@ -316,11 +316,13 @@ class IncomingThread {
     
     private func notifyCalling(message: TMessage) -> Void {
         let lPin = message.getBody(key: CoreMessage_TMessageKey.L_PIN)
+        let fPin = message.getBody(key: CoreMessage_TMessageKey.F_PIN)
         if let packetId = message.mBodies[CoreMessage_TMessageKey.PACKET_ID] {
             _ = Nexilis.responseString(packetId: packetId, message: "00", timeout: 3000)
         }
         var dataMessage: [AnyHashable : Any] = [:]
         dataMessage["l_pin"] = lPin
+        dataMessage["f_pin"] = fPin
         NotificationCenter.default.post(name: NSNotification.Name(rawValue: Nexilis.callFCM), object: nil, userInfo: dataMessage)
     }
     

+ 12 - 23
NexilisLite/NexilisLite/Source/Model/Chat.swift

@@ -134,8 +134,8 @@ public class Chat: Model {
                 } else if isAudio {
                     lastQuery = "m.audio_id IS NOT NULL AND m.audio_id != ''"
                 }
-                let query = """
-                            select m.f_pin, \(!lastQuery.isEmpty ? "m.l_pin, m.message_id" : "ms.l_pin, ms.message_id"), \(!lastQuery.isEmpty ? "m.thumb_id," : "ms.counter,") m.message_text, m.server_date, m.image_id, m.video_id, m.file_id, m.attachment_flag, m.message_scope_id, b.first_name || ' ' || ifnull(b.last_name, '') name, b.image_id profile, b.official_account, m.status, m.credential, m.lock, m.audio_id, m.gif_id from MESSAGE_SUMMARY ms, MESSAGE m, BUDDY b where ms.l_pin = b.f_pin and \(!lastQuery.isEmpty ? lastQuery : "ms.message_id = m.message_id \(messageId.isEmpty ? "" : " and m.message_id = '\(messageId)'")") and m.is_call_center = 0
+                var query = """
+                            select m.f_pin, ms.l_pin, ms.message_id, ms.counter, m.message_text, m.server_date, m.image_id, m.video_id, m.file_id, m.attachment_flag, m.message_scope_id, b.first_name || ' ' || ifnull(b.last_name, '') name, b.image_id profile, b.official_account, m.status, m.credential, m.lock, m.audio_id, m.gif_id from MESSAGE_SUMMARY ms, MESSAGE m, BUDDY b where ms.l_pin = b.f_pin and ms.message_id = m.message_id \(messageId.isEmpty ? "" : " and m.message_id = '\(messageId)'") and m.is_call_center = 0
                             union
                             select m.f_pin, ms.l_pin, ms.message_id, ms.counter, m.message_text, m.server_date, m.image_id, m.video_id, m.file_id, m.attachment_flag, m.message_scope_id, 'Bot' name, '' profile, '', m.status, m.credential, m.lock, m.audio_id, m.gif_id from MESSAGE_SUMMARY ms, MESSAGE m where ms.l_pin = '-999' and "ms.message_id = m.message_id \(messageId.isEmpty ? "" : " and m.message_id = '\(messageId)'")" and m.is_call_center = 0
                             union
@@ -146,9 +146,12 @@ public class Chat: Model {
                             select m.f_pin, ms.l_pin, ms.message_id, ms.counter, m.message_text, m.server_date, m.image_id, m.video_id, m.file_id, m.attachment_flag, m.message_scope_id, c.f_name || ' (' || b.title || ')', c.image_id profile, '', m.status, m.credential, m.lock, m.audio_id, m.gif_id from MESSAGE_SUMMARY ms, MESSAGE m, DISCUSSION_FORUM b, GROUPZ c where b.group_id = c.group_id and ms.l_pin = b.chat_id and ms.message_id = m.message_id \(messageId.isEmpty ? "" : " and m.message_id = '\(messageId)'") and m.is_call_center = 0
                             order by 6 desc
                             """
+                if !lastQuery.isEmpty {
+                    query = "select m.f_pin, m.opposite_pin, m.message_id, m.thumb_id, m.message_text, m.server_date, m.image_id, m.video_id, m.file_id, m.attachment_flag, m.message_scope_id, b.first_name || ' ' || ifnull(b.last_name, '') name, b.image_id profile, b.official_account, m.credential, m.lock, m.audio_id, m.gif_id from MESSAGE m JOIN BUDDY b ON m.f_pin = b.f_pin where \(lastQuery) order by 6 desc"
+                }
                 if let cursorData = Database.shared.getRecords(fmdb: fmdb, query: query) {
                     while cursorData.next() {
-                        if !lastQuery.isEmpty {
+//                        if !lastQuery.isEmpty {
 //                            for columnIndex in 0..<cursorData.columnCount {
 //                                if let columnName = cursorData.columnName(for: columnIndex) {
 //                                    if let value = cursorData.object(forColumn: columnName) {
@@ -159,10 +162,7 @@ public class Chat: Model {
 //                                }
 //                            }
 //                            print("---------------------")
-                            if (isImage || isVideo) && cursorData.string(forColumnIndex: 3) == "0" {
-                                continue
-                            }
-                        }
+//                        }
                         let chat = Chat(fpin: cursorData.string(forColumnIndex: 0) ?? "",
                                         pin: cursorData.string(forColumnIndex: 1) ?? "",
                                         messageId: cursorData.string(forColumnIndex: 2) ?? "",
@@ -178,25 +178,14 @@ public class Chat: Model {
                                         profile: cursorData.string(forColumnIndex: 12) ?? "",
                                         official: cursorData.string(forColumnIndex: 13) ?? "",
                                         status: cursorData.string(forColumnIndex: 14) ?? "",
-                                        credential: cursorData.string(forColumnIndex: 15) ?? "",
-                                        lock: cursorData.string(forColumnIndex: 16) ?? "",
-                                        thumb: lastQuery.isEmpty ? "" : cursorData.string(forColumnIndex: 3) ?? "",
-                                        audio: cursorData.string(forColumnIndex: 17) ?? "",
-                                        gif: cursorData.string(forColumnIndex: 18) ?? "")
+                                        credential: !lastQuery.isEmpty ? cursorData.string(forColumnIndex: 11) ?? "" : cursorData.string(forColumnIndex: 15) ?? "",
+                                        lock: !lastQuery.isEmpty ? cursorData.string(forColumnIndex: 12) ?? "" : cursorData.string(forColumnIndex: 16) ?? "",
+                                        thumb: !lastQuery.isEmpty ? cursorData.string(forColumnIndex: 3) ?? "" : "",
+                                        audio: !lastQuery.isEmpty ? cursorData.string(forColumnIndex: 13) ?? "" : cursorData.string(forColumnIndex: 17) ?? "",
+                                        gif: !lastQuery.isEmpty ? cursorData.string(forColumnIndex: 14) ?? "" : cursorData.string(forColumnIndex: 18) ?? "")
                         chats.append(chat)
                     }
                     cursorData.close()
-    //                if chats.count == 0 {
-    //                    if let cursorCounter = Database.shared.getRecords(fmdb: fmdb, query: "SELECT SUM(counter) FROM MESSAGE_SUMMARY"), cursorCounter.next() {
-    //                        if cursorCounter.int(forColumnIndex: 0) != 0 {
-    //                            _ = Database.shared.updateAllRecord(fmdb: fmdb, table: "MESSAGE_SUMMARY", cvalues: [
-    //                                "counter" : 0
-    //                            ])
-    //                            NotificationCenter.default.post(name: NSNotification.Name(rawValue: "reloadTabChats"), object: nil, userInfo: nil)
-    //                        }
-    //                        cursorCounter.close()
-    //                    }
-    //                }
                 }
             } catch {
                 rollback.pointee = true

+ 41 - 1
NexilisLite/NexilisLite/Source/Model/User.swift

@@ -127,7 +127,7 @@ public class User: Model {
         return nil
     }
     
-    public static func getData(pin: String?, fmdb: FMDatabase? = nil) -> User? {
+    public static func getData(pin: String?, lPin: String = "", fmdb: FMDatabase? = nil) -> User? {
         guard let pin = pin else {
             return nil
         }
@@ -146,6 +146,26 @@ public class User: Model {
                             device_id: cursor.string(forColumnIndex: 8) ?? "",
                             status: cursor.string(forColumnIndex: 10) ?? "")
                 cursor.close()
+            } else if let cursor = Database.shared.getRecords(fmdb: fmdb!, query: """
+                                                              SELECT a.f_pin, a.first_name, a.last_name, a.thumb_id
+                                                              FROM GROUPZ_MEMBER a
+                                                              LEFT JOIN DISCUSSION_FORUM b ON a.group_id = b.group_id
+                                                              LEFT JOIN GROUPZ c ON a.group_id = c.group_id
+                                                              WHERE a.f_pin = '\(pin)'
+                                                              AND (
+                                                                  (b.chat_id = '\(lPin)' AND a.group_id = b.group_id)
+                                                                  OR 
+                                                                  (c.group_id = '\(lPin)' AND a.group_id = c.group_id)
+                                                              )
+                                                              """), cursor.next() {
+                user = User(pin: cursor.string(forColumnIndex: 0) ?? "",
+                            firstName: cursor.string(forColumnIndex: 1) ?? "",
+                            lastName: cursor.string(forColumnIndex: 2) ?? "",
+                            thumb: cursor.string(forColumnIndex: 3) ?? "",
+                            userType: "",
+                            privacy_flag: "",
+                            offline_mode: "",
+                            ex_block: "")
             } else {
                 user = User(pin: pin,
                             firstName: "User".localized(),
@@ -172,6 +192,26 @@ public class User: Model {
                                     device_id: cursor.string(forColumnIndex: 8) ?? "",
                                     status: cursor.string(forColumnIndex: 10) ?? "")
                         cursor.close()
+                    } else if let cursor = Database.shared.getRecords(fmdb: fmdb, query: """
+                                                              SELECT a.f_pin, a.first_name, a.last_name, a.thumb_id
+                                                              FROM GROUPZ_MEMBER a
+                                                              LEFT JOIN DISCUSSION_FORUM b ON a.group_id = b.group_id
+                                                              LEFT JOIN GROUPZ c ON a.group_id = c.group_id
+                                                              WHERE a.f_pin = '\(pin)'
+                                                              AND (
+                                                                  (b.chat_id = '\(lPin)' AND a.group_id = b.group_id)
+                                                                  OR 
+                                                                  (c.group_id = '\(lPin)' AND a.group_id = c.group_id)
+                                                              )
+                                                              """), cursor.next() {
+                        user = User(pin: cursor.string(forColumnIndex: 0) ?? "",
+                                    firstName: cursor.string(forColumnIndex: 1) ?? "",
+                                    lastName: cursor.string(forColumnIndex: 2) ?? "",
+                                    thumb: cursor.string(forColumnIndex: 3) ?? "",
+                                    userType: "",
+                                    privacy_flag: "",
+                                    offline_mode: "",
+                                    ex_block: "")
                     } else {
                         user = User(pin: pin,
                                     firstName: "User".localized(),

+ 17 - 19
NexilisLite/NexilisLite/Source/Nexilis.swift

@@ -346,7 +346,7 @@ public class Nexilis: NSObject {
                     if let json = try? JSONSerialization.jsonObject(with: responseString.data(using: String.Encoding.utf8)!, options: JSONSerialization.ReadingOptions()) as? [String: Any?] {
                         do {
                             if Utils.getBEId().isEmpty {
-                                Utils.setBEId(value: "\(json["be_id"]!!)")
+                                Utils.setBEId(value: "\(json["be_id"] as? Int ?? 0)")
                                 getPullPrefs()
                             } else {
                                 let dataArray: [[String: Any?]] = [json]
@@ -877,10 +877,10 @@ public class Nexilis: NSObject {
     public static func writeSync(message: TMessage, timeout: Int = 15 * 1000) -> TMessage? {
         isProcessWriteSync = true
         do {
-            print(">> SENDING MESSAGE >> ", message.toLogString())
+//            print(">> SENDING MESSAGE >> ", message.toLogString())
             if let data = try API.sGetResponse(sRequest: message.pack(), lTimeout: timeout, bKeepTOResp: true) {
                 let response = TMessage(data: data)
-                print(">> RESPONSE WRITESYNC >> ")
+//                print(">> RESPONSE WRITESYNC >> ")
 //                print("<< RESPONSE MESSAGE << ", response.toLogString())
                 isProcessWriteSync = false
                 return response
@@ -1283,7 +1283,7 @@ public class Nexilis: NSObject {
         IncomingThread.default.addQueue(message: message)
     }
     
-    static func saveMessage(message: TMessage, withStatus: Bool = true) {
+    static func saveMessage(message: TMessage, withStatus: Bool = true, fromAPNS: Bool = false) {
 //        print("save message \(message.toLogString())")
         guard let me = User.getMyPin() else {
             return
@@ -1298,13 +1298,13 @@ public class Nexilis: NSObject {
         }
         Database.shared.database?.inTransaction({ (fmdb, rollback) in
             do {
-//                if let cursor = Database.shared.getRecords(fmdb: fmdb, query: "select message_id from MESSAGE where message_id = '\(message_id)'") {
-//                    if cursor.next() {
-//                        //print("message exist")
-//                        return
-//                    }
-//                    cursor.close()
-//                }
+                var messageExist = false
+                if let cursor = Database.shared.getRecords(fmdb: fmdb, query: "select message_id from MESSAGE where message_id = '\(message_id)'") {
+                    if cursor.next() {
+                        messageExist = true
+                    }
+                    cursor.close()
+                }
                 let l_pin = message.getBody(key : CoreMessage_TMessageKey.L_PIN, default_value : "")
                 let scope = message.getBody(key : CoreMessage_TMessageKey.MESSAGE_SCOPE_ID, default_value : "3")
                 let status = message.getBody(key : CoreMessage_TMessageKey.STATUS, default_value : "")
@@ -1316,6 +1316,7 @@ public class Nexilis: NSObject {
                 let is_secret = message.getBodyAsLong(key: CoreMessage_TMessageKey.IS_SECRET, default_value: 0)
                 let is_delete_retention = message.getBodyAsLong(key: CoreMessage_TMessageKey.IS_DELETED_RETENTION, default_value: 0)
                 let is_forwarded_message = message.getBodyAsLong(key: CoreMessage_TMessageKey.IS_FORWARDED_MESSAGE, default_value: 0)
+                let opposite_pin = message.getBody(key: CoreMessage_TMessageKey.OPPOSITE_PIN, default_value: "")
                 //print("prepare save db")
                 do {
                     _ = try Database.shared.insertRecord(fmdb: fmdb, table: "MESSAGE", cvalues: [
@@ -1383,12 +1384,9 @@ public class Nexilis: NSObject {
                         //print(error)
                     }
                 }
-                var pin = l_pin
-                if l_pin == me {
-                    pin = f_pin
-                }
-                if !chat_id.isEmpty {
-                    pin = chat_id
+                var pin = opposite_pin
+                if pin == me {
+                    pin = l_pin
                 }
                 var counter : Int? = nil
                 if !withStatus {
@@ -1422,7 +1420,7 @@ public class Nexilis: NSObject {
                             messageId = cursorData.string(forColumnIndex: 0) ?? ""
                             cursorData.close()
                         }
-                        if !messageId.isEmpty {
+                        if !messageId.isEmpty && !messageExist {
                             _ = try Database.shared.insertRecord(fmdb: fmdb, table: "MESSAGE_SUMMARY", cvalues: [
                                 "l_pin" : pin,
                                 "message_id" : messageId,
@@ -1434,7 +1432,7 @@ public class Nexilis: NSObject {
                         //print(error)
                     }
                 }
-                if !withStatus {
+                if !withStatus && !fromAPNS {
                     DispatchQueue.main.async {
                         if let delegate = Nexilis.shared.messageDelegate, Utils.getSetProfile() {
                             message.mBodies[CoreMessage_TMessageKey.MESSAGE_TEXT] = message.getBody(key : CoreMessage_TMessageKey.MESSAGE_TEXT, default_value : "").toNormalString()

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 196 - 196
NexilisLite/NexilisLite/Source/View/Chat/EditorGroup.swift


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 179 - 179
NexilisLite/NexilisLite/Source/View/Chat/EditorPersonal.swift


+ 4 - 63
NexilisLite/NexilisLite/Source/View/Control/ContactChatViewController.swift

@@ -229,32 +229,6 @@ class ContactChatViewController: UITableViewController {
             self.navigationController?.navigationBar.setNeedsLayout()
         }
         getData()
-        DispatchQueue.global().async {
-            self.getOpenGroups(listGroups: self.groups, completion: { g in
-                DispatchQueue.main.async {
-                    for og in g {
-                        if self.groups.first(where: { $0.id == og.id }) == nil {
-                            self.groups.append(og)
-                        }
-                    }
-                    self.groups.sort { (a, b) -> Bool in
-                        if Int(a.official) == 1 {
-                            return true
-                        } else if Int(b.official) == 1 {
-                            return false
-                        } else {
-                            return Int(a.official) ?? 0 > Int(b.official) ?? 0
-                        }
-                    }
-                    DispatchQueue.main.async {
-                        self.tableView.reloadData()
-                    }
-                }
-            })
-        }
-        if segment.selectedSegmentIndex == 0 {
-            Utils.inTabChats = true
-        }
     }
     
     @objc func addFriend(sender: UIBarButtonItem) {
@@ -300,41 +274,8 @@ class ContactChatViewController: UITableViewController {
     }
     
     @objc func onReceiveMessage(notification: NSNotification) {
-        DispatchQueue.main.async { [self] in
-            let data:[AnyHashable : Any] = notification.userInfo!
-            if let dataMessage = data["message"] as? TMessage {
-                let chatData = dataMessage.mBodies
-                if chatData[CoreMessage_TMessageKey.IS_CALL_CENTER] == nil || chatData[CoreMessage_TMessageKey.IS_CALL_CENTER] == "0" {
-                    var indexChat: Int?
-                    if chatData[CoreMessage_TMessageKey.MESSAGE_SCOPE_ID] == "3" && chatData[CoreMessage_TMessageKey.F_PIN] != User.getMyPin() {
-                        indexChat = chats.firstIndex(where: { $0.fpin == chatData[CoreMessage_TMessageKey.F_PIN] })
-                    } else if chatData[CoreMessage_TMessageKey.MESSAGE_SCOPE_ID] == "4" && chatData[CoreMessage_TMessageKey.F_PIN] != User.getMyPin() {
-                        indexChat = chats.firstIndex(where: { (chatData[CoreMessage_TMessageKey.CHAT_ID] ?? "").isEmpty ? $0.pin == chatData[CoreMessage_TMessageKey.L_PIN] : $0.pin == chatData[CoreMessage_TMessageKey.CHAT_ID] })
-                    }
-                    let newChat = Chat.getData(messageId: chatData[CoreMessage_TMessageKey.MESSAGE_ID] ?? "")
-                    if newChat.count > 0 {
-                        if indexChat != nil {
-                            chats.remove(at: indexChat!)
-                            chats.insert(newChat[0], at: 0)
-                            if segment.selectedSegmentIndex == 0 {
-                                let indexPathToMove = IndexPath(row: indexChat!, section: 0)
-                                let indexPathNewPosition = IndexPath(row: 0, section: 0)
-                                tableView.performBatchUpdates({
-                                    tableView.moveRow(at: indexPathToMove, to: indexPathNewPosition)
-                                }, completion: nil)
-                                tableView.beginUpdates()
-                                tableView.reloadRows(at: [IndexPath(row: 0, section: 0)], with: .none)
-                                tableView.endUpdates()
-                            } else {
-                                tableView.reloadData()
-                            }
-                        } else {
-                            chats.insert(newChat[0], at: 0)
-                            tableView.reloadData()
-                        }
-                    }
-                }
-            }
+        DispatchQueue.main.async {
+            self.getData()
         }
     }
     
@@ -1221,7 +1162,7 @@ extension ContactChatViewController {
                 messageView.translatesAutoresizingMaskIntoConstraints = false
                 NSLayoutConstraint.activate([
                     messageView.leadingAnchor.constraint(equalTo: imageView.trailingAnchor, constant: 10.0),
-                    messageView.topAnchor.constraint(equalTo: titleView.bottomAnchor, constant: 5.0),
+                    messageView.topAnchor.constraint(equalTo: titleView.bottomAnchor, constant: 2.0),
                     messageView.trailingAnchor.constraint(equalTo: content.trailingAnchor, constant: -40.0),
                 ])
                 messageView.textColor = .gray
@@ -1266,7 +1207,7 @@ extension ContactChatViewController {
                         }
                     } else {
                         if data.messageScope == "4" {
-                            stringMessage.append(NSAttributedString(string: User.getData(pin: data.fpin)!.firstName + ": ", attributes: [NSAttributedString.Key.font: UIFont.systemFont(ofSize: 12, weight: .medium)]))
+                            stringMessage.append(NSAttributedString(string: User.getData(pin: data.fpin, lPin: data.pin)!.firstName + ": ", attributes: [NSAttributedString.Key.font: UIFont.systemFont(ofSize: 12, weight: .medium)]))
                         }
                         if data.lock == "1" {
                             stringMessage.append(("🚫 _"+"This message was deleted".localized()+"_").richText())

+ 1 - 1
NexilisLite/Podfile

@@ -7,7 +7,7 @@ target 'NexilisLite' do
 
   # Pods for NexilisLite
 
-  pod 'nuSDKService', '~> 3.0.3'
+  pod 'nuSDKService', '~> 4.0.2'
   pod 'FMDB', '~> 2.7.12'
   pod 'NotificationBannerSwift', '3.1.0'
   pod 'Alamofire', '~> 5.10.1'

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio