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) {
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.
Original file line number Diff line number Diff 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 );
You can’t perform that action at this time.
0 commit comments