fcm push send with java(tomcat)

Viewed 66

I tried to send push notification, but when I received in my device, push title and body has default value [service title] and [service body] How can I remove that value?

here is my code

final String apiKey = AUTH_KEY_FCM;
    URL url = new URL("https://fcm.googleapis.com/fcm/send");
    HttpURLConnection conn = (HttpURLConnection) url.openConnection();
    conn.setDoOutput(true);
    conn.setRequestMethod("POST");
    conn.setRequestProperty("Content-Type", "application/json");
    conn.setRequestProperty("Authorization", "key=" + apiKey);

    conn.setDoOutput(true);


    // 이렇게 보내면 주제를 ALL로 지정해놓은 모든 사람들한테 알림을 날려준다.
    String input = "{\"notification\" : {\"title\" : \"여기다 제목 넣기 \", \"body\" : \"여기다 내용 넣기\"}, \"to\":\"/topics/ALL\"}

enter image description here

0 Answers
Related