diff options
Diffstat (limited to 'juick-notifications/src/main')
-rw-r--r-- | juick-notifications/src/main/java/com/juick/components/FirebaseManager.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/juick-notifications/src/main/java/com/juick/components/FirebaseManager.java b/juick-notifications/src/main/java/com/juick/components/FirebaseManager.java index a150c010..e2ffd9d5 100644 --- a/juick-notifications/src/main/java/com/juick/components/FirebaseManager.java +++ b/juick-notifications/src/main/java/com/juick/components/FirebaseManager.java @@ -14,6 +14,8 @@ import com.juick.service.component.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; +import org.springframework.core.io.ClassPathResource; +import org.springframework.core.io.Resource; import javax.annotation.PostConstruct; import javax.inject.Inject; @@ -35,11 +37,11 @@ public class FirebaseManager implements NotificationListener { @PostConstruct public void initialize() throws IOException { - InputStream serviceAccount = - ClassLoader.class.getResourceAsStream("serviceAccount.json"); + Resource serviceAccount = + new ClassPathResource("serviceAccount.json"); FirebaseOptions options = new FirebaseOptions.Builder() - .setCredentials(GoogleCredentials.fromStream(serviceAccount)) + .setCredentials(GoogleCredentials.fromStream(serviceAccount.getInputStream())) .setDatabaseUrl(fcmDatabaseUrl) .build(); |