Skip to content

Commit 5bf4d07

Browse files
authored
Updated documentation and sample snippet (#235)
1 parent 5238381 commit 5bf4d07

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/main/java/com/google/firebase/FirebaseOptions.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,8 @@ public Builder setStorageBucket(String storageBucket) {
296296
}
297297

298298
/**
299-
* Sets the <code>GoogleCredentials</code> to use to authenticate the SDK.
299+
* Sets the <code>GoogleCredentials</code> to use to authenticate the SDK. This parameter
300+
* must be specified when creating a new instance of {@link FirebaseOptions}.
300301
*
301302
* <p>See <a href="https://firebase.google.com/docs/admin/setup#initialize_the_sdk">
302303
* Initialize the SDK</a> for code samples and detailed documentation.

src/test/java/com/google/firebase/snippets/FirebaseAppSnippets.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,10 @@ public void initializeCustomApp() throws Exception {
121121
// [END access_services_nondefault]
122122
}
123123

124-
public void initializeWithServiceAccountId() {
124+
public void initializeWithServiceAccountId() throws IOException {
125125
// [START initialize_sdk_with_service_account_id]
126126
FirebaseOptions options = new FirebaseOptions.Builder()
127+
.setCredentials(GoogleCredentials.getApplicationDefault())
127128
.setServiceAccountId("[email protected]")
128129
.build();
129130
FirebaseApp.initializeApp(options);

0 commit comments

Comments
 (0)