basic firebase notification sending + token registration logic

This commit is contained in:
2026-01-13 14:43:36 +01:00
parent ba642d10a5
commit bef418d77d
9 changed files with 173 additions and 14 deletions
@@ -0,0 +1,17 @@
package SuMoC.backend.firebase;
import SuMoC.backend.notification.models.Notification;
import com.google.firebase.messaging.Message;
import org.springframework.stereotype.Service;
@Service
public class FirebaseMessageBuilder {
public Message generateMessage(Notification notification, String token) {
var builder = Message.builder().setToken(token);
builder.putData("type", notification.getType().toString());
builder.putData("data", notification.getData());
return builder.build();
}
}