{"id":18780206,"url":"https://github.com/artysta/firebaseauthapp","last_synced_at":"2025-08-18T09:13:48.426Z","repository":{"id":115414888,"uuid":"298067089","full_name":"artysta/FirebaseAuthApp","owner":"artysta","description":"Simple Xamarin.Forms cross-platform (Android \u0026 iOS) application presenting Firebase Authentication.","archived":false,"fork":false,"pushed_at":"2023-02-06T02:44:56.000Z","size":819,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-21T06:38:57.760Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/artysta.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":"2020-09-23T19:00:08.000Z","updated_at":"2021-03-04T20:16:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"4d3f827a-4f18-4f8f-a302-c6e4d0b555ff","html_url":"https://github.com/artysta/FirebaseAuthApp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/artysta/FirebaseAuthApp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artysta%2FFirebaseAuthApp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artysta%2FFirebaseAuthApp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artysta%2FFirebaseAuthApp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artysta%2FFirebaseAuthApp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/artysta","download_url":"https://codeload.github.com/artysta/FirebaseAuthApp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artysta%2FFirebaseAuthApp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270969226,"owners_count":24677279,"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","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11-07T20:25:18.276Z","updated_at":"2025-08-18T09:13:48.387Z","avatar_url":"https://github.com/artysta.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FirebaseAuthApp\n\nSimple Xamarin.Forms cross-platform (Android \u0026amp; iOS) application presenting Firebase Authentication.\n\nRemember to add Android \u0026 iOS applications to your Firebase project and download google services confing files. Put the files to the correct directories and change **Build Action** in the properties:\n\n- FirebaseAuthApp\\FirebaseAuthApp.Android\\google-services.json (**Build Action -\u003e GoogleServicesJson**),\n- FirebaseAuthApp\\FirebaseAuthApp.iOS\\GoogleService-Info.plist (**Build Action -\u003e BundleResource**).\n\n---\n\n### #0. Wanna cofigure your own cross-platform Fireabase Authentication project?\n\nThere are a few things you need to do in order to make Firebase Authentication working on both (Android \u0026 iOS) operating systems.\n\n### #1. Start by creating new blank project for Android \u0026 iOS in the Visual Studio.\n\n### #2. Configure shared project.\n - create **IFirebaseAuthentication** in shared project:\n\n```c#\nusing System.Threading.Tasks;\n\nnamespace FirebaseAuthApp\n{\n    public interface IFirebaseAuthentication\n    {\n        Task\u003cstring\u003e LoginWithEmailPassword(string email, string password);\n        Task\u003cstring\u003e RegisterWithEmailPassword(string email, string password);\n    }\n}\n```\n\n### #3. Configure Android project.\n  - add [Xamarin.Firebase.Auth](https://www.nuget.org/packages/Xamarin.Firebase.Auth/) dependency using NuGet package manager,\n  - create **FirebaseAuthentication** implementing **IFirebaseAuthentication** interface:\n```c#\nusing Firebase.Auth;\nusing FirebaseAuthApp.Droid;\nusing System.Threading.Tasks;\nusing Xamarin.Forms;\n\n[assembly: Dependency(typeof(FirebaseAuthentication))]\nnamespace FirebaseAuthApp.Droid\n{\n\tpublic class FirebaseAuthentication : IFirebaseAuthentication\n\t{\n\t\tpublic async Task\u003cstring\u003e LoginWithEmailPassword(string email, string password)\n\t\t{\n\t\t\tvar user = await FirebaseAuth.Instance.SignInWithEmailAndPasswordAsync(email, password);\n\t\t\tvar token = await user.User.GetIdTokenAsync(false);\n\t\t\treturn token.Token;\n\t\t}\n\n\t\tpublic async Task\u003cstring\u003e RegisterWithEmailPassword(string email, string password)\n\t\t{\n\t\t\tvar user = await FirebaseAuth.Instance.CreateUserWithEmailAndPasswordAsync(email, password);\n\t\t\tvar token = await user.User.GetIdTokenAsync(false);\n\t\t\treturn token.Token;\n\t\t}\n\t}\n}\n```\n  - in **YourAppName**.Android.csproj (**FirebaseAuthApp**.Android.csproj in my case) file add:\n```xml\n\u003cItemGroup\u003e\n  \u003cGoogleServicesJson Include=\"google-services.json\" /\u003e\n\u003c/ItemGroup\u003e\n```\n - add Android appliaction to your Firebase project \u0026 download **google-services.json** config file,\n - add **google-services.json** to your Android project and change **Build Action** to **GoogleServicesJson** in its properties.\n \n \u003ctable\u003e\n   \u003ctr\u003e\n      \u003ctd\u003e\n         \u003cimg src=\"/screenshots/screenshot-android-1.png\"/\u003e\n      \u003c/td\u003e\n      \u003ctd\u003e\n         \u003cimg src=\"/screenshots/screenshot-android-2.png\"/\u003e\n      \u003c/td\u003e\n      \u003ctd\u003e\n         \u003cimg src=\"/screenshots/screenshot-android-3.png\"/\u003e\n      \u003c/td\u003e\n   \u003c/tr\u003e\n\u003c/table\u003e\n  \n### #4. Configure iOS project.\n  - add [Xamarin.Firebase.iOS.Auth](https://www.nuget.org/packages/Xamarin.Firebase.iOS.Auth/) dependency using NuGet package manager,\n  - create **FirebaseAuthentication** implementing **IFirebaseAuthentication** interface:\n```c#\nusing Firebase.Auth;\nusing FirebaseAuthApp.iOS;\nusing System.Threading.Tasks;\nusing Xamarin.Forms;\n\n[assembly: Dependency(typeof(FirebaseAuthentication))]\nnamespace FirebaseAuthApp.iOS\n{\n\tpublic class FirebaseAuthentication : IFirebaseAuthentication\n\t{\n\t\tpublic async Task\u003cstring\u003e LoginWithEmailPassword(string email, string password)\n\t\t{\n\t\t\tvar user = await Auth.DefaultInstance.SignInWithPasswordAsync(email, password);\n\t\t\treturn await user.User.GetIdTokenAsync();\n\t\t}\n\n\t\tpublic async Task\u003cstring\u003e RegisterWithEmailPassword(string email, string password)\n\t\t{\n\t\t\tvar user = await Auth.DefaultInstance.CreateUserAsync(email, password);\n\t\t\treturn await user.User.GetIdTokenAsync();\n\t\t}\n\t}\n}\n```\n  - initialize Firebase in AppDelegate.cs by adding `Firebase.Core.App.Configure();`:\n```c#\nusing Foundation;\nusing UIKit;\n\nnamespace FirebaseAuthenticationApp.iOS\n{\n\t[Register(\"AppDelegate\")]\n    public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate\n    {\n        public override bool FinishedLaunching(UIApplication app, NSDictionary options)\n        {\n            global::Xamarin.Forms.Forms.Init();\n            LoadApplication(new App());\n\n            Firebase.Core.App.Configure();\n\n            return base.FinishedLaunching(app, options);\n        }\n    }\n}\n\n```\n - add iOS appliaction to your Firebase project \u0026 download **GoogleService-Info.plist** config file,\n - add **GoogleService-Info.plist** to your iOS project and change **Build Action** to **BundleResource** in its properties.\n \n\u003ctable\u003e\n   \u003ctr\u003e\n      \u003ctd\u003e\n         \u003cimg src=\"/screenshots/screenshot-ios-1.png\"/\u003e\n      \u003c/td\u003e\n      \u003ctd\u003e\n         \u003cimg src=\"/screenshots/screenshot-ios-2.png\"/\u003e\n      \u003c/td\u003e\n      \u003ctd\u003e\n         \u003cimg src=\"/screenshots/screenshot-ios-3.png\"/\u003e\n      \u003c/td\u003e\n   \u003c/tr\u003e\n\u003c/table\u003e\n\n### 4. Check if app is working using the code below.\n```c#\nIFirebaseAuthentication auth = DependencyService.Get\u003cIFirebaseAuthentication\u003e();\n\n// Register.\nstring token = await auth.RegisterWithEmailPassword(Email, Password);\n\n// Login.\nstring token = await auth.LoginWithEmailPassword(Email, Password);\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartysta%2Ffirebaseauthapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartysta%2Ffirebaseauthapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartysta%2Ffirebaseauthapp/lists"}