{"id":22986038,"url":"https://github.com/dora4/dora-firebase-support","last_synced_at":"2025-08-13T20:32:51.962Z","repository":{"id":194547211,"uuid":"691330556","full_name":"dora4/dora-firebase-support","owner":"dora4","description":"🧩 Dora MVVM框架扩展包 - 用于整合Firebase产品增长运营框架","archived":false,"fork":false,"pushed_at":"2024-12-14T17:25:34.000Z","size":137,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-14T18:28:53.183Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dora4.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-14T00:58:08.000Z","updated_at":"2024-12-14T17:25:38.000Z","dependencies_parsed_at":"2023-09-14T02:44:38.945Z","dependency_job_id":"f9bf017c-82fd-4df7-9c22-b1eb7f8ec7ea","html_url":"https://github.com/dora4/dora-firebase-support","commit_stats":null,"previous_names":["dora4/dora-firebase-support"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dora4%2Fdora-firebase-support","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dora4%2Fdora-firebase-support/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dora4%2Fdora-firebase-support/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dora4%2Fdora-firebase-support/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dora4","download_url":"https://codeload.github.com/dora4/dora-firebase-support/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229780079,"owners_count":18122916,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-15T03:38:28.904Z","updated_at":"2025-08-13T20:32:51.934Z","avatar_url":"https://github.com/dora4.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"dora-firebase-support\n![Release](https://jitpack.io/v/dora4/dora-firebase-support.svg)\n--------------------------------\n\n#### gradle依赖配置\n\n添加以下代码到项目根目录下的settings.gradle.kts\n```kotlin\npluginManagement {\n    resolutionStrategy {\n        eachPlugin {\n            if (requested.id.namespace == \"com.google.firebase\") {\n                useModule(\"com.google.firebase:firebase-crashlytics-gradle:2.9.2\")\n            }\n        }\n    }\n}\ndependencyResolutionManagement { {\n    repositories {\n        maven { setUrl(\"https://jitpack.io\") }\n    }\n}\n```\n添加以下代码到项目根目录下的build.gradle.kts\n```kotlin\nplugins {\n    id(\"com.google.gms.google-services\") version(\"4.3.15\") apply(false)\n    id(\"com.google.firebase.firebase-perf\") version(\"1.4.2\") apply(false)\n}\n```\n添加以下代码到app模块的build.gradle.kts\n```kotlin\ndependencies {\n    // 扩展包必须在有主框架dora的情况下使用\n    implementation(\"com.github.dora4:dora:1.3.14\")\n    implementation(\"com.github.dora4:dora-firebase-support:1.13\")\n}\n```\n\n在app模块加入google-services.json并在其build.gradle.kts加入以下代码。\n```kotlin\nplugins {\n    id(\"com.google.gms.google-services\")\n    id(\"com.google.firebase.crashlytics\")\n    id(\"com.google.firebase.firebase-perf\")\n}\n```\n#### 使用方式\n\n在AndroidManifest中加入配置。\n```xml\n\u003capplication\u003e\n        \u003c!-- Dora生命周期注入的配置 --\u003e\n        \u003cmeta-data\n            android:name=\"dora.lifecycle.config.FirebaseGlobalConfig\"\n            android:value=\"GlobalConfig\"/\u003e\n\u003c/application\u003e\n```\n\n使用SpmUtils的工具方法埋点统计，使用activity和fragment以spm开头的扩展函数也可以。\n\n```kotlin\nspmSelectContent(\"查看官方公告详情\")    // 通用行为统计\nspmLogin(\"google\")    // 谷歌登录\nspmSignUp(\"huawei\")    // 华为应用市场渠道包注册\nspmPurchase(currency = \"USD\", value = 1.0) // 衡量购买收入，用户成功支付了1USD      \nspmAdImpression(platformName = \"\", impressionData = null)   // 衡量广告收入\n```\n\n添加以下代码检测性能。\n```kotlin\n// Import these Performance Monitoring classes at the top of your `.kt` file\nimport com.google.firebase.perf.FirebasePerformance\nimport com.google.firebase.perf.metrics.AddTrace\n\n// Add the `@AddTrace` annotation above the method you want to trace\n// the `enabled` argument is optional and defaults to true\n@AddTrace(name = \"onCreateTrace\", enabled = true)\noverride fun onCreate(savedInstanceState: Bundle?) {\nsuper.onCreate(savedInstanceState)\n}\n```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdora4%2Fdora-firebase-support","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdora4%2Fdora-firebase-support","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdora4%2Fdora-firebase-support/lists"}