Loading plugin.xml +1 −1 Changes for plugin.xml: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ <plugin xmlns="http://www.phonegap.com/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android" id="com.phonegap.plugins.PushPlugin" version="2.0.5"> version="2.1.0"> <name>PushPlugin</name> <author>Bob Easterday</author> Loading src/android/com/plugin/gcm/GCMIntentService.java +7 −0 Changes for src/android/com/plugin/gcm/GCMIntentService.java: 7 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -67,7 +67,13 @@ public class GCMIntentService extends GCMBaseIntentService { Bundle extras = intent.getExtras(); if (extras != null) { // if we are in the foreground, just surface the payload, else post it to the statusbar if (PushPlugin.isInForeground()) { extras.putBoolean("foreground", true); PushPlugin.sendExtras(extras); } else { extras.putBoolean("foreground", false); // Send a notification if there is a message if (extras.getString("message").length() != 0) { Loading @@ -75,6 +81,7 @@ public class GCMIntentService extends GCMBaseIntentService { } } } } public void createNotification(Context context, Bundle extras) { Loading src/android/com/plugin/gcm/PushHandlerActivity.java +2 −4 Changes for src/android/com/plugin/gcm/PushHandlerActivity.java: 2 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -43,12 +43,10 @@ public class PushHandlerActivity extends Activity Bundle extras = getIntent().getExtras(); if (extras != null) { Bundle originalExtras = extras.getBundle("pushBundle"); if ( !isPushPluginActive ) { originalExtras.putBoolean("coldstart", true); } originalExtras.putBoolean("foreground", false); originalExtras.putBoolean("coldstart", !isPushPluginActive); PushPlugin.sendExtras(originalExtras); } Loading src/android/com/plugin/gcm/PushPlugin.java +13 −11 Changes for src/android/com/plugin/gcm/PushPlugin.java: 13 added lines, 11 removed lines. Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ import android.content.Context; import android.os.Bundle; import android.util.Log; import org.apache.cordova.CordovaInterface; import org.apache.cordova.CordovaWebView; import org.apache.cordova.CallbackContext; import org.apache.cordova.CordovaPlugin; Loading Loading @@ -113,7 +114,6 @@ public class PushPlugin extends CordovaPlugin { public static void sendExtras(Bundle extras) { if (extras != null) { extras.putBoolean("foreground", gForeground); if (gECB != null && gWebView != null) { sendJavascript(convertBundleToJson(extras)); } else { Loading @@ -124,6 +124,12 @@ public class PushPlugin extends CordovaPlugin { } @Override public void initialize(CordovaInterface cordova, CordovaWebView webView) { super.initialize(cordova, webView); gForeground = true; } @Override public void onPause(boolean multitasking) { super.onPause(multitasking); gForeground = false; Loading @@ -135,6 +141,12 @@ public class PushPlugin extends CordovaPlugin { gForeground = true; } @Override public void onDestroy() { super.onDestroy(); gForeground = false; } /* * serializes a bundle to JSON. */ Loading Loading @@ -228,14 +240,4 @@ public class PushPlugin extends CordovaPlugin { { return gWebView != null; } public void onDestroy() { GCMRegistrar.onDestroy(getApplicationContext()); gWebView = null; gECB = null; gForeground = false; super.onDestroy(); } } Loading
plugin.xml +1 −1 Changes for plugin.xml: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ <plugin xmlns="http://www.phonegap.com/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android" id="com.phonegap.plugins.PushPlugin" version="2.0.5"> version="2.1.0"> <name>PushPlugin</name> <author>Bob Easterday</author> Loading
src/android/com/plugin/gcm/GCMIntentService.java +7 −0 Changes for src/android/com/plugin/gcm/GCMIntentService.java: 7 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -67,7 +67,13 @@ public class GCMIntentService extends GCMBaseIntentService { Bundle extras = intent.getExtras(); if (extras != null) { // if we are in the foreground, just surface the payload, else post it to the statusbar if (PushPlugin.isInForeground()) { extras.putBoolean("foreground", true); PushPlugin.sendExtras(extras); } else { extras.putBoolean("foreground", false); // Send a notification if there is a message if (extras.getString("message").length() != 0) { Loading @@ -75,6 +81,7 @@ public class GCMIntentService extends GCMBaseIntentService { } } } } public void createNotification(Context context, Bundle extras) { Loading
src/android/com/plugin/gcm/PushHandlerActivity.java +2 −4 Changes for src/android/com/plugin/gcm/PushHandlerActivity.java: 2 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -43,12 +43,10 @@ public class PushHandlerActivity extends Activity Bundle extras = getIntent().getExtras(); if (extras != null) { Bundle originalExtras = extras.getBundle("pushBundle"); if ( !isPushPluginActive ) { originalExtras.putBoolean("coldstart", true); } originalExtras.putBoolean("foreground", false); originalExtras.putBoolean("coldstart", !isPushPluginActive); PushPlugin.sendExtras(originalExtras); } Loading
src/android/com/plugin/gcm/PushPlugin.java +13 −11 Changes for src/android/com/plugin/gcm/PushPlugin.java: 13 added lines, 11 removed lines. Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ import android.content.Context; import android.os.Bundle; import android.util.Log; import org.apache.cordova.CordovaInterface; import org.apache.cordova.CordovaWebView; import org.apache.cordova.CallbackContext; import org.apache.cordova.CordovaPlugin; Loading Loading @@ -113,7 +114,6 @@ public class PushPlugin extends CordovaPlugin { public static void sendExtras(Bundle extras) { if (extras != null) { extras.putBoolean("foreground", gForeground); if (gECB != null && gWebView != null) { sendJavascript(convertBundleToJson(extras)); } else { Loading @@ -124,6 +124,12 @@ public class PushPlugin extends CordovaPlugin { } @Override public void initialize(CordovaInterface cordova, CordovaWebView webView) { super.initialize(cordova, webView); gForeground = true; } @Override public void onPause(boolean multitasking) { super.onPause(multitasking); gForeground = false; Loading @@ -135,6 +141,12 @@ public class PushPlugin extends CordovaPlugin { gForeground = true; } @Override public void onDestroy() { super.onDestroy(); gForeground = false; } /* * serializes a bundle to JSON. */ Loading Loading @@ -228,14 +240,4 @@ public class PushPlugin extends CordovaPlugin { { return gWebView != null; } public void onDestroy() { GCMRegistrar.onDestroy(getApplicationContext()); gWebView = null; gECB = null; gForeground = false; super.onDestroy(); } }