diff --git a/composeApp/src/iosMain/kotlin/com.macaosoftware.sdui.app/Bindings.kt b/composeApp/src/iosMain/kotlin/com.macaosoftware.sdui.app/Bindings.kt index 2f49e37..b076776 100644 --- a/composeApp/src/iosMain/kotlin/com.macaosoftware.sdui.app/Bindings.kt +++ b/composeApp/src/iosMain/kotlin/com.macaosoftware.sdui.app/Bindings.kt @@ -38,7 +38,5 @@ fun createPlatformBridge( // val accountPlugin = SupabaseAccountPlugin() - return IosBridge( - accountPlugin = accountPlugin - ) + return IosBridge(accountPlugin = accountPlugin) } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index a6395e3..ae5f6d1 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -4,16 +4,16 @@ androidCompileSdk = "34" androidTargetSdk = "34" androidMinSdk = "26" macaoAmadeusApi = "0.3.4" -macaoComponentToolkit = "0.6.10-rc02" +macaoComponentToolkit = "0.6.10" macaoAuthFirebase = "0.0.1-dev" koinCore = "3.6.0-wasm-alpha2" kotlin = "1.9.24-spm" agp = "8.1.4" composeAndroidCompiler = "1.6.7" -composePlugin = "1.6.10-rc03" +composePlugin = "1.6.10" androidxActivityCompose = "1.9.0" kamelImage = "0.9.4" -kotlinxCoroutines = "1.8.0" +kotlinxCoroutines = "1.8.1" ktor = "2.3.10" composeIcons = "1.1.0" kotlinxSerialization = "1.6.3" diff --git a/iOSDemoApp/iOSDemoApp.xcodeproj/project.pbxproj b/iOSDemoApp/iOSDemoApp.xcodeproj/project.pbxproj index bcd18ed..5ea734c 100644 --- a/iOSDemoApp/iOSDemoApp.xcodeproj/project.pbxproj +++ b/iOSDemoApp/iOSDemoApp.xcodeproj/project.pbxproj @@ -15,6 +15,7 @@ 9401746D2A777BE500BA34D2 /* iOSDemoAppUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9401746C2A777BE500BA34D2 /* iOSDemoAppUITests.swift */; }; 9401746F2A777BE500BA34D2 /* iOSDemoAppUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9401746E2A777BE500BA34D2 /* iOSDemoAppUITestsLaunchTests.swift */; }; 948FD8CF2B4D0A3600A9B754 /* iOSDemoAppPackage in Frameworks */ = {isa = PBXBuildFile; platformFilter = ios; productRef = 948FD8CE2B4D0A3600A9B754 /* iOSDemoAppPackage */; }; + 94D867142C006A4F00CA8E7F /* FirebaseAuthKmp in Frameworks */ = {isa = PBXBuildFile; productRef = 94D867132C006A4F00CA8E7F /* FirebaseAuthKmp */; }; 94D9FB7B2B32A74C004396A2 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 94D9FB7A2B32A74C004396A2 /* GoogleService-Info.plist */; }; 94D9FB7C2B32A74C004396A2 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 94D9FB7A2B32A74C004396A2 /* GoogleService-Info.plist */; }; 94D9FB7D2B32A74C004396A2 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 94D9FB7A2B32A74C004396A2 /* GoogleService-Info.plist */; }; @@ -59,6 +60,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 94D867142C006A4F00CA8E7F /* FirebaseAuthKmp in Frameworks */, 948FD8CF2B4D0A3600A9B754 /* iOSDemoAppPackage in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -155,6 +157,7 @@ isa = PBXNativeTarget; buildConfigurationList = 940174722A777BE500BA34D2 /* Build configuration list for PBXNativeTarget "iOSDemoApp" */; buildPhases = ( + 94477A4E2C0703C300EF5670 /* Compile Kotlin Framework */, 940174492A777BE400BA34D2 /* Sources */, 9401744A2A777BE400BA34D2 /* Frameworks */, 9401744B2A777BE400BA34D2 /* Resources */, @@ -166,6 +169,7 @@ name = iOSDemoApp; packageProductDependencies = ( 948FD8CE2B4D0A3600A9B754 /* iOSDemoAppPackage */, + 94D867132C006A4F00CA8E7F /* FirebaseAuthKmp */, ); productName = iOSDemoApp; productReference = 9401744D2A777BE400BA34D2 /* iOSDemoApp.app */; @@ -283,6 +287,27 @@ }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + 94477A4E2C0703C300EF5670 /* Compile Kotlin Framework */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "Compile Kotlin Framework"; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "if [ \"YES\" = \"$OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED\" ]; then\n echo \"Skipping Gradle build task invocation due to OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED environment variable set to \\\"YES\\\"\"\n exit 0\nfi\ncd \"$SRCROOT/..\"\n./gradlew :composeApp:embedAndSignAppleFrameworkForXcode\n"; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ 940174492A777BE400BA34D2 /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -675,6 +700,11 @@ package = 948FD8CD2B4D090E00A9B754 /* XCLocalSwiftPackageReference "iOSDemoAppPackage" */; productName = iOSDemoAppPackage; }; + 94D867132C006A4F00CA8E7F /* FirebaseAuthKmp */ = { + isa = XCSwiftPackageProductDependency; + package = 942F83682B52357400A0CD1A /* XCLocalSwiftPackageReference "../../firebase-kmp" */; + productName = FirebaseAuthKmp; + }; /* End XCSwiftPackageProductDependency section */ }; rootObject = 940174452A777BE400BA34D2 /* Project object */; diff --git a/iOSDemoApp/iOSDemoApp/ContentView.swift b/iOSDemoApp/iOSDemoApp/ContentView.swift index 4782e45..a40a674 100644 --- a/iOSDemoApp/iOSDemoApp/ContentView.swift +++ b/iOSDemoApp/iOSDemoApp/ContentView.swift @@ -3,60 +3,41 @@ import UIKit import ComposeApp struct ComposeView : UIViewControllerRepresentable { - + var iosBridge: IosBridge - + func makeUIViewController(context: Context) -> UIViewController { - // let amadeusDemoRootComponent = BindingsKt.getSduiRootComponent() - - /* - let mainViewController = BindingsKt.buildDemoViewController( - rootComponent: amadeusDemoRootComponent, - iosBridge: iosBridge, - onBackPress: { - exit(0) - } - ) - */ - + let mainViewController = BindingsKt.buildDemoMacaoApplication( iosBridge: iosBridge ) - + return mainViewController } - + func updateUIViewController(_ uiViewController: UIViewController, context: Context) {} } struct ContentView: View { - + var iosBridge: IosBridge - + var body: some View { ComposeView(iosBridge: iosBridge) - .ignoresSafeArea(.keyboard) // Compose has own keyboard handler - //.ignoresSafeArea(.all, edges: .bottom) // If prefered to handle this in compose land - - } -} -/* -struct ContentView: View { - var body: some View { - VStack { - Image(systemName: "globe") - .imageScale(.large) - .foregroundColor(.accentColor) - Text("Hello, world!") - } - .padding() + //.ignoresSafeArea(.keyboard) // Compose has own keyboard handler + .ignoresSafeArea(.all, edges: .all) // If prefered to handle this in compose land + } } struct ContentView_Previews: PreviewProvider { + static var previews: some View { - ContentView() + + let accountPlugin = MacaoAccountPluginEmpty() + + let iosBridge = BindingsKt.createPlatformBridge(accountPlugin: accountPlugin) + + ContentView(iosBridge: iosBridge) } } - -*/ diff --git a/iOSDemoApp/iOSDemoApp/MacaoDemoApp.swift b/iOSDemoApp/iOSDemoApp/MacaoDemoApp.swift index ab579d7..40230ef 100644 --- a/iOSDemoApp/iOSDemoApp/MacaoDemoApp.swift +++ b/iOSDemoApp/iOSDemoApp/MacaoDemoApp.swift @@ -12,8 +12,7 @@ struct MacaoDemoApp: App { let iob = IosBridge( accountPlugin: FirebaseAccountPlugin( firebaseAuthKmpWrapper: FirebaseAuthKmpWrapperImpl() - ), - name2: Int32(0) + ) ) // register app delegate for Firebase setup diff --git a/iOSDemoApp/iOSDemoAppPackage/Package.swift b/iOSDemoApp/iOSDemoAppPackage/Package.swift index fc92fd1..ad3d758 100644 --- a/iOSDemoApp/iOSDemoAppPackage/Package.swift +++ b/iOSDemoApp/iOSDemoAppPackage/Package.swift @@ -14,27 +14,21 @@ let package = Package( dependencies: [ .package( url: "https://github.com/firebase/firebase-ios-sdk.git", from: "10.19.0"), - // Bellow consumes firebase-kmp package from github instead of our local. - .package(url: "https://github.com/pablichjenkov/firebase-kmp.git", branch: "composeApp"), + // Bellow consumes firebase-kmp package from github instead of our local package. For development use local, to build in the pipeline use the remote pacakge. + //.package(url: "https://github.com/pablichjenkov/firebase-kmp.git", branch: "main"), ], targets: [ -// It wont be needed after JetBrains releases SPM BuildPhase task integration -// .binaryTarget( -// name: "composeApp", -// path: "../../composeApp/build/XCFrameworks/debug/composeApp.xcframework" -// ), .target( name: "iOSDemoAppPackage", dependencies: [ - //.byName(name: "composeApp"), // It wont be needed after JetBrains releases SPM BuildPhase task integration .product( name: "FirebaseAuth", package: "firebase-ios-sdk" ), - .product( - name: "FirebaseAuthKmp", - package: "firebase-kmp" - ), +// .product( +// name: "FirebaseAuthKmp", +// package: "firebase-kmp" +// ), ] ), .testTarget(