File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
main/java/com/google/firebase
test/java/com/google/firebase/snippets Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -296,7 +296,8 @@ public Builder setStorageBucket(String storageBucket) {
296
296
}
297
297
298
298
/**
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}.
300
301
*
301
302
* <p>See <a href="https://firebase.google.com/docs/admin/setup#initialize_the_sdk">
302
303
* Initialize the SDK</a> for code samples and detailed documentation.
Original file line number Diff line number Diff line change @@ -121,9 +121,10 @@ public void initializeCustomApp() throws Exception {
121
121
// [END access_services_nondefault]
122
122
}
123
123
124
- public void initializeWithServiceAccountId () {
124
+ public void initializeWithServiceAccountId () throws IOException {
125
125
// [START initialize_sdk_with_service_account_id]
126
126
FirebaseOptions options = new FirebaseOptions .Builder ()
127
+ .setCredentials (GoogleCredentials .getApplicationDefault ())
127
128
.
setServiceAccountId (
"[email protected] " )
128
129
.build ();
129
130
FirebaseApp .initializeApp (options );
You can’t perform that action at this time.
0 commit comments