Skip to content

Commit 0456d5b

Browse files
authored
New snippet with project id defined. (#358)
In the internal bug b/290344815 we had been discussing how to initialize SDK and we come up with working version which is different than documentation on the page: https://firebase.google.com/docs/admin/setup?hl=pl#initialize_the_sdk_in_non-google_environments
1 parent db55e58 commit 0456d5b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

FirebaseAdmin/FirebaseAdmin.Snippets/FirebaseAppSnippets.cs

+11
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,17 @@ internal static void InitSdkWithApplicationDefault()
4242
// [END initialize_sdk_with_application_default]
4343
}
4444

45+
internal static void InitSdkWithApplicationDefaultAndProjectId()
46+
{
47+
// [START initialize_sdk_with_application_default_and_projectId]
48+
FirebaseApp.Create(new AppOptions()
49+
{
50+
Credential = GoogleCredential.GetApplicationDefault(),
51+
ProjectId = "my-project-id",
52+
});
53+
// [END initialize_sdk_with_application_default_and_projectId]
54+
}
55+
4556
internal static void InitSdkWithRefreshToken()
4657
{
4758
// [START initialize_sdk_with_refresh_token]

0 commit comments

Comments
 (0)