Commit a5797a4d authored by lvarano's avatar lvarano
Browse files

Debug Test

parent f855239e
Pipeline #8457 passed with stages
in 3 minutes and 5 seconds
package ch.amiv.android_app.core;
import android.app.AlarmManager;
import android.app.Notification;
import android.app.NotificationManager;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
......@@ -8,6 +12,7 @@ import android.support.design.widget.NavigationView;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.support.v4.app.NotificationCompat;
import android.support.v4.view.GravityCompat;
import android.support.v4.view.ViewPager;
import android.support.v4.widget.DrawerLayout;
......@@ -30,6 +35,8 @@ import ch.amiv.android_app.jobs.JobDetailActivity;
import ch.amiv.android_app.util.PersistentStorage;
import ch.amiv.android_app.util.Util;
import static ch.amiv.android_app.core.Notifications.pendingIntent;
/**
* This is the first screen. features: drawer, pageview with bottom navigation bar and within each page a list view.
*/
......@@ -37,6 +44,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
public static MainActivity instance;
//region - ====Variables====
private NavigationView drawerNav;
private TextView drawer_title;
......@@ -108,6 +116,28 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
PersistentStorage.LoadJobs(getApplicationContext());
InitialisePageView();
// send test notification at start
//Notifications.notify(this,"new Event up", "register now", R.drawable.ic_amiv_logo_icon);
Notifications.set_Alarm(this);
//Notifications.event_notifier(this,null);
Request.FetchEventListChanges(this, new Request.OnDataReceivedCallback() {
@Override
public void OnDataReceived() {
}
}, new Request.OnDataReceivedCallback() {
@Override
public void OnDataReceived() {
}
}, "2018-09-06T10:00:00Z");
//fetch the user info if we are logged in, there exists a token from the previous session, should be cached.
if(!PersistentStorage.LoadUserInfo(getApplicationContext()) || UserInfo.current._id.isEmpty() && !Settings.IsEmailOnlyLogin(getApplicationContext())) {
Request.FetchUserData(getApplicationContext(), drawerNav, new Request.OnDataReceivedCallback() {
......
......@@ -92,7 +92,7 @@ public final class Request {
return;
}
String url = Settings.API_URL + "events?" + "projection={\"_id\":1}" + "&where={\"_created\":{\"$gt\":" + + "}, \"show_website\": true}";
String url = Settings.API_URL + "events?" + "projection={\"_id\":1}" + "&where={\"_created\":{\"$gt\":\"" +last_update_time + "\"}, \"show_website\": true}";
Log.e("request", "url: " + url);
StringRequest request = new StringRequest(com.android.volley.Request.Method.GET, url,null, null)
......@@ -140,7 +140,7 @@ public final class Request {
RunCallback(errorCallback);
return super.parseNetworkError(volleyError);
}
/*
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
if(Settings.HasToken(context)) {
......@@ -154,7 +154,7 @@ public final class Request {
}
return super.getHeaders();
}
}*/
};
//send the request and check if it failed
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment