summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/android/src/com/adobe/phonegap/push/PushHandlerActivity.java
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2017-09-26 01:35:13 +0200
committerJules Laplace <julescarbon@gmail.com>2017-09-26 01:35:13 +0200
commit597fa051833ca3df6eb185c0143ff82e02dacba1 (patch)
treecb25347477c57f82e955b054b70f4bb5359fb0d2 /StoneIsland/platforms/android/src/com/adobe/phonegap/push/PushHandlerActivity.java
parent6a9186aea6b85beef28e3eb765fbf2322a1c7890 (diff)
push plugin ugh
Diffstat (limited to 'StoneIsland/platforms/android/src/com/adobe/phonegap/push/PushHandlerActivity.java')
-rw-r--r--StoneIsland/platforms/android/src/com/adobe/phonegap/push/PushHandlerActivity.java32
1 files changed, 19 insertions, 13 deletions
diff --git a/StoneIsland/platforms/android/src/com/adobe/phonegap/push/PushHandlerActivity.java b/StoneIsland/platforms/android/src/com/adobe/phonegap/push/PushHandlerActivity.java
index 23682ac8..0d399a61 100644
--- a/StoneIsland/platforms/android/src/com/adobe/phonegap/push/PushHandlerActivity.java
+++ b/StoneIsland/platforms/android/src/com/adobe/phonegap/push/PushHandlerActivity.java
@@ -11,7 +11,7 @@ import android.support.v4.app.RemoteInput;
public class PushHandlerActivity extends Activity implements PushConstants {
- private static String LOG_TAG = "PushPlugin_PushHandlerActivity";
+ private static String LOG_TAG = "Push_HandlerActivity";
/*
* this activity will be started if the user touches a notification that we own.
@@ -21,7 +21,7 @@ public class PushHandlerActivity extends Activity implements PushConstants {
*/
@Override
public void onCreate(Bundle savedInstanceState) {
- GCMIntentService gcm = new GCMIntentService();
+ FCMService gcm = new FCMService();
Intent intent = getIntent();
@@ -34,16 +34,18 @@ public class PushHandlerActivity extends Activity implements PushConstants {
Log.d(LOG_TAG, "callback = " + callback);
boolean foreground = getIntent().getExtras().getBoolean("foreground", true);
boolean startOnBackground = getIntent().getExtras().getBoolean(START_IN_BACKGROUND, false);
+ boolean dismissed = getIntent().getExtras().getBoolean(DISMISSED, false);
+ Log.d(LOG_TAG, "dismissed = " + dismissed);
if(!startOnBackground){
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
- notificationManager.cancel(GCMIntentService.getAppName(this), notId);
+ notificationManager.cancel(FCMService.getAppName(this), notId);
}
boolean isPushPluginActive = PushPlugin.isActive();
boolean inline = processPushBundle(isPushPluginActive, intent);
- if(inline && android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.N){
+ if(inline && android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.N && !startOnBackground){
foreground = true;
}
@@ -51,15 +53,17 @@ public class PushHandlerActivity extends Activity implements PushConstants {
finish();
- Log.d(LOG_TAG, "isPushPluginActive = " + isPushPluginActive);
- if (!isPushPluginActive && foreground && inline) {
- Log.d(LOG_TAG, "forceMainActivityReload");
- forceMainActivityReload(false);
- } else if(startOnBackground) {
- Log.d(LOG_TAG, "startOnBackgroundTrue");
- forceMainActivityReload(true);
- } else {
- Log.d(LOG_TAG, "don't want main activity");
+ if(!dismissed) {
+ Log.d(LOG_TAG, "isPushPluginActive = " + isPushPluginActive);
+ if (!isPushPluginActive && foreground && inline) {
+ Log.d(LOG_TAG, "forceMainActivityReload");
+ forceMainActivityReload(false);
+ } else if(startOnBackground) {
+ Log.d(LOG_TAG, "startOnBackgroundTrue");
+ forceMainActivityReload(true);
+ } else {
+ Log.d(LOG_TAG, "don't want main activity");
+ }
}
}
@@ -76,7 +80,9 @@ public class PushHandlerActivity extends Activity implements PushConstants {
originalExtras.putBoolean(FOREGROUND, false);
originalExtras.putBoolean(COLDSTART, !isPushPluginActive);
+ originalExtras.putBoolean(DISMISSED, extras.getBoolean(DISMISSED));
originalExtras.putString(ACTION_CALLBACK, extras.getString(CALLBACK));
+ originalExtras.remove(NO_CACHE);
remoteInput = RemoteInput.getResultsFromIntent(intent);
if (remoteInput != null) {