Forráskód Böngészése

check lokasi ip, jika diluar indonesia berikan notif warning

Hendi 2 éve
szülő
commit
9c9414fd35

+ 2 - 1
Podfile

@@ -12,7 +12,8 @@ target 'Sirani' do
   # Pods for Sirani
   pod 'Alamofire', '~> 5.0.0-beta.5'
   pod 'SwiftyJSON', '~> 4.0'
-  pod 'SDWebImage', '~> 4.0'
+  pod 'SDWebImage', '~> 5.0'
+  pod 'SDWebImageWebPCoder'
   pod 'ImageSlideshow', '~> 1.6'
   pod 'ImageSlideshow/SDWebImage'
   pod 'MaterialComponents/Cards'

+ 56 - 36
Podfile.lock

@@ -1,17 +1,17 @@
 PODS:
   - Alamofire (5.0.5)
-  - Firebase/Analytics (10.18.0):
+  - Firebase/Analytics (10.19.0):
     - Firebase/Core
-  - Firebase/Core (10.18.0):
+  - Firebase/Core (10.19.0):
     - Firebase/CoreOnly
-    - FirebaseAnalytics (~> 10.18.0)
-  - Firebase/CoreOnly (10.18.0):
-    - FirebaseCore (= 10.18.0)
-  - Firebase/Messaging (10.18.0):
+    - FirebaseAnalytics (~> 10.19.0)
+  - Firebase/CoreOnly (10.19.0):
+    - FirebaseCore (= 10.19.0)
+  - Firebase/Messaging (10.19.0):
     - Firebase/CoreOnly
-    - FirebaseMessaging (~> 10.18.0)
-  - FirebaseAnalytics (10.18.0):
-    - FirebaseAnalytics/AdIdSupport (= 10.18.0)
+    - FirebaseMessaging (~> 10.19.0)
+  - FirebaseAnalytics (10.19.0):
+    - FirebaseAnalytics/AdIdSupport (= 10.19.0)
     - FirebaseCore (~> 10.0)
     - FirebaseInstallations (~> 10.0)
     - GoogleUtilities/AppDelegateSwizzler (~> 7.11)
@@ -19,56 +19,56 @@ PODS:
     - GoogleUtilities/Network (~> 7.11)
     - "GoogleUtilities/NSData+zlib (~> 7.11)"
     - nanopb (< 2.30910.0, >= 2.30908.0)
-  - FirebaseAnalytics/AdIdSupport (10.18.0):
+  - FirebaseAnalytics/AdIdSupport (10.19.0):
     - FirebaseCore (~> 10.0)
     - FirebaseInstallations (~> 10.0)
-    - GoogleAppMeasurement (= 10.18.0)
+    - GoogleAppMeasurement (= 10.19.0)
     - GoogleUtilities/AppDelegateSwizzler (~> 7.11)
     - GoogleUtilities/MethodSwizzler (~> 7.11)
     - GoogleUtilities/Network (~> 7.11)
     - "GoogleUtilities/NSData+zlib (~> 7.11)"
     - nanopb (< 2.30910.0, >= 2.30908.0)
-  - FirebaseCore (10.18.0):
+  - FirebaseCore (10.19.0):
     - FirebaseCoreInternal (~> 10.0)
     - GoogleUtilities/Environment (~> 7.12)
     - GoogleUtilities/Logger (~> 7.12)
-  - FirebaseCoreInternal (10.18.0):
+  - FirebaseCoreInternal (10.19.0):
     - "GoogleUtilities/NSData+zlib (~> 7.8)"
-  - FirebaseInstallations (10.18.0):
+  - FirebaseInstallations (10.19.0):
     - FirebaseCore (~> 10.0)
     - GoogleUtilities/Environment (~> 7.8)
     - GoogleUtilities/UserDefaults (~> 7.8)
     - PromisesObjC (~> 2.1)
-  - FirebaseMessaging (10.18.0):
+  - FirebaseMessaging (10.19.0):
     - FirebaseCore (~> 10.0)
     - FirebaseInstallations (~> 10.0)
-    - GoogleDataTransport (~> 9.2)
+    - GoogleDataTransport (~> 9.3)
     - GoogleUtilities/AppDelegateSwizzler (~> 7.8)
     - GoogleUtilities/Environment (~> 7.8)
     - GoogleUtilities/Reachability (~> 7.8)
     - GoogleUtilities/UserDefaults (~> 7.8)
     - nanopb (< 2.30910.0, >= 2.30908.0)
-  - GoogleAppMeasurement (10.18.0):
-    - GoogleAppMeasurement/AdIdSupport (= 10.18.0)
+  - GoogleAppMeasurement (10.19.0):
+    - GoogleAppMeasurement/AdIdSupport (= 10.19.0)
     - GoogleUtilities/AppDelegateSwizzler (~> 7.11)
     - GoogleUtilities/MethodSwizzler (~> 7.11)
     - GoogleUtilities/Network (~> 7.11)
     - "GoogleUtilities/NSData+zlib (~> 7.11)"
     - nanopb (< 2.30910.0, >= 2.30908.0)
-  - GoogleAppMeasurement/AdIdSupport (10.18.0):
-    - GoogleAppMeasurement/WithoutAdIdSupport (= 10.18.0)
+  - GoogleAppMeasurement/AdIdSupport (10.19.0):
+    - GoogleAppMeasurement/WithoutAdIdSupport (= 10.19.0)
     - GoogleUtilities/AppDelegateSwizzler (~> 7.11)
     - GoogleUtilities/MethodSwizzler (~> 7.11)
     - GoogleUtilities/Network (~> 7.11)
     - "GoogleUtilities/NSData+zlib (~> 7.11)"
     - nanopb (< 2.30910.0, >= 2.30908.0)
-  - GoogleAppMeasurement/WithoutAdIdSupport (10.18.0):
+  - GoogleAppMeasurement/WithoutAdIdSupport (10.19.0):
     - GoogleUtilities/AppDelegateSwizzler (~> 7.11)
     - GoogleUtilities/MethodSwizzler (~> 7.11)
     - GoogleUtilities/Network (~> 7.11)
     - "GoogleUtilities/NSData+zlib (~> 7.11)"
     - nanopb (< 2.30910.0, >= 2.30908.0)
-  - GoogleDataTransport (9.2.5):
+  - GoogleDataTransport (9.3.0):
     - GoogleUtilities/Environment (~> 7.7)
     - nanopb (< 2.30910.0, >= 2.30908.0)
     - PromisesObjC (< 3.0, >= 1.2)
@@ -102,6 +102,18 @@ PODS:
   - ImageSlideshow/SDWebImage (1.9.2):
     - ImageSlideshow/Core
     - SDWebImage (>= 3.7)
+  - libwebp (1.3.2):
+    - libwebp/demux (= 1.3.2)
+    - libwebp/mux (= 1.3.2)
+    - libwebp/sharpyuv (= 1.3.2)
+    - libwebp/webp (= 1.3.2)
+  - libwebp/demux (1.3.2):
+    - libwebp/webp
+  - libwebp/mux (1.3.2):
+    - libwebp/demux
+  - libwebp/sharpyuv (1.3.2)
+  - libwebp/webp (1.3.2):
+    - libwebp/sharpyuv
   - MaterialComponents/AnimationTiming (124.2.0)
   - MaterialComponents/Availability (124.2.0)
   - MaterialComponents/Cards (124.2.0):
