{"id":27009146,"url":"https://github.com/zunda-pixel/sharing-firebase","last_synced_at":"2025-04-04T09:32:29.173Z","repository":{"id":285402818,"uuid":"957112406","full_name":"zunda-pixel/sharing-firebase","owner":"zunda-pixel","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-31T14:32:53.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T15:34:05.699Z","etag":null,"topics":["swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/zunda-pixel.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":"2025-03-29T15:32:11.000Z","updated_at":"2025-03-31T14:32:52.000Z","dependencies_parsed_at":"2025-03-31T15:34:12.984Z","dependency_job_id":"b3ab6ee3-c12f-4610-af30-d425ae9b09aa","html_url":"https://github.com/zunda-pixel/sharing-firebase","commit_stats":null,"previous_names":["zunda-pixel/sharing-firebase-swift"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zunda-pixel%2Fsharing-firebase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zunda-pixel%2Fsharing-firebase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zunda-pixel%2Fsharing-firebase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zunda-pixel%2Fsharing-firebase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zunda-pixel","download_url":"https://codeload.github.com/zunda-pixel/sharing-firebase/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247152764,"owners_count":20892552,"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":["swift"],"created_at":"2025-04-04T09:30:40.105Z","updated_at":"2025-04-04T09:32:29.172Z","avatar_url":"https://github.com/zunda-pixel.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SharingFirebase\n\nSharingFirebase uses [swift-sharing](https://github.com/pointfreeco/swift-sharing) and [firebase-swift](https://github.com/zunda-pixel/firebase-swift)\n\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fzunda-pixel%2Fsharing-firebase%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/zunda-pixel/sharing-firebase)\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fzunda-pixel%2Fsharing-firebase%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/zunda-pixel/sharing-firebase)\n\n## SharingRemoteConfig\n\n```swift\nstruct ContentView: View {\n  @SharedReader(.remoteConfig(\"parameterBool\")) var parameterBoolString: String?\n  @SharedReader(.remoteConfig(\"parameterInt\")) var parameterIntString: String?\n  @SharedReader(.remoteConfig(\"parameterString\")) var parameterString: String?\n  @SharedReader(.remoteConfig(\"parameterJson\")) var parameterJsonString: String?\n  \n  var parameterInt: Int? {\n    parameterIntString.flatMap { Int($0) }\n  }\n  \n  var parameterBool: Bool? {\n    parameterBoolString.flatMap { try? JSONDecoder().decode(Bool.self, from: Data($0.utf8)) }\n  }\n  \n  var parameterJson: User? {\n    parameterJsonString.flatMap { try? JSONDecoder().decode(User.self, from: Data($0.utf8)) }\n  }\n  \n  var body: some View {\n    VStack {\n      Text(\"String: \\(parameterString ?? \"Nothing\")\")\n      Text(\"Int: \\(parameterInt?.description ?? \"Nothing\")\")\n      Text(\"Bool: \\(parameterBool?.description ?? \"Nothing\")\")\n      Text(\"User.name: \\(parameterJson?.name ?? \"Nothing\")\")\n      Text(\"User.age: \\(parameterJson?.age.description ?? \"Nothing\")\")\n    }\n  }\n}\n\n#Preview {\n  ContentView()\n    .frame(maxWidth: 500, maxHeight: 500)\n}\n\nstruct User: Decodable {\n  var name: String\n  var age: Int\n}\n\nextension SharedReaderKey {\n  static func remoteConfig(_ key: String) -\u003e Self\n  where Self == RemoteConfigValueKey {\n    RemoteConfigValueKey(key: key, client: .sampleProject)\n  }\n}\n\nextension RemoteConfigClient\u003cURLSession\u003e {\n  static let sampleProject = RemoteConfigClient(\n    apiKey: \"AIzaSyCI6lc5~~~~~~~~m4ZQ9PoL5oVtM\",\n    projectId: \"21~~~~~289\",\n    projectName: \"n~~~~s\",\n    appId: \"1:2~~~~~~289:ios:1~~~~~~~~~d5d8\",\n    appInstanceId: UUID().uuidString,\n    httpClient: .urlSession(.shared)\n  )\n}\n```\n\n\u003cimg width=\"700px\" src=\"https://github.com/user-attachments/assets/4c0d5b6e-b964-42c7-83e1-8c9379957055\" /\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzunda-pixel%2Fsharing-firebase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzunda-pixel%2Fsharing-firebase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzunda-pixel%2Fsharing-firebase/lists"}