diff --git a/README.md b/README.md
index beda22cc..533950b8 100644
--- a/README.md
+++ b/README.md
@@ -59,7 +59,6 @@ This plugin is for use with [Cordova](http://incubator.apache.org/cordova/), and
2) Modify your **AndroidManifest.xml** and add the following lines to your manifest tag:
-
diff --git a/plugin.xml b/plugin.xml
index 6bd9d925..4d3678d8 100755
--- a/plugin.xml
+++ b/plugin.xml
@@ -29,7 +29,6 @@
-
diff --git a/src/android/com/plugin/gcm/GCMIntentService.java b/src/android/com/plugin/gcm/GCMIntentService.java
index 9a46aa4a..9ea6748b 100644
--- a/src/android/com/plugin/gcm/GCMIntentService.java
+++ b/src/android/com/plugin/gcm/GCMIntentService.java
@@ -69,14 +69,12 @@ protected void onMessage(Context context, Intent intent) {
Bundle extras = intent.getExtras();
if (extras != null)
{
- boolean foreground = this.isInForeground();
+ PushPlugin.sendExtras(extras);
- extras.putBoolean("foreground", foreground);
-
- if (foreground)
- PushPlugin.sendExtras(extras);
- else
+ // Send a notification if there is a message
+ if (extras.getString("message").length() != 0) {
createNotification(context, extras);
+ }
}
}
@@ -143,18 +141,6 @@ private static String getAppName(Context context)
return (String)appName;
}
- public boolean isInForeground()
- {
- ActivityManager activityManager = (ActivityManager) getApplicationContext().getSystemService(Context.ACTIVITY_SERVICE);
- List services = activityManager
- .getRunningTasks(Integer.MAX_VALUE);
-
- if (services.get(0).topActivity.getPackageName().toString().equalsIgnoreCase(getApplicationContext().getPackageName().toString()))
- return true;
-
- return false;
- }
-
@Override
public void onError(Context context, String errorId) {
Log.e(TAG, "onError - errorId: " + errorId);