@@ -144,9 +156,12 @@ PODS:
   - nanopb/decode (2.30909.1)
   - nanopb/encode (2.30909.1)
   - PromisesObjC (2.3.1)
-  - SDWebImage (4.4.8):
-    - SDWebImage/Core (= 4.4.8)
-  - SDWebImage/Core (4.4.8)
+  - SDWebImage (5.18.8):
+    - SDWebImage/Core (= 5.18.8)
+  - SDWebImage/Core (5.18.8)
+  - SDWebImageWebPCoder (0.14.2):
+    - libwebp (~> 1.0)
+    - SDWebImage/Core (~> 5.17)
   - SwiftyJSON (4.3.0)
 
 DEPENDENCIES:
@@ -158,7 +173,8 @@ DEPENDENCIES:
   - ImageSlideshow (~> 1.6)
   - ImageSlideshow/SDWebImage
   - MaterialComponents/Cards
-  - SDWebImage (~> 4.0)
+  - SDWebImage (~> 5.0)
+  - SDWebImageWebPCoder
   - SwiftyJSON (~> 4.0)
 
 SPEC REPOS:
@@ -175,31 +191,35 @@ SPEC REPOS:
     - GoogleMaps
     - GoogleUtilities
     - ImageSlideshow
+    - libwebp
     - MaterialComponents
     - nanopb
     - PromisesObjC
     - SDWebImage
+    - SDWebImageWebPCoder
     - SwiftyJSON
 
 SPEC CHECKSUMS:
   Alamofire: df2f8f826963b08b9a870791ad48e07a10090b2e
-  Firebase: 414ad272f8d02dfbf12662a9d43f4bba9bec2a06
-  FirebaseAnalytics: 4d310b35c48eaa4a058ddc04bdca6bdb5dc0fe80
-  FirebaseCore: 2322423314d92f946219c8791674d2f3345b598f
-  FirebaseCoreInternal: 8eb002e564b533bdcf1ba011f33f2b5c10e2ed4a
-  FirebaseInstallations: e842042ec6ac1fd2e37d7706363ebe7f662afea4
-  FirebaseMessaging: 9bc34a98d2e0237e1b121915120d4d48ddcf301e
-  GoogleAppMeasurement: 70ce9aa438cff1cfb31ea3e660bcc67734cb716e
-  GoogleDataTransport: 54dee9d48d14580407f8f5fbf2f496e92437a2f2
+  Firebase: 63ce8ece0d43743dc28eacac0c6867a2d7fd5a9d
+  FirebaseAnalytics: 87513010b13b7c8610164d3602ea10571f76afc1
+  FirebaseCore: dc5c7badf99d47613c52b2e3a57a64cd187f8554
+  FirebaseCoreInternal: b444828ea7cfd594fca83046b95db98a2be4f290
+  FirebaseInstallations: 033d199474164db20c8350736842a94fe717b960
+  FirebaseMessaging: d322bd030a0e97398bf134746e087b88e6ba0074
+  GoogleAppMeasurement: 68afe759316673c6554dac35a0c7ae8f5d6cb4ed
+  GoogleDataTransport: 57c22343ab29bc686febbf7cbb13bad167c2d8fe
   GoogleMaps: 5c13302e6fe6bb6e686b267196586b91cd594225
   GoogleUtilities: 0759d1a57ebb953965c2dfe0ba4c82e95ccc2e34
   ImageSlideshow: be305b54eaf2b2cfc7a7141c7c734605d44dc07d
+  libwebp: 1786c9f4ff8a279e4dac1e8f385004d5fc253009
   MaterialComponents: 1a9b2d9d45b1601ae544de85089adc4c464306d4
   nanopb: d4d75c12cd1316f4a64e3c6963f879ecd4b5e0d5
   PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4
-  SDWebImage: 783af2c3fa36291a250030c4752ee370a9a51d13
+  SDWebImage: a81bbb3ba4ea5f810f4069c68727cb118467a04a
+  SDWebImageWebPCoder: 633b813fca24f1de5e076bcd7f720c038b23892b
   SwiftyJSON: 6faa0040f8b59dead0ee07436cbf76b73c08fd08
 
-PODFILE CHECKSUM: e9fd53fe673221af92d7effe088bbeccf7431575
+PODFILE CHECKSUM: 80001ccf421961bd37f1c59816f2864bedef4140
 
 COCOAPODS: 1.14.2

+ 12 - 2
Sirani.xcodeproj/project.pbxproj

@@ -26,6 +26,7 @@
 		04D0FD7E2A31B3EF00DC89D1 /* SertifikatViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D0FD7D2A31B3EF00DC89D1 /* SertifikatViewController.swift */; };
 		04D0FD832A32E42D00DC89D1 /* SertifikatPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D0FD822A32E42D00DC89D1 /* SertifikatPresenter.swift */; };
 		04D0FD852A33027E00DC89D1 /* SertifikatViewDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D0FD842A33027E00DC89D1 /* SertifikatViewDelegate.swift */; };
+		04FF235B2B466611005975A8 /* CommonHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04FF235A2B466611005975A8 /* CommonHelper.swift */; };
 		1765ADEEAA576B3B80836335 /* Pods_Sirani.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63B2C265FB9236074BCFE50D /* Pods_Sirani.framework */; };
 		D8164C2B255FD62C00A3AE48 /* FaqContent.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8164C2A255FD62C00A3AE48 /* FaqContent.swift */; };
 		D8854A08255F90D500D581DF /* FaqCategory.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8854A07255F90D500D581DF /* FaqCategory.swift */; };
@@ -255,6 +256,7 @@
 		04D0FD7D2A31B3EF00DC89D1 /* SertifikatViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SertifikatViewController.swift; sourceTree = "<group>"; };
 		04D0FD822A32E42D00DC89D1 /* SertifikatPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SertifikatPresenter.swift; sourceTree = "<group>"; };
 		04D0FD842A33027E00DC89D1 /* SertifikatViewDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SertifikatViewDelegate.swift; sourceTree = "<group>"; };
+		04FF235A2B466611005975A8 /* CommonHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommonHelper.swift; sourceTree = "<group>"; };
 		63B2C265FB9236074BCFE50D /* Pods_Sirani.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Sirani.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 		B35682048376C184CFE92DBC /* Pods-Sirani.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Sirani.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Sirani/Pods-Sirani.debug.xcconfig"; sourceTree = "<group>"; };
 		C6195E138986840DC40227B6 /* Pods-Sirani.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Sirani.release.xcconfig"; path = "Pods/Target Support Files/Pods-Sirani/Pods-Sirani.release.xcconfig"; sourceTree = "<group>"; };
@@ -729,6 +731,7 @@
 			isa = PBXGroup;
 			children = (
 				FC3DADB9225046D400CF4C81 /* ConnectionHelper.swift */,
+				04FF235A2B466611005975A8 /* CommonHelper.swift */,
 				FCF468F1225A2E1D00B9227A /* UserState.swift */,
 				FC67D367224F94E000E456FB /* ViewExtensions.swift */,
 				04779EE42B3DAA3600224D1B /* ColorExtensions.swift */,
@@ -1551,6 +1554,7 @@
 				FC6A5D88227299730096664E /* SertifikatTidakBerlakuPresenter.swift in Sources */,
 				048A26622A443550008CDB82 /* SertifikatPublicVC.swift in Sources */,
 				048A26592A42E612008CDB82 /* AplikasiPresenter.swift in Sources */,
