Skip to content

Commit

Permalink
iOS: Add Firebase perf
Browse files Browse the repository at this point in the history
  • Loading branch information
ksharma-xyz committed Dec 6, 2024
1 parent f49ceb4 commit f793ead
Show file tree
Hide file tree
Showing 16 changed files with 150 additions and 155 deletions.
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ plugins {
alias(libs.plugins.composeMultiplatform) apply false
alias(libs.plugins.kotlinMultiplatform) apply false
alias(libs.plugins.firebase.crashlyticsPlugin) apply false
alias(libs.plugins.firebase.performancePlugin) apply false
}
11 changes: 2 additions & 9 deletions composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ plugins {
alias(libs.plugins.ksp)
alias(libs.plugins.google.services)
alias(libs.plugins.firebase.crashlyticsPlugin)
alias(libs.plugins.firebase.performancePlugin)
}

kotlin {
Expand Down Expand Up @@ -90,15 +91,6 @@ kotlin {
implementation(libs.kotlinx.serialization.json)
implementation(libs.lifecycle.runtime.ktx)
api(libs.di.koinAndroid)

/*
// Import the BoM for the Firebase platform
implementation(project.dependencies.platform("com.google.firebase:firebase-bom:33.7.0"))
// Add the dependencies for the Crashlytics and Analytics libraries
// When using the BoM, you don't specify versions in Firebase library dependencies
implementation(libs.firebase.crashlytics)
implementation(libs.firebase.analytics)
*/
}
}

