使用FCM admin SDK发送推送通知时,我们如何记录请求和响应负载?
这就是我的代码-
FirebaseOptions options = new FirebaseOptions.Builder()
.setCredentials(GoogleCredentials.fromStream(serviceAccount))
.setDatabaseUrl("https://myapp-main-app.firebaseio.com")
.build();
FirebaseApp firebaseApp = FirebaseApp.initializeApp(options);
Notification notification = new Notification("Silly","ha ha");
Message message = Message.builder()
.setNotification(notification)
.putData("score", "850")
.setToken(registrationToken)
.build();
FirebaseMessaging instance = FirebaseMessaging.getInstance(firebaseApp);
BatchResponse batchResponse = instance.sendAll(Arrays.asList(message));