如何使用改造将设备发送到设备通知

时间:2019-04-11 06:14:46

标签: retrofit2

我不知道该如何发送ChatNotification函数。

private void sendNotificationToPatner(String token) {
    SendNotificationModel sendNotificationModel = new SendNotificationModel("check", "i miss you");
    RequestNotification requestNotificaton = new RequestNotification();
    requestNotificaton.setSendNotificationModel(sendNotificationModel);
    //token is id , whom you want to send notification ,
    requestNotificaton.setToken(token);
    ApiInterface apiService =  ApiClient.getClient().create(ApiInterface.class);
    retrofit2.Call<ResponseBody> responseBodyCall = apiService.sendChatNotification(requestNotificaton);

    responseBodyCall.enqueue(new Callback<ResponseBody>() {
        @Override
        public void onResponse(retrofit2.Call<ResponseBody> call, retrofit2.Response<ResponseBody> response) {
            Log.d("kkkk","done");
        }

        @Override
        public void onFailure(retrofit2.Call<ResponseBody> call, Throwable t) {
            Log.e("Failure", "onFailure: Task dropped" );
        }
    });
}

0 个答案:

没有答案