+				04FF235B2B466611005975A8 /* CommonHelper.swift in Sources */,
 				FCF7BAF32263143200532DC2 /* OdsSp2PrintCell.swift in Sources */,
 				FC8568F2225116100012F927 /* InformasiSertifikasiVC.swift in Sources */,
 				FC56AD7B2258DB6900D0EAE0 /* NewsDetail.swift in Sources */,
@@ -1753,7 +1757,7 @@
 				CODE_SIGN_ENTITLEMENTS = Sirani/Sirani.entitlements;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 6;
+				CURRENT_PROJECT_VERSION = 8;
 				DEVELOPMENT_TEAM = 6C7T7C558N;
 				INFOPLIST_FILE = Sirani/Info.plist;
 				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
@@ -1765,6 +1769,9 @@
 				PRODUCT_BUNDLE_IDENTIFIER = id.go.postel.sirani;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE_SPECIFIER = "";
+				SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
+				SUPPORTS_MACCATALYST = NO;
+				SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
 				SWIFT_VERSION = 5.0;
 				TARGETED_DEVICE_FAMILY = "1,2";
 			};
@@ -1778,7 +1785,7 @@
 				CODE_SIGN_ENTITLEMENTS = Sirani/Sirani.entitlements;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 6;
+				CURRENT_PROJECT_VERSION = 8;
 				DEVELOPMENT_TEAM = 6C7T7C558N;
 				INFOPLIST_FILE = Sirani/Info.plist;
 				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
@@ -1790,6 +1797,9 @@
 				PRODUCT_BUNDLE_IDENTIFIER = id.go.postel.sirani;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE_SPECIFIER = "";
+				SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
+				SUPPORTS_MACCATALYST = NO;
+				SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
 				SWIFT_VERSION = 5.0;
 				TARGETED_DEVICE_FAMILY = "1,2";
 			};

BIN
Sirani.xcworkspace/xcuserdata/mac.xcuserdatad/UserInterfaceState.xcuserstate


+ 4 - 0
Sirani/AppDelegate.swift

@@ -10,6 +10,7 @@ import UIKit
 import GoogleMaps
 import UserNotifications
 import Firebase
+import SDWebImageWebPCoder
 
 @UIApplicationMain
 class AppDelegate: UIResponder, UIApplicationDelegate {
@@ -26,6 +27,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
     func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
         // Override point for customization after application launch.
         
+        // Aktifkan WebP Coder
+        SDImageCodersManager.shared.addCoder(SDImageWebPCoder.shared)
+        
         GMSServices.provideAPIKey("AIzaSyC8OxBL_ADTFubfkmZ2I81-IXx4O7t6Tog")
 //        AIzaSyDOdr-zkd6oLhHRE-prsu23-u7rnSh5WCY // id.go.postel.sirani
         

+ 6 - 43
Sirani/Base.lproj/Main.storyboard

@@ -177,7 +177,6 @@
                                         <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                         <constraints>
                                             <constraint firstAttribute="height" constant="40" id="VeV-fd-5sK"/>
-                                            <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="315" id="q9d-Ag-vg5"/>
                                         </constraints>
                                         <fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
                                         <state key="normal" title="Batal">
@@ -197,7 +196,8 @@
                                 </subviews>
                                 <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                 <constraints>
-                                    <constraint firstItem="Nb4-Tc-Xkd" firstAttribute="leading" secondItem="CDW-iG-Sob" secondAttribute="leading" constant="30" id="2ok-KR-Hhb"/>
+                                    <constraint firstItem="Nb4-Tc-Xkd" firstAttribute="trailing" secondItem="25n-Wm-R8z" secondAttribute="trailing" constant="-30" id="6Bj-uX-tq9"/>
+                                    <constraint firstItem="Nb4-Tc-Xkd" firstAttribute="leading" secondItem="vUU-E4-f66" secondAttribute="leading" constant="30" id="6VF-39-S6m"/>
                                     <constraint firstItem="25n-Wm-R8z" firstAttribute="top" secondItem="diW-Vz-xdt" secondAttribute="bottom" id="9Pr-BD-Y9V"/>
                                     <constraint firstAttribute="bottom" secondItem="XCg-Ma-IVZ" secondAttribute="bottom" id="9uz-la-Fv1"/>
                                     <constraint firstAttribute="trailing" secondItem="25n-Wm-R8z" secondAttribute="trailing" id="Cnu-jo-QJH"/>
@@ -209,7 +209,6 @@
                                     <constraint firstAttribute="trailing" secondItem="XCg-Ma-IVZ" secondAttribute="trailing" id="lXM-co-Td2"/>
                                     <constraint firstAttribute="bottom" secondItem="Nb4-Tc-Xkd" secondAttribute="bottom" constant="60" id="x2m-MT-bG4"/>
                                     <constraint firstAttribute="trailing" secondItem="diW-Vz-xdt" secondAttribute="trailing" id="xAO-sL-f0w"/>
-                                    <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="Nb4-Tc-Xkd" secondAttribute="trailing" constant="20" symbolic="YES" id="xUi-KW-wRw"/>
                                     <constraint firstItem="XCg-Ma-IVZ" firstAttribute="top" secondItem="vUU-E4-f66" secondAttribute="bottom" id="zIO-hm-8fh"/>
                                     <constraint firstItem="XCg-Ma-IVZ" firstAttribute="leading" secondItem="CDW-iG-Sob" secondAttribute="leading" id="zxj-ND-sAn"/>
                                 </constraints>
@@ -289,7 +288,6 @@
                                         <constraints>
                                             <constraint firstItem="AEG-mK-NLd" firstAttribute="leading" secondItem="o1l-qJ-VAC" secondAttribute="leading" constant="16" id="Dwy-x8-4Du"/>
                                             <constraint firstAttribute="bottom" secondItem="AEG-mK-NLd" secondAttribute="bottom" constant="16" id="JhX-sI-XKW"/>
-                                            <constraint firstAttribute="trailing" secondItem="AEG-mK-NLd" secondAttribute="trailing" constant="335" id="M3m-jp-2qN"/>
                                             <constraint firstAttribute="height" constant="56" id="XTL-r1-1Yk"/>
                                             <constraint firstItem="AEG-mK-NLd" firstAttribute="top" secondItem="o1l-qJ-VAC" secondAttribute="top" constant="16" id="iuk-gH-chs"/>
                                         </constraints>
@@ -298,7 +296,7 @@
                                         <rect key="frame" x="0.0" y="156" width="375" height="481"/>
                                         <subviews>
                                             <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="PMN-7G-GEI" userLabel="ResultContainerView">
-                                                <rect key="frame" x="0.0" y="0.0" width="375" height="896"/>
+                                                <rect key="frame" x="0.0" y="0.0" width="375" height="834"/>
                                                 <subviews>
                                                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Box-Pm-gUh" userLabel="ResultTitleLayout">
                                                         <rect key="frame" x="8" y="8" width="359" height="60"/>
@@ -335,7 +333,7 @@
                                                         </constraints>
                                                     </view>
                                                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ooQ-Fz-dw6" userLabel="ResultContentLayout">
-                                                        <rect key="frame" x="8" y="68" width="359" height="812"/>
+                                                        <rect key="frame" x="8" y="68" width="359" height="750"/>
                                                         <subviews>
                                                             <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="8wx-QU-Drl" userLabel="Section1">
                                                                 <rect key="frame" x="8" y="16" width="343" height="121"/>
@@ -506,7 +504,7 @@
                                                                 </constraints>
                                                             </view>
                                                             <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="J05-JI-I8U" userLabel="Section3">
-                                                                <rect key="frame" x="8" y="306" width="343" height="482"/>
+                                                                <rect key="frame" x="8" y="306" width="343" height="420"/>
                                                                 <subviews>
                                                                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Nama Perangkat" lineBreakMode="tailTruncation" numberOfLines="3" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="oa7-DD-Voj" userLabel="Nama Pangkat Title">
                                                                         <rect key="frame" x="8" y="0.0" width="327" height="30"/>
@@ -748,45 +746,15 @@
                                                                             <constraint firstAttribute="bottom" secondItem="cOn-tO-0No" secondAttribute="bottom" id="x7g-yx-aat"/>
                                                                         </constraints>
                                                                     </view>
-                                                                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Power" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="XUS-Vb-rPV" userLabel="Power Title">
-                                                                        <rect key="frame" x="8" y="420" width="327" height="30"/>
-                                                                        <constraints>
-                                                                            <constraint firstAttribute="height" constant="30" id="EHy-nh-7vN"/>
-                                                                        </constraints>
-                                                                        <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="14"/>
-                                                                        <nil key="textColor"/>
-                                                                        <nil key="highlightedColor"/>
-                                                                    </label>
-                                                                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="2qM-ca-VTW" userLabel="PowerView">
-                                                                        <rect key="frame" x="1" y="452" width="341" height="30"/>
-                                                                        <subviews>
-                                                                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="sXT-hl-WlT">
-                                                                                <rect key="frame" x="8" y="0.0" width="325" height="30"/>
-                                                                                <fontDescription key="fontDescription" type="system" pointSize="14"/>
-                                                                                <nil key="textColor"/>
-                                                                                <nil key="highlightedColor"/>
-                                                                            </label>
-                                                                        </subviews>
-                                                                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
-                                                                        <constraints>
-                                                                            <constraint firstAttribute="height" constant="30" id="IAH-T2-1JW"/>
-                                                                            <constraint firstItem="sXT-hl-WlT" firstAttribute="leading" secondItem="2qM-ca-VTW" secondAttribute="leading" constant="8" id="LMp-Hz-EDe"/>
-                                                                            <constraint firstAttribute="bottom" secondItem="sXT-hl-WlT" secondAttribute="bottom" id="TcW-6i-m1H"/>
-                                                                            <constraint firstAttribute="trailing" secondItem="sXT-hl-WlT" secondAttribute="trailing" constant="8" id="erM-gO-psm"/>
-                                                                            <constraint firstItem="sXT-hl-WlT" firstAttribute="top" secondItem="2qM-ca-VTW" secondAttribute="top" id="mxg-pY-urH"/>
-                                                                        </constraints>
-                                                                    </view>
                                                                 </subviews>
                                                                 <color key="backgroundColor" red="0.90134269" green="0.93688350919999996" blue="0.96473377940000005" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
                                                                 <constraints>
                                                                     <constraint firstItem="cN8-NT-ceU" firstAttribute="leading" secondItem="J05-JI-I8U" secondAttribute="leading" constant="8" id="12n-vH-92G"/>
-                                                                    <constraint firstAttribute="bottom" secondItem="2qM-ca-VTW" secondAttribute="bottom" id="13y-cK-HcT"/>
                                                                     <constraint firstAttribute="trailing" secondItem="oa7-DD-Voj" secondAttribute="trailing" constant="8" id="1sx-r6-LTs"/>
                                                                     <constraint firstAttribute="trailing" secondItem="8kX-B2-jnk" secondAttribute="trailing" constant="8" id="1zo-cT-6t4"/>
                                                                     <constraint firstAttribute="trailing" secondItem="BUj-mG-cE2" secondAttribute="trailing" constant="1" id="25v-jV-ku4"/>
                                                                     <constraint firstItem="RyT-6w-gdl" firstAttribute="leading" secondItem="J05-JI-I8U" secondAttribute="leading" constant="8" id="26w-T8-Dtu"/>
                                                                     <constraint firstItem="2uQ-aC-OD1" firstAttribute="top" secondItem="LBs-tQ-G38" secondAttribute="bottom" id="3NP-3K-Pd7"/>
-                                                                    <constraint firstItem="2qM-ca-VTW" firstAttribute="top" secondItem="XUS-Vb-rPV" secondAttribute="bottom" constant="2" id="3UT-63-SqZ"/>
                                                                     <constraint firstAttribute="trailing" secondItem="osU-cu-Stf" secondAttribute="trailing" constant="8" id="3tc-dk-5mZ"/>
                                                                     <constraint firstItem="ggv-HN-m58" firstAttribute="top" secondItem="yDh-tc-cXO" secondAttribute="bottom" id="4SC-W7-Qsl"/>
                                                                     <constraint firstAttribute="trailing" secondItem="RVZ-Lr-pAm" secondAttribute="trailing" constant="1" id="5eT-8W-uOy"/>
@@ -794,14 +762,11 @@
                                                                     <constraint firstItem="8kX-B2-jnk" firstAttribute="top" secondItem="Wuh-AI-Wxu" secondAttribute="bottom" id="71i-Zk-E4l"/>
                                                                     <constraint firstItem="pGW-8i-bXh" firstAttribute="leading" secondItem="J05-JI-I8U" secondAttribute="leading" constant="1" id="7Qf-HB-BWi"/>
                                                                     <constraint firstItem="crC-GM-VIp" firstAttribute="top" secondItem="FzM-e0-YBX" secondAttribute="bottom" id="ACe-k8-bq2"/>
-                                                                    <constraint firstItem="XUS-Vb-rPV" firstAttribute="leading" secondItem="J05-JI-I8U" secondAttribute="leading" constant="8" id="BSg-D9-HVh"/>
-                                                                    <constraint firstAttribute="trailing" secondItem="2qM-ca-VTW" secondAttribute="trailing" constant="1" id="Bda-3o-tOt"/>
-                                                                    <constraint firstAttribute="trailing" secondItem="XUS-Vb-rPV" secondAttribute="trailing" constant="8" id="E0d-6C-wD0"/>
                                                                     <constraint firstItem="osU-cu-Stf" firstAttribute="top" secondItem="crC-GM-VIp" secondAttribute="bottom" id="H3b-YD-ZCi"/>
-                                                                    <constraint firstItem="XUS-Vb-rPV" firstAttribute="top" secondItem="BUj-mG-cE2" secondAttribute="bottom" id="HGs-X6-t6H"/>
                                                                     <constraint firstAttribute="trailing" secondItem="LBs-tQ-G38" secondAttribute="trailing" constant="1" id="I4A-He-VAc"/>
                                                                     <constraint firstItem="Wuh-AI-Wxu" firstAttribute="top" secondItem="J05-JI-I8U" secondAttribute="top" constant="30" id="Iuj-EL-qWX"/>
                                                                     <constraint firstItem="BUj-mG-cE2" firstAttribute="top" secondItem="cN8-NT-ceU" secondAttribute="bottom" id="MKu-zS-T6p"/>
+                                                                    <constraint firstAttribute="bottom" secondItem="BUj-mG-cE2" secondAttribute="bottom" id="OAR-1C-0zY"/>
                                                                     <constraint firstItem="oa7-DD-Voj" firstAttribute="leading" secondItem="J05-JI-I8U" secondAttribute="leading" constant="8" id="ORv-d0-qI6"/>
                                                                     <constraint firstItem="LBs-tQ-G38" firstAttribute="top" secondItem="8kX-B2-jnk" secondAttribute="bottom" id="QLL-cw-Meq"/>
                                                                     <constraint firstItem="yDh-tc-cXO" firstAttribute="top" secondItem="RVZ-Lr-pAm" secondAttribute="bottom" id="TiF-GE-uXp"/>
@@ -821,7 +786,6 @@
                                                                     <constraint firstAttribute="trailing" secondItem="ChO-uL-1xR" secondAttribute="trailing" constant="1" id="led-Us-6TM"/>
                                                                     <constraint firstItem="osU-cu-Stf" firstAttribute="leading" secondItem="J05-JI-I8U" secondAttribute="leading" constant="8" id="n6q-ww-SGn"/>
                                                                     <constraint firstAttribute="trailing" secondItem="crC-GM-VIp" secondAttribute="trailing" constant="1" id="pED-pw-vKT"/>
-                                                                    <constraint firstItem="2qM-ca-VTW" firstAttribute="leading" secondItem="J05-JI-I8U" secondAttribute="leading" constant="1" id="pN7-dm-O3M"/>
                                                                     <constraint firstItem="yDh-tc-cXO" firstAttribute="leading" secondItem="J05-JI-I8U" secondAttribute="leading" constant="8" id="sQU-ta-jMW"/>
                                                                     <constraint firstItem="RVZ-Lr-pAm" firstAttribute="leading" secondItem="J05-JI-I8U" secondAttribute="leading" constant="1" id="tKZ-dU-ve6"/>
                                                                     <constraint firstItem="FzM-e0-YBX" firstAttribute="leading" secondItem="J05-JI-I8U" secondAttribute="leading" constant="8" id="uGd-vw-MSr"/>
@@ -947,7 +911,6 @@
                         <outlet property="lblPabrikan" destination="V1d-ks-tmD" id="O1O-27-fCF"/>
                         <outlet property="lblPerusahaan" destination="jQj-LC-yGD" id="Acc-rQ-wTx"/>
                         <outlet property="lblPlgId" destination="iv9-wF-UZ1" id="aWC-xz-hQZ"/>
-                        <outlet property="lblPower" destination="sXT-hl-WlT" id="Lf0-qj-8mQ"/>
                         <outlet property="lblTanggalSertifikat" destination="QvX-9u-xaB" id="BLG-UP-78Z"/>
                         <outlet property="overlayBottom" destination="XCg-Ma-IVZ" id="Dwz-ds-C6n"/>
                         <outlet property="overlayLeft" destination="vUU-E4-f66" id="FUF-Uo-agx"/>

+ 40 - 0
Sirani/Helper/CommonHelper.swift

@@ -0,0 +1,40 @@
+//
+//  CommonHelper.swift
+//  Sirani
+//
+//  Created by Hendi on 04/01/24.
+//  Copyright © 2024 PT. Mitra Sinerji Teknoindo. All rights reserved.
+//
+
+import Foundation
+import UIKit
+
+class CommonHelper {
+    
+    class func showNoConnection(in viewController: UIViewController) {
+        let alertNoConnection = UIAlertController(
+            title: Constants.instance.ALERT_NO_CONNECTION_TITLE,
+            message: Constants.instance.ALERT_NO_CONNECTION_MSG,
+            preferredStyle: .alert
+        )
+        alertNoConnection.addAction(
+            UIAlertAction(title: Constants.instance.ALERT_NO_CONNECTION_YESS, style: .default, handler: nil)
+        )
+        viewController.present(alertNoConnection, animated: true, completion: nil)
+    }
+    
+    class func showNotAllowConnection(in viewController: UIViewController) {
+        let alertNoConnection = UIAlertController(
+            title: Constants.instance.ALERT_NO_CONNECTION_TITLE,
+            message: Constants.instance.ALERT_NOT_ALLOW_MSG,
+            preferredStyle: .alert
+        )
+        alertNoConnection.addAction(
+            UIAlertAction(title: Constants.instance.ALERT_NO_CONNECTION_YESS, style: .default, handler: nil)
+        )
+        viewController.present(alertNoConnection, animated: true, completion: nil)
+    }
+    
+//    CommonHelper.showNoConnection(in: self)
+//    CommonHelper.showNotAllowConnection(in: self)
+}

+ 38 - 1
Sirani/Helper/ConnectionHelper.swift

@@ -7,6 +7,8 @@
 //
 
 import SystemConfiguration
+import Foundation
+import UIKit
 
 class ConnectionHelper {
 
@@ -40,6 +42,41 @@ class ConnectionHelper {
         let isConnect = (isReachable && !needsConnection)
         
         return isConnect
-        
+    }
+    
+    class func checkIpAddress(completion: @escaping (Bool) -> Void) {
+        if let url = URL(string: "https://ipinfo.io/json") {
+            let task = URLSession.shared.dataTask(with: url) { (data, response, error) in
+                if let error = error {
+                    print("Error when checking location: \(error.localizedDescription)")
+                    completion(false)
+                    return
+                }
+
+                if let data = data {
+                    do {
+                        let json = try JSONSerialization.jsonObject(with: data, options: [])
+                        if let dict = json as? [String: Any], let country = dict["country"] as? String {
+                            print("IP Country: \(country)")
+                            if country != "ID" {
+                                completion(false)
+                            } else {
+                                completion(true)
+                            }
+                        } else {
+                            completion(false)
+                        }
+                    } catch {
+                        print("Error when checking location: \(error.localizedDescription)")
+                        completion(false)
+                    }
+                } else {
+                    completion(false)
+                }
+            }
+            task.resume()
+        } else {
+            completion(false)
+        }
     }
 }

+ 15 - 0
Sirani/Helper/UserState.swift

@@ -21,6 +21,7 @@ class UserState {
     private let CUST_ID = "custid"
     private let FULLNAME = "fullname"
     private let ROLES = "roles"
+    private let AllowConnection = "AllowConnection"
     
     func userDataSaved(user: User) -> Bool {
         
@@ -132,4 +133,18 @@ class UserState {
         return true
     }
     
+    func setAllowConnection(status:Bool) {
+        let userDefaults = UserDefaults.standard
+        
+        userDefaults.set(status, forKey: AllowConnection)
+        userDefaults.synchronize()
+    }
+    
+    func isAllowConnection() -> Bool {
+        let userDefaults = UserDefaults.standard
+        
+        return userDefaults.bool(forKey: AllowConnection)
+    }
+
+    
 }

+ 1 - 0
Sirani/Utils/Constants.swift

@@ -22,5 +22,6 @@ class Constants {
     // ALERT CONNECTION
     public let ALERT_NO_CONNECTION_TITLE = "Informasi"
     public let ALERT_NO_CONNECTION_MSG = "Sepertinya Anda sedang tidak tersambung pada koneksi internet"
+    public let ALERT_NOT_ALLOW_MSG = "Maaf, Aplikasi ini hanya diizinkan di Indonesia. Silahkan ubah jaringan anda ke jaringan Indonesia"
     public let ALERT_NO_CONNECTION_YESS = "OK"
 }

+ 11 - 1
Sirani/View/Account/Login/LoginVC.swift

@@ -196,7 +196,17 @@ class LoginVC: UIViewController {
     private func login(username: String, password: String) {
         if !loading {
             if ConnectionHelper.isConnectedToNetwork() {
-                presenter.login(username: username, password: password)
+                ConnectionHelper.checkIpAddress { [weak self] success in
+                    guard let self = self else { return }
+
+                    DispatchQueue.main.async {
+                        if success {
+                            self.presenter.login(username: username, password: password)
+                        } else {
+                            CommonHelper.showNotAllowConnection(in: self)
+                        }
+                    }
+                }
             } else {
                 showNoConnection()
             }

+ 23 - 2
Sirani/View/Aplikasi/AplikasiVC.swift

@@ -68,7 +68,18 @@ class AplikasiVC: UIViewController {
     private func loadData() {
         if !loading && !lastDataLoadedEmpty {
             if ConnectionHelper.isConnectedToNetwork() {
-                presenter.loadData(status: status, limit: limit, page: page, search: search)
+                ConnectionHelper.checkIpAddress { [weak self] success in
+                    guard let self = self else { return }
+
+                    DispatchQueue.main.async {
+                        if success {
+                            self.presenter.loadData(status: self.status, limit: self.limit, page: self.page, search: self.search)
+                        } else {
+                            CommonHelper.showNotAllowConnection(in: self)
+                        }
+                    }
+                }
+                
             } else {
                 showNoConnection()
             }
@@ -78,7 +89,17 @@ class AplikasiVC: UIViewController {
     private func downloadFile(urlWeb: String, filename: String) {
         if !loading {
             if ConnectionHelper.isConnectedToNetwork() {
-                presenter.downloadFile(urlWeb: urlWeb, filename: filename)
+                ConnectionHelper.checkIpAddress { [weak self] success in
+                    guard let self = self else { return }
+
+                    DispatchQueue.main.async {
+                        if success {
+                            self.presenter.downloadFile(urlWeb: urlWeb, filename: filename)
+                        } else {
+                            CommonHelper.showNotAllowConnection(in: self)
+                        }
+                    }
+                }
             } else {
                 showNoConnection()
             }

+ 43 - 23
Sirani/View/BalaiUji/Index/BalaiUjiVC.swift

@@ -76,7 +76,17 @@ class BalaiUjiVC: UIViewController {
     private func loadData() {
         if !loading && !lastDataLoadedEmpty {
             if ConnectionHelper.isConnectedToNetwork() {
-                presenter.loadData(status: status, limit: limit, page: page, jenis: jenis, search: search)
+                ConnectionHelper.checkIpAddress { [weak self] success in
+                    guard let self = self else { return }
+
+                    DispatchQueue.main.async {
+                        if success {
+                            self.presenter.loadData(status: self.status, limit: self.limit, page: self.page, jenis: self.jenis, search: self.search)
+                        } else {
+                            CommonHelper.showNotAllowConnection(in: self)
+                        }
+                    }
+                }
             } else {
                 showNoConnection()
             }
@@ -99,28 +109,38 @@ class BalaiUjiVC: UIViewController {
     @IBAction func onBtnLuarNegeriDataTap(_ sender: Any) {
         if !loading {
             if ConnectionHelper.isConnectedToNetwork() {
-                self.progressLoading.show()
-                self.loading = true
-                
-                let filename = "2019_Pengakuan_Balai_Uji_Asing.pdf";
-                let destination: DownloadRequest.Destination = { _, _ in
-                    let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0]
-                    let fileURL = documentsURL.appendingPathComponent(filename)
-                    return (fileURL, [.removePreviousFile, .createIntermediateDirectories])
-                }
-                
-                let urlRequest = "https://sertifikasi.postel.go.id/esertifikasi_mobile/assets/file/2019_Pengakuan_Balai_Uji_Asing.pdf"
-                AF.download(urlRequest, to: destination).validate().responseData { response in
-                    if let url = response.fileURL {
-                        self.documentInteractorController = UIDocumentInteractionController()
-                        self.documentInteractorController.delegate = self
-                        self.documentInteractorController.url = url
-                        self.documentInteractorController.presentPreview(animated: true)
-                    }
-                    
-                    DispatchQueue.main.asyncAfter(deadline: .now() + 0.6) {
-                        self.progressLoading.hide()
-                        self.loading = false
+                ConnectionHelper.checkIpAddress { [weak self] success in
+                    guard let self = self else { return }
+
+                    DispatchQueue.main.async {
+                        if success {
+                            self.progressLoading.show()
+                            self.loading = true
+                            
+                            let filename = "2019_Pengakuan_Balai_Uji_Asing.pdf";
+                            let destination: DownloadRequest.Destination = { _, _ in
+                                let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0]
+                                let fileURL = documentsURL.appendingPathComponent(filename)
+                                return (fileURL, [.removePreviousFile, .createIntermediateDirectories])
+                            }
+                            
+                            let urlRequest = "https://sertifikasi.postel.go.id/esertifikasi_mobile/assets/file/2019_Pengakuan_Balai_Uji_Asing.pdf"
+                            AF.download(urlRequest, to: destination).validate().responseData { response in
+                                if let url = response.fileURL {
+                                    self.documentInteractorController = UIDocumentInteractionController()
+                                    self.documentInteractorController.delegate = self
+                                    self.documentInteractorController.url = url
+                                    self.documentInteractorController.presentPreview(animated: true)
+                                }
+                                
+                                DispatchQueue.main.asyncAfter(deadline: .now() + 0.6) {
+                                    self.progressLoading.hide()
+                                    self.loading = false
+                                }
+                            }
+                        } else {
+                            CommonHelper.showNotAllowConnection(in: self)
+                        }
                     }
                 }
             }

+ 11 - 1
Sirani/View/DaftarSertifikat/Index/DaftarSertifikatVC.swift

@@ -73,7 +73,17 @@ class DaftarSertifikatVC: UIViewController {
     private func loadCertificateData() {
         if !loading && !lastDataLoadedEmpty {
             if ConnectionHelper.isConnectedToNetwork() {
-                presenter.loadCertificatesData(jenis: jenis, columns: columns, cursor: cursor, prev: prev, search: search)
+                ConnectionHelper.checkIpAddress { [weak self] success in
+                    guard let self = self else { return }
+
+                    DispatchQueue.main.async {
+                        if success {
+                            self.presenter.loadCertificatesData(jenis: self.jenis, columns: self.columns, cursor: self.cursor, prev: self.prev, search: self.search)
+                        } else {
+                            CommonHelper.showNotAllowConnection(in: self)
+                        }
+                    }
+                }
             } else {
                 showNoConnection()
             }

+ 23 - 2
Sirani/View/Faq/FaqList/FaqVC.swift

@@ -91,7 +91,17 @@ class FaqVC: UIViewController {
     // private functions
     private func loadDataCategories() {
         if ConnectionHelper.isConnectedToNetwork() {
-            presenter.loadDataCategory()
+            ConnectionHelper.checkIpAddress { [weak self] success in
+                guard let self = self else { return }
+
+                DispatchQueue.main.async {
+                    if success {
+                        self.presenter.loadDataCategory()
+                    } else {
+                        CommonHelper.showNotAllowConnection(in: self)
+                    }
+                }
+            }
         } else {
             showNoConnection()
         }
@@ -104,7 +114,18 @@ class FaqVC: UIViewController {
                 tvFaqContent.reloadData()
             }
             
-            presenter.loadDataContent(faq_cat_id: categoryId)
+            ConnectionHelper.checkIpAddress { [weak self] success in
+                guard let self = self else { return }
+
+                DispatchQueue.main.async {
+                    if success {
+                        self.presenter.loadDataContent(faq_cat_id: categoryId)
+                    } else {
+                        CommonHelper.showNotAllowConnection(in: self)
+                    }
+                }
+            }
+            
         } else {
             showNoConnection()
         }

+ 93 - 7
Sirani/View/Home/HomeVC.swift

@@ -157,20 +157,21 @@ class HomeVC: UIViewController {
         } else {
             hideNotif()
         }
+        
+        setSlideImageView()
+        setNewsView()
     }
     
     override func viewDidLoad() {
         super.viewDidLoad()
         presenter.attachView(view: self)
-        presenter.loadSlideshowImages()
         
         if openNotif {
-            print("SSSSSS")
             performSegue(withIdentifier: "NotifListSegueId", sender: self)
         }
         
         setMainMenu()
-        setNewsView()
+//        setNewsView()
 //        setMoreMainMenu()
         
         userRoleId = UserState.instance.getRoleId()
@@ -218,7 +219,23 @@ class HomeVC: UIViewController {
 //                setMoreMenuSertifikat(userRoleId: userRoleId)
 //                setMoreMenuSurvey(userRoleId: userRoleId)
                 clearMoreMenuNotifData()
-                presenter.loadMenuNotifications()
+                
+                if ConnectionHelper.isConnectedToNetwork() {
+                    ConnectionHelper.checkIpAddress { [weak self] success in
+                        guard let self = self else { return }
+
+                        DispatchQueue.main.async {
+                            if success {
+                                self.presenter.loadMenuNotifications()
+                            } else {
+                                CommonHelper.showNotAllowConnection(in: self)
+                            }
+                        }
+                    }
+                } else {
+                    CommonHelper.showNoConnection(in: self)
+                }
+                
                 showNotif()
             } else {
                 clearMoreMenu()
@@ -258,7 +275,22 @@ class HomeVC: UIViewController {
     
     private func showNotif() {
         notifContainer.show()
-        presenter.loadTotalUnreadNotif()
+        
+        if ConnectionHelper.isConnectedToNetwork() {
+            ConnectionHelper.checkIpAddress { [weak self] success in
+                guard let self = self else { return }
+
+                DispatchQueue.main.async {
+                    if success {
+                        self.presenter.loadTotalUnreadNotif()
+                    } else {
+                        CommonHelper.showNotAllowConnection(in: self)
+                    }
+                }
+            }
+        } else {
+            CommonHelper.showNoConnection(in: self)
+        }
     }
     
     private func hideNotif() {
@@ -286,7 +318,45 @@ class HomeVC: UIViewController {
         footer.backgroundColor = #colorLiteral(red: 0.9814968705, green: 0.9760531783, blue: 1, alpha: 1)
         homeNewsTV.tableFooterView = footer
         
-        presenter.loadNews(cursor: 5, prev: 1, jenis: "", columns: "")
+        if ConnectionHelper.isConnectedToNetwork() {
+            ConnectionHelper.checkIpAddress { [weak self] success in
+                guard let self = self else { return }
+
+                DispatchQueue.main.async {
+                    if success {
+                        print("call news")
+                        self.presenter.loadNews(cursor: 5, prev: 1, jenis: "", columns: "")
+                    } else {
+                        CommonHelper.showNotAllowConnection(in: self)
+                        self.listNews.removeAll()
+                        self.homeNewsTV.reloadData()
+                    }
+                }
+            }
+        } else {
+            CommonHelper.showNoConnection(in: self)
+        }
+    }
+
+    private func setSlideImageView() {
+        if ConnectionHelper.isConnectedToNetwork() {
+            ConnectionHelper.checkIpAddress { [weak self] success in
+                guard let self = self else { return }
+
+                DispatchQueue.main.async {
+                    if success {
+                        print("call slideimage")
+                        self.presenter.loadSlideshowImages()
+                    } else {
+                        CommonHelper.showNotAllowConnection(in: self)
+                        self.slideshow.setImageInputs([])
+                        self.slideshow.reloadInputViews()
+                    }
+                }
+            }
+        } else {
+            CommonHelper.showNoConnection(in: self)
+        }
     }
     
     private func showMoreMenu() {
@@ -624,7 +694,22 @@ class HomeVC: UIViewController {
             let userRoleId = UserState.instance.getRoleId()
             if !userRoleId.isEmpty {
                 clearMoreMenuNotifData()
-                presenter.loadMenuNotifications()
+                
+                if ConnectionHelper.isConnectedToNetwork() {
+                    ConnectionHelper.checkIpAddress { [weak self] success in
+                        guard let self = self else { return }
+
+                        DispatchQueue.main.async {
+                            if success {
+                                self.presenter.loadMenuNotifications()
+                            } else {
+                                CommonHelper.showNotAllowConnection(in: self)
+                            }
+                        }
+                    }
+                } else {
+                    CommonHelper.showNoConnection(in: self)
+                }
             }
         }
     }
@@ -706,6 +791,7 @@ extension HomeVC: HomeViewDelegate {
                 )
             }
             homeNewsTV.endUpdates()
+            homeNewsTV.reloadData()
         }
     }
     

+ 23 - 2
Sirani/View/Label/LabelVC.swift

@@ -70,7 +70,17 @@ class LabelVC: UIViewController {
     private func loadData() {
         if !loading && !lastDataLoadedEmpty {
             if ConnectionHelper.isConnectedToNetwork() {
-                presenter.loadData(status: status, limit: limit, page: page, search: search)
+                ConnectionHelper.checkIpAddress { [weak self] success in
+                    guard let self = self else { return }
+
+                    DispatchQueue.main.async {
+                        if success {
+                            self.presenter.loadData(status: self.status, limit: self.limit, page: self.page, search: self.search)
+                        } else {
+                            CommonHelper.showNotAllowConnection(in: self)
+                        }
+                    }
+                }
             } else {
                 showNoConnection()
             }
@@ -80,7 +90,18 @@ class LabelVC: UIViewController {
     private func downloadFile(urlWeb: String, filename: String) {
         if !loading {
             if ConnectionHelper.isConnectedToNetwork() {
-                presenter.downloadFile(urlWeb: urlWeb, filename: filename)
+                ConnectionHelper.checkIpAddress { [weak self] success in
+                    guard let self = self else { return }
+
+                    DispatchQueue.main.async {
+                        if success {
+                            self.presenter.downloadFile(urlWeb: urlWeb, filename: filename)
+                        } else {
+                            CommonHelper.showNotAllowConnection(in: self)
+                        }
+                    }
+                }
+                
             } else {
                 showNoConnection()
             }

+ 11 - 1
Sirani/View/News/Detail/NewsDetailVC.swift

@@ -75,7 +75,17 @@ class NewsDetailVC: UIViewController {
         if !loading {
             if ConnectionHelper.isConnectedToNetwork() {
                 print("Load data \(newsId)")
-                presenter.loadData(newsId: newsId)
+                ConnectionHelper.checkIpAddress { [weak self] success in
+                    guard let self = self else { return }
+
+                    DispatchQueue.main.async {
+                        if success {
+                            self.presenter.loadData(newsId: self.newsId)
+                        } else {
+                            CommonHelper.showNotAllowConnection(in: self)
+                        }
+                    }
+                }
             } else {
                 showNoConnection()
             }

+ 12 - 1
Sirani/View/News/Index/NewsVC.swift

@@ -93,7 +93,18 @@ class NewsVC: UIViewController {
     private func loadData() {
         if !loading && !lastDataLoadedEmpty {
             if ConnectionHelper.isConnectedToNetwork() {
-                presenter.loadData(cursor: cursor, prev: prev, jenis: jenis, columns: columns, keyword: keyword)
+                ConnectionHelper.checkIpAddress { [weak self] success in
+                    guard let self = self else { return }
+
+                    DispatchQueue.main.async {
+                        if success {
+                            self.presenter.loadData(cursor: self.cursor, prev: self.prev, jenis: self.jenis, columns: self.columns, keyword: self.keyword)
+                        } else {
+                            CommonHelper.showNotAllowConnection(in: self)
+                        }
+                    }
+                }
+                
             } else {
                 showNoConnection()
             }

+ 28 - 2
Sirani/View/Notification/NotificationDetail/NotificationDetailVC.swift

@@ -75,8 +75,22 @@ class NotificationDetailVC: UIViewController {
     private func loadData(notifId: Int) {
         if !loading {
             if ConnectionHelper.isConnectedToNetwork() {
-                presenter.loadData(notifId: notifId)
+                ConnectionHelper.checkIpAddress { [weak self] success in
+                    guard let self = self else { return }
+
+                    DispatchQueue.main.async {
+                        if success {
+                            self.presenter.loadData(notifId: notifId)
+                        } else {
+                            CommonHelper.showNotAllowConnection(in: self)
+                        }
+                    }
+                }
+                
             }
+            else {
+               CommonHelper.showNoConnection(in: self)
+           }
         }
     }
     
@@ -114,7 +128,19 @@ extension NotificationDetailVC: NotificationDetailViewDelegate {
         lblCatatan.text = "\(notificationDetail.note)"
 
         if ConnectionHelper.isConnectedToNetwork() {
-            presenter.readNotif(notifId: notifId)
+            ConnectionHelper.checkIpAddress { [weak self] success in
+                guard let self = self else { return }
+
+                DispatchQueue.main.async {
+                    if success {
+                        self.presenter.loadData(notifId: self.notifId)
+                    } else {
+                        CommonHelper.showNotAllowConnection(in: self)
+                    }
+                }
+            }
+        } else {
+            CommonHelper.showNoConnection(in: self)
         }
     }
 }

+ 15 - 1
Sirani/View/Notification/NotificationList/NotificationListVC.swift

@@ -90,7 +90,21 @@ class NotificationListVC: UIViewController {
     private func loadData() {
         if !loading && !lastDataLoadedEmpty {
             if ConnectionHelper.isConnectedToNetwork() {
-                presenter.loadData(cursor: cursor, prev: prev)
+                if ConnectionHelper.isConnectedToNetwork() {
+                    ConnectionHelper.checkIpAddress { [weak self] success in
+                        guard let self = self else { return }
+
+                        DispatchQueue.main.async {
+                            if success {
+                                self.presenter.loadData(cursor: self.cursor, prev: self.prev)
+                            } else {
+                                CommonHelper.showNotAllowConnection(in: self)
+                            }
+                        }
+                    }
+                    
+                }
+                
             } else {
                 showNoConnection()
             }

+ 12 - 2
Sirani/View/ScanQR/Scanner/QRScannerVC.swift

@@ -167,7 +167,17 @@ class QRScannerVC: UIViewController {
     private func loadData(code: String) {
         if !loading {
             if ConnectionHelper.isConnectedToNetwork() {
-                presenter.loadData(code: code)
+                ConnectionHelper.checkIpAddress { [weak self] success in
+                    guard let self = self else { return }
+
+                    DispatchQueue.main.async {
+                        if success {
+                            self.presenter.loadData(code: code)
+                        } else {
+                            CommonHelper.showNotAllowConnection(in: self)
+                        }
+                    }
+                }
             } else {
                 showNoConnection()
             }
@@ -284,7 +294,7 @@ extension QRScannerVC: QRScannerViewDelegate {
         lblNegara.text = resultQrCode.negara
         lblAcuan.text = resultQrCode.acuan
         lblFrek.text = resultQrCode.eqp_frek
-        lblPower.text = resultQrCode.eqp_power
+//        lblPower.text = resultQrCode.eqp_power
     }
     
     func setEmptyQrCode() {

+ 11 - 1
Sirani/View/Sertifikat/SertifikatPrivate/SertifikatViewController.swift

@@ -69,7 +69,17 @@ class SertifikatViewController: UIViewController {
     private func loadCertificateData() {
         if !loading && !lastDataLoadedEmpty {
             if ConnectionHelper.isConnectedToNetwork() {
-                presenter.loadPrivateCertificatesData(status: status, limit: limit, page: page, search: search)
+                ConnectionHelper.checkIpAddress { [weak self] success in
+                    guard let self = self else { return }
+
+                    DispatchQueue.main.async {
+                        if success {
+                            self.presenter.loadPrivateCertificatesData(status: self.status, limit: self.limit, page: self.page, search: self.search)
+                        } else {
+                            CommonHelper.showNotAllowConnection(in: self)
+                        }
+                    }
+                }
             } else {
                 showNoConnection()
             }

+ 12 - 2
Sirani/View/Sertifikat/SertifikatPublic/SertifikatPublicVC.swift

@@ -69,9 +69,19 @@ class SertifikatPublicVC: UIViewController {
     private func loadCertificateData() {
         if !loading && !lastDataLoadedEmpty {
             if ConnectionHelper.isConnectedToNetwork() {
-                presenter.loadPublicCertificatesData(status: status, limit: limit, page: page, search: search)
+                ConnectionHelper.checkIpAddress { [weak self] success in
+                    guard let self = self else { return }
+
+                    DispatchQueue.main.async {
+                        if success {
+                            self.presenter.loadPublicCertificatesData(status: self.status, limit: self.limit, page: self.page, search: self.search)
+                        } else {
+                            CommonHelper.showNotAllowConnection(in: self)
+                        }
+                    }
+                }
             } else {
-                showNoConnection()
+                CommonHelper.showNoConnection(in: self)
             }
         }
     }

+ 11 - 1
Sirani/View/TarifSertifikat/Index/TarifSertifikatVC.swift

@@ -73,7 +73,17 @@ class TarifSertifikatVC: UIViewController {
     private func loadData() {
         if !loading && !lastDataLoadedEmpty {
             if ConnectionHelper.isConnectedToNetwork() {
-                presenter.loadData(jenis: jenis, columns: columns, cursor: cursor, prev: prev, search: search)
+                ConnectionHelper.checkIpAddress { [weak self] success in
+                    guard let self = self else { return }
+
+                    DispatchQueue.main.async {
+                        if success {
+                            self.presenter.loadData(jenis: self.jenis, columns: self.columns, cursor: self.cursor, prev: self.prev, search: self.search)
+                        } else {
+                            CommonHelper.showNotAllowConnection(in: self)
+                        }
+                    }
+                }
             } else {
                 showNoConnection()
             }