From 2b6ee56d71a8a0619b88074af1122dc2ded71f60 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 16 Nov 2025 09:23:36 +0300 Subject: [PATCH] PenguinIn iOS implementation --- ios/Runner.xcodeproj/project.pbxproj | 117 +++++------------- ios/Runner/AppDelegate.swift | 2 +- .../Helper/HMGPenguinInPlatformBridge.swift | 56 ++++----- ios/Runner/Penguin/PenguinModel.swift | 5 +- ios/Runner/Penguin/PenguinNavigator.swift | 36 +++--- ios/Runner/Penguin/PenguinView.swift | 14 ++- 6 files changed, 90 insertions(+), 140 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 5c92a3a..7a41ae2 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -11,33 +11,23 @@ 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 478CFA942E638C8E0064F3D7 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 478CFA932E638C8E0064F3D7 /* GoogleService-Info.plist */; }; - 61243AFC2EC5F4FC00D46FA0 /* Penguin.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 61243AF82EC5F4F600D46FA0 /* Penguin.xcframework */; }; - 61243AFD2EC5F4FC00D46FA0 /* Penguin.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 61243AF82EC5F4F600D46FA0 /* Penguin.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 61243AFE2EC5F50300D46FA0 /* PenguinINRenderer.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 61243AF92EC5F4F600D46FA0 /* PenguinINRenderer.xcframework */; }; - 61243AFF2EC5F50300D46FA0 /* PenguinINRenderer.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 61243AF92EC5F4F600D46FA0 /* PenguinINRenderer.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 61243B002EC5F50300D46FA0 /* PenNavUI.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 61243AFA2EC5F4F600D46FA0 /* PenNavUI.xcframework */; }; - 61243B012EC5F50300D46FA0 /* PenNavUI.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 61243AFA2EC5F4F600D46FA0 /* PenNavUI.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 61243B482EC5FA3700D46FA0 /* OpenTokPlatformBridge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61243B402EC5FA3700D46FA0 /* OpenTokPlatformBridge.swift */; }; 61243B492EC5FA3700D46FA0 /* PenguinModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61243B422EC5FA3700D46FA0 /* PenguinModel.swift */; }; - 61243B4A2EC5FA3700D46FA0 /* MainFlutterVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61243B352EC5FA3700D46FA0 /* MainFlutterVC.swift */; }; - 61243B4B2EC5FA3700D46FA0 /* HMGPlatformBridge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61243B3E2EC5FA3700D46FA0 /* HMGPlatformBridge.swift */; }; 61243B4C2EC5FA3700D46FA0 /* HMGPenguinInPlatformBridge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61243B3D2EC5FA3700D46FA0 /* HMGPenguinInPlatformBridge.swift */; }; - 61243B4D2EC5FA3700D46FA0 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61243B382EC5FA3700D46FA0 /* Extensions.swift */; }; - 61243B4E2EC5FA3700D46FA0 /* GeoZoneModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61243B3A2EC5FA3700D46FA0 /* GeoZoneModel.swift */; }; - 61243B4F2EC5FA3700D46FA0 /* API.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61243B372EC5FA3700D46FA0 /* API.swift */; }; 61243B502EC5FA3700D46FA0 /* PenguinView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61243B452EC5FA3700D46FA0 /* PenguinView.swift */; }; - 61243B512EC5FA3700D46FA0 /* FlutterConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61243B392EC5FA3700D46FA0 /* FlutterConstants.swift */; }; - 61243B522EC5FA3700D46FA0 /* LocalizedFromFlutter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61243B3F2EC5FA3700D46FA0 /* LocalizedFromFlutter.swift */; }; - 61243B532EC5FA3700D46FA0 /* HMG_Geofence.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61243B3C2EC5FA3700D46FA0 /* HMG_Geofence.swift */; }; 61243B542EC5FA3700D46FA0 /* PenguinPlugin.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61243B442EC5FA3700D46FA0 /* PenguinPlugin.swift */; }; - 61243B552EC5FA3700D46FA0 /* GlobalHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61243B3B2EC5FA3700D46FA0 /* GlobalHelper.swift */; }; 61243B562EC5FA3700D46FA0 /* PenguinNavigator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61243B432EC5FA3700D46FA0 /* PenguinNavigator.swift */; }; 61243B572EC5FA3700D46FA0 /* PenguinViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61243B462EC5FA3700D46FA0 /* PenguinViewFactory.swift */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 766D8CB62EC60BE600D05E07 /* Penguin.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 766D8CB32EC60BE600D05E07 /* Penguin.xcframework */; }; + 766D8CB72EC60BE600D05E07 /* Penguin.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 766D8CB32EC60BE600D05E07 /* Penguin.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 766D8CB82EC60BE600D05E07 /* PenNavUI.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 766D8CB42EC60BE600D05E07 /* PenNavUI.xcframework */; }; + 766D8CB92EC60BE600D05E07 /* PenNavUI.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 766D8CB42EC60BE600D05E07 /* PenNavUI.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 766D8CBA2EC60BE600D05E07 /* PenguinINRenderer.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 766D8CB52EC60BE600D05E07 /* PenguinINRenderer.xcframework */; }; + 766D8CBB2EC60BE600D05E07 /* PenguinINRenderer.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 766D8CB52EC60BE600D05E07 /* PenguinINRenderer.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; - B976FB9C47411C32B24D5E01 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ACE60DF9393168FD748550B3 /* Pods_Runner.framework */; }; + DE1EF78253E64BE86845D2CC /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D562310E31D1DDEFA02A6C12 /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -57,9 +47,9 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - 61243AFF2EC5F50300D46FA0 /* PenguinINRenderer.xcframework in Embed Frameworks */, - 61243AFD2EC5F4FC00D46FA0 /* Penguin.xcframework in Embed Frameworks */, - 61243B012EC5F50300D46FA0 /* PenNavUI.xcframework in Embed Frameworks */, + 766D8CB72EC60BE600D05E07 /* Penguin.xcframework in Embed Frameworks */, + 766D8CBB2EC60BE600D05E07 /* PenguinINRenderer.xcframework in Embed Frameworks */, + 766D8CB92EC60BE600D05E07 /* PenNavUI.xcframework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -74,20 +64,7 @@ 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 478CFA932E638C8E0064F3D7 /* GoogleService-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; 478CFA952E6E20A60064F3D7 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = ""; }; - 61243AF82EC5F4F600D46FA0 /* Penguin.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = Penguin.xcframework; sourceTree = ""; }; - 61243AF92EC5F4F600D46FA0 /* PenguinINRenderer.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = PenguinINRenderer.xcframework; sourceTree = ""; }; - 61243AFA2EC5F4F600D46FA0 /* PenNavUI.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = PenNavUI.xcframework; sourceTree = ""; }; - 61243B352EC5FA3700D46FA0 /* MainFlutterVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterVC.swift; sourceTree = ""; }; - 61243B372EC5FA3700D46FA0 /* API.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = API.swift; sourceTree = ""; }; - 61243B382EC5FA3700D46FA0 /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; - 61243B392EC5FA3700D46FA0 /* FlutterConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlutterConstants.swift; sourceTree = ""; }; - 61243B3A2EC5FA3700D46FA0 /* GeoZoneModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GeoZoneModel.swift; sourceTree = ""; }; - 61243B3B2EC5FA3700D46FA0 /* GlobalHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GlobalHelper.swift; sourceTree = ""; }; - 61243B3C2EC5FA3700D46FA0 /* HMG_Geofence.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HMG_Geofence.swift; sourceTree = ""; }; 61243B3D2EC5FA3700D46FA0 /* HMGPenguinInPlatformBridge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HMGPenguinInPlatformBridge.swift; sourceTree = ""; }; - 61243B3E2EC5FA3700D46FA0 /* HMGPlatformBridge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HMGPlatformBridge.swift; sourceTree = ""; }; - 61243B3F2EC5FA3700D46FA0 /* LocalizedFromFlutter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalizedFromFlutter.swift; sourceTree = ""; }; - 61243B402EC5FA3700D46FA0 /* OpenTokPlatformBridge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpenTokPlatformBridge.swift; sourceTree = ""; }; 61243B422EC5FA3700D46FA0 /* PenguinModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PenguinModel.swift; sourceTree = ""; }; 61243B432EC5FA3700D46FA0 /* PenguinNavigator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PenguinNavigator.swift; sourceTree = ""; }; 61243B442EC5FA3700D46FA0 /* PenguinPlugin.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PenguinPlugin.swift; sourceTree = ""; }; @@ -96,6 +73,9 @@ 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7595037DD52211B91157B0F3 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + 766D8CB32EC60BE600D05E07 /* Penguin.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = Penguin.xcframework; path = Frameworks/Penguin.xcframework; sourceTree = ""; }; + 766D8CB42EC60BE600D05E07 /* PenNavUI.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = PenNavUI.xcframework; path = Frameworks/PenNavUI.xcframework; sourceTree = ""; }; + 766D8CB52EC60BE600D05E07 /* PenguinINRenderer.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = PenguinINRenderer.xcframework; path = Frameworks/PenguinINRenderer.xcframework; sourceTree = ""; }; 769C9BF82E6F106D009F68A9 /* RunnerDebug.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = RunnerDebug.entitlements; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 8E12CEEB8E334EE22D5259D7 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; @@ -106,7 +86,7 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - ACE60DF9393168FD748550B3 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D562310E31D1DDEFA02A6C12 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; D6BB17A036DF7FCE75271203 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -115,10 +95,10 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 61243AFC2EC5F4FC00D46FA0 /* Penguin.xcframework in Frameworks */, - 61243B002EC5F50300D46FA0 /* PenNavUI.xcframework in Frameworks */, - 61243AFE2EC5F50300D46FA0 /* PenguinINRenderer.xcframework in Frameworks */, - B976FB9C47411C32B24D5E01 /* Pods_Runner.framework in Frameworks */, + 766D8CB62EC60BE600D05E07 /* Penguin.xcframework in Frameworks */, + 766D8CBA2EC60BE600D05E07 /* PenguinINRenderer.xcframework in Frameworks */, + 766D8CB82EC60BE600D05E07 /* PenNavUI.xcframework in Frameworks */, + DE1EF78253E64BE86845D2CC /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -133,38 +113,10 @@ path = RunnerTests; sourceTree = ""; }; - 61243AFB2EC5F4F600D46FA0 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 61243AF82EC5F4F600D46FA0 /* Penguin.xcframework */, - 61243AF92EC5F4F600D46FA0 /* PenguinINRenderer.xcframework */, - 61243AFA2EC5F4F600D46FA0 /* PenNavUI.xcframework */, - ); - name = Frameworks; - path = "../../../Downloads/PenNavPandP-iOS-demo-4.4.3-hmg/Frameworks"; - sourceTree = ""; - }; - 61243B362EC5FA3700D46FA0 /* Controllers */ = { - isa = PBXGroup; - children = ( - 61243B352EC5FA3700D46FA0 /* MainFlutterVC.swift */, - ); - path = Controllers; - sourceTree = ""; - }; 61243B412EC5FA3700D46FA0 /* Helper */ = { isa = PBXGroup; children = ( - 61243B372EC5FA3700D46FA0 /* API.swift */, - 61243B382EC5FA3700D46FA0 /* Extensions.swift */, - 61243B392EC5FA3700D46FA0 /* FlutterConstants.swift */, - 61243B3A2EC5FA3700D46FA0 /* GeoZoneModel.swift */, - 61243B3B2EC5FA3700D46FA0 /* GlobalHelper.swift */, - 61243B3C2EC5FA3700D46FA0 /* HMG_Geofence.swift */, 61243B3D2EC5FA3700D46FA0 /* HMGPenguinInPlatformBridge.swift */, - 61243B3E2EC5FA3700D46FA0 /* HMGPlatformBridge.swift */, - 61243B3F2EC5FA3700D46FA0 /* LocalizedFromFlutter.swift */, - 61243B402EC5FA3700D46FA0 /* OpenTokPlatformBridge.swift */, ); path = Helper; sourceTree = ""; @@ -181,6 +133,17 @@ path = Penguin; sourceTree = ""; }; + 766D8CB22EC60BE600D05E07 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 766D8CB32EC60BE600D05E07 /* Penguin.xcframework */, + 766D8CB52EC60BE600D05E07 /* PenguinINRenderer.xcframework */, + 766D8CB42EC60BE600D05E07 /* PenNavUI.xcframework */, + D562310E31D1DDEFA02A6C12 /* Pods_Runner.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; 79DD2093A1D9674C94359FC8 /* Pods */ = { isa = PBXGroup; children = ( @@ -210,7 +173,7 @@ 97C146EF1CF9000F007C117D /* Products */, 331C8082294A63A400263BE5 /* RunnerTests */, 79DD2093A1D9674C94359FC8 /* Pods */, - A07D637C76A0ABB38659D189 /* Frameworks */, + 766D8CB22EC60BE600D05E07 /* Frameworks */, ); sourceTree = ""; }; @@ -226,7 +189,6 @@ 97C146F01CF9000F007C117D /* Runner */ = { isa = PBXGroup; children = ( - 61243B362EC5FA3700D46FA0 /* Controllers */, 61243B412EC5FA3700D46FA0 /* Helper */, 61243B472EC5FA3700D46FA0 /* Penguin */, 769C9BF82E6F106D009F68A9 /* RunnerDebug.entitlements */, @@ -244,15 +206,6 @@ path = Runner; sourceTree = ""; }; - A07D637C76A0ABB38659D189 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 61243AFB2EC5F4F600D46FA0 /* Frameworks */, - ACE60DF9393168FD748550B3 /* Pods_Runner.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -461,20 +414,10 @@ buildActionMask = 2147483647; files = ( 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, - 61243B482EC5FA3700D46FA0 /* OpenTokPlatformBridge.swift in Sources */, 61243B492EC5FA3700D46FA0 /* PenguinModel.swift in Sources */, - 61243B4A2EC5FA3700D46FA0 /* MainFlutterVC.swift in Sources */, - 61243B4B2EC5FA3700D46FA0 /* HMGPlatformBridge.swift in Sources */, 61243B4C2EC5FA3700D46FA0 /* HMGPenguinInPlatformBridge.swift in Sources */, - 61243B4D2EC5FA3700D46FA0 /* Extensions.swift in Sources */, - 61243B4E2EC5FA3700D46FA0 /* GeoZoneModel.swift in Sources */, - 61243B4F2EC5FA3700D46FA0 /* API.swift in Sources */, 61243B502EC5FA3700D46FA0 /* PenguinView.swift in Sources */, - 61243B512EC5FA3700D46FA0 /* FlutterConstants.swift in Sources */, - 61243B522EC5FA3700D46FA0 /* LocalizedFromFlutter.swift in Sources */, - 61243B532EC5FA3700D46FA0 /* HMG_Geofence.swift in Sources */, 61243B542EC5FA3700D46FA0 /* PenguinPlugin.swift in Sources */, - 61243B552EC5FA3700D46FA0 /* GlobalHelper.swift in Sources */, 61243B562EC5FA3700D46FA0 /* PenguinNavigator.swift in Sources */, 61243B572EC5FA3700D46FA0 /* PenguinViewFactory.swift in Sources */, 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift index ff8d078..7245b37 100644 --- a/ios/Runner/AppDelegate.swift +++ b/ios/Runner/AppDelegate.swift @@ -16,7 +16,7 @@ import GoogleMaps return super.application(application, didFinishLaunchingWithOptions: launchOptions) } func initializePlatformChannels(){ - if let mainViewController = window.rootViewController as? FlutterViewController{ // platform initialization suppose to be in foreground + if let mainViewController = window?.rootViewController as? FlutterViewController{ // platform initialization suppose to be in foreground HMGPenguinInPlatformBridge.initialize(flutterViewController: mainViewController) diff --git a/ios/Runner/Helper/HMGPenguinInPlatformBridge.swift b/ios/Runner/Helper/HMGPenguinInPlatformBridge.swift index c4a4424..db02e8f 100644 --- a/ios/Runner/Helper/HMGPenguinInPlatformBridge.swift +++ b/ios/Runner/Helper/HMGPenguinInPlatformBridge.swift @@ -3,14 +3,14 @@ import FLAnimatedImage var flutterMethodChannelPenguinIn:FlutterMethodChannel? = nil -fileprivate var mainViewController:MainFlutterVC! +fileprivate var mainViewController:FlutterViewController! class HMGPenguinInPlatformBridge{ private let channelName = "launch_penguin_ui" private static var shared_:HMGPenguinInPlatformBridge? - class func initialize(flutterViewController:MainFlutterVC){ + class func initialize(flutterViewController:FlutterViewController){ shared_ = HMGPenguinInPlatformBridge() mainViewController = flutterViewController shared_?.openChannel() @@ -53,40 +53,40 @@ class HMGPenguinInPlatformBridge{ mainViewController.view.addSubview(penguinUIView) - guard let args = arguments as? [String: Any], - let loaderImageData = args["loaderImage"] as? FlutterStandardTypedData else { - print("loaderImage data not found in arguments") - result(FlutterError(code: "ARGUMENT_ERROR", message: "Missing loaderImage data", details: nil)) - return - } + let args = arguments as? [String: Any] +// let loaderImageData = args["loaderImage"] as? FlutterStandardTypedData else { +// print("loaderImage data not found in arguments") +// result(FlutterError(code: "ARGUMENT_ERROR", message: "Missing loaderImage data", details: nil)) +// return +// } - let loadingOverlay = UIView(frame: UIScreen.main.bounds) - loadingOverlay.backgroundColor = UIColor.black.withAlphaComponent(0.5) // Semi-transparent overlay - loadingOverlay.autoresizingMask = [.flexibleWidth, .flexibleHeight] +// let loadingOverlay = UIView(frame: UIScreen.main.bounds) +// loadingOverlay.backgroundColor = UIColor.black.withAlphaComponent(0.5) // Semi-transparent overlay +// loadingOverlay.autoresizingMask = [.flexibleWidth, .flexibleHeight] // Display the GIF using FLAnimatedImage - let animatedImage = FLAnimatedImage(animatedGIFData: loaderImageData.data) - let gifImageView = FLAnimatedImageView() - gifImageView.animatedImage = animatedImage - gifImageView.frame = CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height) - gifImageView.center = loadingOverlay.center - gifImageView.contentMode = .scaleAspectFit - loadingOverlay.addSubview(gifImageView) +// let animatedImage = FLAnimatedImage(animatedGIFData: loaderImageData.data) +// let gifImageView = FLAnimatedImageView() +// gifImageView.animatedImage = animatedImage +// gifImageView.frame = CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height) +// gifImageView.center = loadingOverlay.center +// gifImageView.contentMode = .scaleAspectFit +// loadingOverlay.addSubview(gifImageView) - if let window = UIApplication.shared.windows.first { - window.addSubview(loadingOverlay) - - } else { - print("Error: Main window not found") - } +// if let window = UIApplication.shared.windows.first { +// window.addSubview(loadingOverlay) +// +// } else { +// print("Error: Main window not found") +// } penguinView.onSuccess = { // Hide and remove the loader - DispatchQueue.main.async { - loadingOverlay.removeFromSuperview() - - } +// DispatchQueue.main.async { +// loadingOverlay.removeFromSuperview() +// +// } } result(nil) diff --git a/ios/Runner/Penguin/PenguinModel.swift b/ios/Runner/Penguin/PenguinModel.swift index e41979d..7b6ab2d 100644 --- a/ios/Runner/Penguin/PenguinModel.swift +++ b/ios/Runner/Penguin/PenguinModel.swift @@ -26,10 +26,11 @@ struct PenguinModel { let languageCode: String let clinicID: String let patientID: String - let projectID: String + let projectID: Int // Initialize the model from a dictionary init?(from dictionary: [String: Any]) { + guard let baseURL = dictionary["baseURL"] as? String, let dataURL = dictionary["dataURL"] as? String, @@ -48,7 +49,7 @@ struct PenguinModel { let languageCode = dictionary["languageCode"] as? String, let clinicID = dictionary["clinicID"] as? String, let patientID = dictionary["patientID"] as? String, - let projectID = dictionary["projectID"] as? String + let projectID = dictionary["projectID"] as? Int else { print("Initialization failed due to missing or invalid keys.") return nil diff --git a/ios/Runner/Penguin/PenguinNavigator.swift b/ios/Runner/Penguin/PenguinNavigator.swift index e7ce55b..31cf626 100644 --- a/ios/Runner/Penguin/PenguinNavigator.swift +++ b/ios/Runner/Penguin/PenguinNavigator.swift @@ -13,28 +13,28 @@ class PenguinNavigator { print("PenguinSDKNavigator Error: \(message)") } - func navigateToPOI( referenceId:String,completion: @escaping (Bool, String?) -> Void) { - PenNavUIManager.shared.getToken(clientID: config.clientID, clientKey: config.clientKey) { [weak self] token, error in + func navigateToPOI( referenceId:String,completion: @escaping (Bool, String?) -> Void) { + PenNavUIManager.shared.getToken(clientID: config.clientID, clientKey: config.clientKey, showProgress: true) { [weak self] token, error in - if let error = error { - let errorMessage = "Token error while getting the for Navigate to method" - completion(false, "Failed to get token: \(errorMessage)") + if let error = error { + let errorMessage = "Token error while getting the for Navigate to method" + completion(false, "Failed to get token: \(errorMessage)") - print("Failed to get token: \(errorMessage)") - return - } + print("Failed to get token: \(errorMessage)") + return + } - guard let token = token else { - completion(false, "Token is nil") - print("Token is nil") - return - } - print("Token Generated") - print(token); + guard let token = token else { + completion(false, "Token is nil") + print("Token is nil") + return + } + print("Token Generated") + print(token); - - } - } + + } + } private func handleNavigation(referenceId: String, token: String, completion: @escaping (Bool, String?) -> Void) { DispatchQueue.main.async { diff --git a/ios/Runner/Penguin/PenguinView.swift b/ios/Runner/Penguin/PenguinView.swift index b5161eb..3824dff 100644 --- a/ios/Runner/Penguin/PenguinView.swift +++ b/ios/Runner/Penguin/PenguinView.swift @@ -179,9 +179,11 @@ class PenguinView: NSObject, FlutterPlatformView, PIEventsDelegate, PenNavInitia .setEnableReportIssue(enable: args.isEnableReportIssue) .setLanguage(args.languageCode) - - .setBackButtonVisibility(true) - + + .setBackButtonVisibility(visible: true) + +// .setCampusID(args.projectID) + .build() } @@ -340,7 +342,7 @@ class PenguinView: NSObject, FlutterPlatformView, PIEventsDelegate, PenNavInitia - PenNavUIManager.shared.getToken(clientID: config.clientID, clientKey: config.clientKey) { [weak self] token, error in + PenNavUIManager.shared.getToken(clientID: config.clientID, clientKey: config.clientKey, showProgress: true) { [weak self] token, error in if let error = error { @@ -442,4 +444,8 @@ class PenguinView: NSObject, FlutterPlatformView, PIEventsDelegate, PenNavInitia print("onPenNavInitializationError: \(errorDescription)") } + + func onPenNavInitializationSuccess(){ + + } }