use of in.ac.iitb.gymkhana.iitbapp.api.model.NotificationsRequest in project IITB-App by wncc.
the class MainActivity method fetchNotifications.
private void fetchNotifications() {
NotificationsRequest notificationsRequest = new NotificationsRequest(0, 20);
RetrofitInterface retrofitInterface = ServiceGenerator.createService(RetrofitInterface.class);
retrofitInterface.getNotifications(notificationsRequest).enqueue(new Callback<NotificationsResponse>() {
@Override
public void onResponse(Call<NotificationsResponse> call, Response<NotificationsResponse> response) {
if (response.isSuccessful()) {
notificationsResponse = response.body();
if (showNotifications) {
showNotifications();
showNotifications = false;
}
}
// Server Error
}
@Override
public void onFailure(Call<NotificationsResponse> call, Throwable t) {
// Network Error
}
});
}
Aggregations