Firebase Cloud Messaging suddenly returns 401

I have a really confusing issue. I'm setting up an Admin app that would use Firebase Cloud Messaging to send a push notification to the target client. It was working for a while, and then it suddenly stopped working and I made no changes to the code - that's the confusing part!

Here is the Firebase Configuration.

FirebaseConfiguration.java

@Configuration

public class FirebaseConfig {

private final String databaseUrl;

private final String configPath;

@Inject

public FirebaseConfig(

@Value("${firebase.database.url}") String databaseUrl,

@Value("${firebase.config.path}") String configPath) {

this.databaseUrl = databaseUrl;

this.configPath = configPath;

}

@Bean

public DatabaseReference firebaseDatabase() {

return FirebaseDatabase.getInstance().getReference();

}

@PostConstruct

public void init() throws IOException {

/*

* https://firebase.google.com/docs/admin/setup Create service account; Download...

Read More »

By: StackOverFlow - Saturday, 21 July

Related Posts