Created
November 26, 2017 22:59
-
-
Save hiranya911/e6b9860a3af0e9a60b97ba4ca5b5f69d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void initWithServiceAccountCredentials() { | |
// Service account must be specified explicitly. | |
FileInputStream serviceAccount = new FileInputStream("path/to/serviceAccount.json"); | |
FirebaseOptions options = new FirebaseOptions.Builder() | |
.setCredentials(GoogleCredentials.fromStream(serviceAccount)) | |
.build(); | |
FirebaseApp.initializeApp(options); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment