Как решить проблему с обменом сообщениями Firebase CloudJAVA

Программисты JAVA общаются здесь
Anonymous
Как решить проблему с обменом сообщениями Firebase Cloud

Сообщение Anonymous »

Я пытаюсь отправить push-уведомление через Firebase Cloud Messaging на свой мобильный телефон, но получил следующую ошибку. Не могли бы вы помочь решить эту проблему?
Изображение

public String pushNotificationFCM(ProfileDTO profileDTO, SigningTransactionDTO signingTransactionDTO) {
FirebaseApp firebaseApp = null;
try {
.....
log.info(Constants.FCM_LOG_MESSAGE + ": proxy is disabled");
// Loading the resource file from the classpath
Resource resource = new ClassPathResource(fcmKeyPath);

// Creating an InputStream from the resource
try (InputStream inputStream = resource.getInputStream()) {
FirebaseOptions options = new FirebaseOptions.Builder()
.setCredentials(GoogleCredentials.fromStream(inputStream))
.setServiceAccountId(fcmAccountService)
.build();

if (FirebaseApp.getApps().isEmpty()) {
firebaseApp = FirebaseApp.initializeApp(options);
} else {
firebaseApp = FirebaseApp.getApps().get(0);
}

log.info("Application initialized without proxy");
}
}

} catch (IOException e) {
log.error( e.getMessage());
}

try {
response = FirebaseMessaging.getInstance(firebaseApp).send(message);

} catch (FirebaseMessagingException e) {
log.info(" Error " + response);

}



Подробнее здесь: https://stackoverflow.com/questions/787 ... -messaging

Вернуться в «JAVA»