Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.

Commit a4ba5ba

Browse files
committed
Revert #744.
1 parent b69f67b commit a4ba5ba

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
3939
- `image`
4040
- `tag`
4141
- `visibility`
42+
- (Android) `data.twi_body` is no more used to trigger a notification in notification-center. Revert of [#744](https://github.com/zo0r/react-native-push-notification/pull/744)
4243

4344
### Fixed
4445

android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotificationHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ public void sendToNotificationCentreWithPicture(Bundle bundle, Bitmap largeIconB
205205

206206
if (bundle.getString("message") == null) {
207207
// this happens when a 'data' notification is received - we do not synthesize a local notification in this case
208-
Log.d(LOG_TAG, "Cannot send to notification centre because there is no 'message' field in: " + bundle);
208+
Log.d(LOG_TAG, "Ignore this message if you sent data-only notification. Cannot send to notification centre because there is no 'message' field in: " + bundle);
209209
return;
210210
}
211211

android/src/main/java/com/dieam/reactnativepushnotification/modules/RNReceivedMessageHandler.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,8 @@ public void handleReceivedMessage(RemoteMessage message) {
9999
}
100100
}
101101

102-
Map<String, String> notificationData = message.getData();
103-
104-
// Copy `twi_body` to `message` to support Twilio
105-
if (notificationData.containsKey("twi_body")) {
106-
bundle.putString("message", notificationData.get("twi_body"));
107-
}
108-
109102
Bundle dataBundle = new Bundle();
103+
Map<String, String> notificationData = message.getData();
110104

111105
for(Map.Entry<String, String> entry : notificationData.entrySet()) {
112106
dataBundle.putString(entry.getKey(), entry.getValue());

0 commit comments

Comments
 (0)