Expand Down Expand Up @@ -129,6 +121,7 @@ kotlin {
api(libs.di.koinComposeViewmodel)
implementation(libs.firebase.gitLiveCrashlytics)
implementation(libs.firebase.gitLiveAnalytics)
implementation(libs.firebase.gitLivePerformance)
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ db-sqlRuntime = { module = "app.cash.sqldelight:runtime", version.ref = "sqlDeli
# Firebase
firebase-gitLiveCrashlytics = { module = "dev.gitlive:firebase-crashlytics", version.ref = "firebaseGitLive" }
firebase-gitLiveAnalytics = { module = "dev.gitlive:firebase-analytics", version.ref = "firebaseGitLive" }
firebase-gitLivePerformance = { module = "dev.gitlive:firebase-perf", version.ref = "firebaseGitLive" }

[plugins]
androidApplication = { id = "com.android.application", version.ref = "agp" }
Expand All @@ -103,6 +104,7 @@ composeMultiplatform = { id = "org.jetbrains.compose", version.ref = "compose-mu
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
sqldelight = { id = "app.cash.sqldelight", version.ref = "sqlDelight" }
firebase-crashlyticsPlugin = { id = "com.google.firebase.crashlytics", version = "3.0.2" }
firebase-performancePlugin = { id ="com.google.firebase.firebase-perf", version = "1.4.2" }

#Convention Plugins
krail-android-application = { id = "krail.android.application", version = "unspecified" }
Expand Down
Binary file removed iosApp/iosApp 2024-12-07 03-17-43.zip
Binary file not shown.
122 changes: 0 additions & 122 deletions iosApp/iosApp 2024-12-07 03-17-43/DistributionSummary.plist

This file was deleted.

24 changes: 0 additions & 24 deletions iosApp/iosApp 2024-12-07 03-17-43/ExportOptions.plist

This file was deleted.

Binary file removed iosApp/iosApp 2024-12-07 03-17-43/Krail App.ipa
Binary file not shown.
10 changes: 10 additions & 0 deletions iosApp/iosApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
5DC775D02D02D0500024A6DD /* FirebaseCrashlytics in Frameworks */ = {isa = PBXBuildFile; productRef = 5DC775CF2D02D0500024A6DD /* FirebaseCrashlytics */; };
5DC775D22D02D0500024A6DD /* FirebaseRemoteConfig in Frameworks */ = {isa = PBXBuildFile; productRef = 5DC775D12D02D0500024A6DD /* FirebaseRemoteConfig */; };
5DC775D82D0334EC0024A6DD /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 5DC775D72D0334EC0024A6DD /* GoogleService-Info.plist */; };
5DC775DB2D0366710024A6DD /* FirebasePerformance in Frameworks */ = {isa = PBXBuildFile; productRef = 5DC775DA2D0366710024A6DD /* FirebasePerformance */; };
7555FF83242A565900829871 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7555FF82242A565900829871 /* ContentView.swift */; };
/* End PBXBuildFile section */

Expand All @@ -35,6 +36,7 @@
files = (
5DC775D22D02D0500024A6DD /* FirebaseRemoteConfig in Frameworks */,
5DC775CE2D02D0500024A6DD /* FirebaseAnalyticsWithoutAdIdSupport in Frameworks */,
5DC775DB2D0366710024A6DD /* FirebasePerformance in Frameworks */,
5DC775D02D02D0500024A6DD /* FirebaseCrashlytics in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -118,6 +120,7 @@
5DC775CD2D02D0500024A6DD /* FirebaseAnalyticsWithoutAdIdSupport */,
5DC775CF2D02D0500024A6DD /* FirebaseCrashlytics */,
5DC775D12D02D0500024A6DD /* FirebaseRemoteConfig */,
5DC775DA2D0366710024A6DD /* FirebasePerformance */,
);
productName = iosApp;
productReference = 7555FF7B242A565900829871 /* Krail App.app */;
Expand Down Expand Up @@ -378,6 +381,7 @@
"@executable_path/Frameworks",
);
MARKETING_VERSION = "1.0-alpha10";
"OTHER_LDFLAGS[arch=*]" = "-ObjC";
PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}";
PRODUCT_NAME = "${APP_NAME}";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -413,6 +417,7 @@
"@executable_path/Frameworks",
);
MARKETING_VERSION = "1.0-alpha10";
"OTHER_LDFLAGS[arch=*]" = "-ObjC";
PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}";
PRODUCT_NAME = "${APP_NAME}";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -475,6 +480,11 @@
package = 5DC775CC2D02D0500024A6DD /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
productName = FirebaseRemoteConfig;
};
5DC775DA2D0366710024A6DD /* FirebasePerformance */ = {
isa = XCSwiftPackageProductDependency;
package = 5DC775CC2D02D0500024A6DD /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
productName = FirebasePerformance;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 7555FF73242A565900829871 /* Project object */;
Expand Down
11 changes: 11 additions & 0 deletions iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
14 changes: 14 additions & 0 deletions iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"images" : [
{
"filename" : "app-icon-1024.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions iosApp/iosApp/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
18 changes: 18 additions & 0 deletions iosApp/iosApp/ContentView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import UIKit
import SwiftUI
import KrailApp

struct ComposeView: UIViewControllerRepresentable {
func makeUIViewController(context: Context) -> UIViewController {
MainViewControllerKt.MainViewController()
}

func updateUIViewController(_ uiViewController: UIViewController, context: Context) {}
}

struct ContentView: View {
var body: some View {
ComposeView()
.ignoresSafeArea()
}
}
52 changes: 52 additions & 0 deletions iosApp/iosApp/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
</dict>
<key>UILaunchScreen</key>
<dict/>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UIRequiresFullScreen</key>
<true/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
28 changes: 28 additions & 0 deletions iosApp/iosApp/iOSApp.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import SwiftUI
import FirebaseCore
import FirebaseFirestore
import FirebaseAuth

class AppDelegate: NSObject, UIApplicationDelegate {
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
FirebaseApp.configure()

return true
}
}

@main
struct iOSApp: App {
init() {
}

// register app delegate for Firebase setup
@UIApplicationDelegateAdaptor(AppDelegate.self) var delegate

var body: some Scene {
WindowGroup {
ContentView()
}
}
}

0 comments on commit f793ead

Please sign in to comment.