diff --git a/app/src/main/java/com/pingmelive/application.java b/app/src/main/java/com/pingmelive/application.java index 1e5c078..20ba56d 100644 --- a/app/src/main/java/com/pingmelive/application.java +++ b/app/src/main/java/com/pingmelive/application.java @@ -12,7 +12,7 @@ public void onCreate() { .setErrorEventEnabled(true) .setErrorEventTitle("ERROR_TITLE") .setAPI_KEY("YOUR_API_KEY") - .setAPP_ID("YOUR_APP_ID") + .setPROJECT_ID("YOUR_APP_ID") .install(); } } diff --git a/pingmelive/src/main/java/com/pingmelive/pingMeLive.java b/pingmelive/src/main/java/com/pingmelive/pingMeLive.java index 52ed398..9656fcc 100755 --- a/pingmelive/src/main/java/com/pingmelive/pingMeLive.java +++ b/pingmelive/src/main/java/com/pingmelive/pingMeLive.java @@ -58,7 +58,7 @@ protected pingMeLive(Builder builder) { this.builder = builder; } - public static void install(@Nullable final Context context,boolean errorEvents, final String errorEventTitle, String APIKEY,String appId) { + public static void install(@Nullable final Context context,boolean errorEvents, final String errorEventTitle, String API_KEY,String PROJECT_ID) { if(errorEvents) { try { @@ -73,14 +73,14 @@ public static void install(@Nullable final Context context,boolean errorEvents, return; } - if (APIKEY == null || APIKEY.trim().length() <= 0) { + if (API_KEY == null || API_KEY.trim().length() <= 0) { Log.e(TAG, "API KEY needed check your application class"); Log.e(TAG, "pingMeLive not installed."); return; } - if (appId == null || appId.trim().length() <= 0) { - Log.e(TAG, "appId needed check your application class"); + if (PROJECT_ID == null || PROJECT_ID.trim().length() <= 0) { + Log.e(TAG, "PROJECT_ID needed check your application class"); Log.e(TAG, "pingMeLive not installed."); return; } @@ -88,8 +88,8 @@ public static void install(@Nullable final Context context,boolean errorEvents, dbHelper = DBHelper.getInstance(context); pingMePref = com.pingmelive.pingMePref.getInstance(context); - pingMePref.setAPIKey(APIKEY); - pingMePref.setAppId(appId); + pingMePref.setAPIKey(API_KEY); + pingMePref.setAppId(PROJECT_ID); //INSTALL! final Thread.UncaughtExceptionHandler oldHandler = Thread.getDefaultUncaughtExceptionHandler(); @@ -144,13 +144,13 @@ public void uncaughtException(Thread thread, final Throwable throwable) { } else { - if (APIKEY == null || APIKEY.trim().length() <= 0) { + if (API_KEY == null || API_KEY.trim().length() <= 0) { Log.e(TAG, "API KEY needed check your application class"); Log.e(TAG, "pingMeLive not installed."); return; } - if (appId == null || appId.trim().length() <= 0) { + if (PROJECT_ID == null || PROJECT_ID.trim().length() <= 0) { Log.e(TAG, "appId needed check your application class"); Log.e(TAG, "pingMeLive not installed."); return; @@ -162,8 +162,8 @@ public void uncaughtException(Thread thread, final Throwable throwable) { dbHelper = DBHelper.getInstance(context); pingMePref = com.pingmelive.pingMePref.getInstance(context); - pingMePref.setAPIKey(APIKEY); - pingMePref.setAppId(appId); + pingMePref.setAPIKey(API_KEY); + pingMePref.setAppId(PROJECT_ID); dbHelper.sendData(); } @@ -255,7 +255,7 @@ public static class Builder { boolean ErrorEventEnabled = true; String ErrorEventTitle = null; String API_KEY = null; - String APP_ID = null; + String PROJECT_ID = null; Context context; public Builder(Context context) @@ -290,17 +290,17 @@ public Builder setAPI_KEY(String API_KEY) { return this; } - String getAPP_ID() { - return APP_ID; + public String getPROJECT_ID() { + return PROJECT_ID; } - public Builder setAPP_ID(String APP_ID) { - this.APP_ID = APP_ID; + public Builder setPROJECT_ID(String PROJECT_ID) { + this.PROJECT_ID = PROJECT_ID; return this; } public void install() { - pingMeLive.install(context,isErrorEventEnabled(),getErrorEventTitle(),getAPI_KEY(),getAPP_ID()); + pingMeLive.install(context,isErrorEventEnabled(),getErrorEventTitle(),getAPI_KEY(),getPROJECT_ID()); } } } diff --git a/pingmelive/src/main/java/com/pingmelive/sendLogToServer.java b/pingmelive/src/main/java/com/pingmelive/sendLogToServer.java index b11e6f1..d574c0f 100755 --- a/pingmelive/src/main/java/com/pingmelive/sendLogToServer.java +++ b/pingmelive/src/main/java/com/pingmelive/sendLogToServer.java @@ -85,6 +85,7 @@ public void sync_local_to_server(final pingModel pingModel) { @Override public void onResponse(String response) { + Log.e("API Response",""+response); Log.e("Data","Sent to server"); dbHelper.removeEvent(pingModel.getId()); @@ -119,6 +120,7 @@ public byte[] getBody() throws AuthFailureError { } String str = jsonObject.toString(); + Log.e("API Body",jsonObject.toString()); return str.getBytes(); } @@ -131,6 +133,7 @@ public Map getHeaders() { headers.put("apikey",pingMePref.getAPIKey()); headers.put("projectid",pingMePref.getAppId()); + Log.e("API Header",headers.toString()); return headers; }