From 8d236ffcfc5cf0ba3080d7dc31bb65bc111b0593 Mon Sep 17 00:00:00 2001 From: Jose Torres Date: Mon, 22 Feb 2016 20:11:17 -0600 Subject: [PATCH] - Added notification logic to mix panel push --- .../bentonow/bentonow/service/gcm/GcmBroadcastReceiver.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/bentonow/bentonow/service/gcm/GcmBroadcastReceiver.java b/app/src/main/java/com/bentonow/bentonow/service/gcm/GcmBroadcastReceiver.java index bc8e601..9019d76 100644 --- a/app/src/main/java/com/bentonow/bentonow/service/gcm/GcmBroadcastReceiver.java +++ b/app/src/main/java/com/bentonow/bentonow/service/gcm/GcmBroadcastReceiver.java @@ -11,6 +11,7 @@ import com.bentonow.bentonow.Utils.DebugUtils; import com.bentonow.bentonow.Utils.NotificationUtils; +import com.bentonow.bentonow.Utils.SharedPreferencesUtil; public class GcmBroadcastReceiver extends WakefulBroadcastReceiver { @@ -24,7 +25,8 @@ public void onReceive(Context context, final Intent intent) { new Thread(new Runnable() { public void run() { try { - NotificationUtils.displayNotification(intent.getExtras().getString("mp_message")); + if (SharedPreferencesUtil.getBooleanPreference(SharedPreferencesUtil.SHOW_NOTIFICATIONS)) + NotificationUtils.displayNotification(intent.getExtras().getString("mp_message")); } catch (Exception e) { DebugUtils.logError("GcmBroadcastReceiver", e); }