Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion android/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# during compilation, packaging, distribution, etc.
#

version: 3.5.3
version: 3.5.4
apiversion: 4
architectures: arm64-v8a armeabi-v7a x86 x86_64
description: titanium-firebase-cloud-messaging
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ private Boolean showNotification(RemoteMessage remoteMessage) {
String parseTitle = "";
String parseText = "";
boolean isParse = false;
boolean noContent = false;

if ( TiApplication.isCurrentActivityInForeground()) {
showNotification = false;
Expand All @@ -145,7 +146,7 @@ private Boolean showNotification(RemoteMessage remoteMessage) {
&& params.get("big_text") == null && params.get("big_text_summary") == null && params.get("ticker") == null
&& params.get("image") == null) {
// no actual content - don't show it
showNotification = false;
noContent = true;
}

// Check if it is a default Parse/Sashido message ("data.data.alert")
Expand Down Expand Up @@ -215,14 +216,14 @@ private Boolean showNotification(RemoteMessage remoteMessage) {
Log.e(TAG, "Error adding fields: " + ex.getMessage());
}

if (!showNotification) {
if (noContent) {
// hidden notification - still send broadcast with data for next app start
Intent i = new Intent().setAction("ti.firebase.messaging.hidden-notification");
i.addCategory(Intent.CATEGORY_LAUNCHER);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
i.putExtra("fcm_data", jsonData.toString());
sendBroadcast(i);
return false;
return true;
}

Intent notificationIntent = new Intent(this, PushHandlerActivity.class);
Expand Down