Skip to content

Commit

Permalink
Copy twi_body to message to support Twilio.
Browse files Browse the repository at this point in the history
  • Loading branch information
peterp committed May 19, 2018
1 parent 5b34f15 commit 555ba35
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ public class RNPushNotificationListenerService extends GcmListenerService {
@Override
public void onMessageReceived(String from, final Bundle bundle) {
JSONObject data = getPushData(bundle.getString("data"));
// Copy `twi_body` to `message` to support Twilio
if (bundle.containsKey("twi_body")) {
bundle.putString("message", bundle.getString("twi_body"));
}

if (data != null) {
if (!bundle.containsKey("message")) {
bundle.putString("message", data.optString("alert", "Notification received"));
Expand Down

0 comments on commit 555ba35

Please sign in to comment.