CultureQuestORG/SDP2023

View on GitHub
app/src/main/java/ch/epfl/culturequest/backend/notifications_api/ApiInterface.java

Summary

Maintainability
A
0 mins
Test Coverage
F
0%
package ch.epfl.culturequest.backend.notifications_api;

import com.google.gson.JsonObject;

import ch.epfl.culturequest.BuildConfig;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Headers;
import retrofit2.http.POST;

/**
 * Interface that defines the Retrofit POST request to the Firebase Cloud
 * Messaging API that will then send the notification to the user.
 */
public interface ApiInterface {
    String BASE_URL = "https://fcm.googleapis.com";
    String SERVER_KEY = BuildConfig.FIREBASE_MESSAGING_KEY;
    String CONTENT_TYPE = "application/json";

    @Headers({"Authorization: key=" + SERVER_KEY, "Content-Type:" + CONTENT_TYPE})
    @POST("fcm/send")
    Call<JsonObject> sendNotification(@Body JsonObject payload);
}