Skip to content

Commit

Permalink
Merge pull request #744 from chatterbugapp/pp-support-twilio-message
Browse files Browse the repository at this point in the history
Copy `twi_body` to `message` to support Twilio.
  • Loading branch information
Gp2mv3 authored Jul 17, 2018
2 parents 05c5f3c + 555ba35 commit 5318359
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", null));
Expand Down

0 comments on commit 5318359

Please sign in to comment.