From 62639779171715874c5aec4907738a515691d016 Mon Sep 17 00:00:00 2001 From: Austin Huang Date: Tue, 1 Sep 2020 20:21:45 -0400 Subject: [PATCH] fix notification --- .../instagrabber/activities/NotificationsViewer.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/awais/instagrabber/activities/NotificationsViewer.java b/app/src/main/java/awais/instagrabber/activities/NotificationsViewer.java index 4bb0cb2a..b8117022 100755 --- a/app/src/main/java/awais/instagrabber/activities/NotificationsViewer.java +++ b/app/src/main/java/awais/instagrabber/activities/NotificationsViewer.java @@ -17,6 +17,7 @@ import androidx.annotation.Nullable; import androidx.appcompat.app.AlertDialog; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; +import java.io.DataOutputStream; import java.net.HttpURLConnection; import java.net.URL; @@ -169,8 +170,16 @@ public final class NotificationsViewer extends BaseLanguageActivity implements S urlConnection.setRequestProperty("User-Agent", Constants.USER_AGENT); urlConnection.setRequestProperty("x-csrftoken", Utils.settingsHelper.getString(Constants.COOKIE).split("csrftoken=")[1].split(";")[0]); + final String urlParameters = "timestamp="+(System.currentTimeMillis()/1000); + urlConnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); + urlConnection.setRequestProperty("Content-Length", "" + + urlParameters.getBytes().length); + urlConnection.setDoOutput(true); + DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream()); + wr.writeBytes(urlParameters); + wr.flush(); + wr.close(); urlConnection.connect(); - urlConnection.disconnect(); } catch (Throwable ex) { Log.e("austin_debug", "seen: " + ex); }