ibm-bluemix-mobile-services / bms-clientsdk-android-push

Android Push notifications SDK for IBM Cloud Mobile Services
Apache License 2.0
10 stars 12 forks source link

Payload is broken when Channel is used #139

Open lenzch opened 4 years ago

lenzch commented 4 years ago

When an Android app is active and receives a push notification the payload field of the message is overwritten with the channel data.

For example, when sending a message like following to the IBM Push Notifications ReST API

{"message": {
        "alert": "My Message"
    },
    "settings": {
        "gcm": {
            "channelId": "Channel1",
            "payload": {"someKey": "someValue"}
        }
    }
}

The resulting message that is provided to the app is MFPSimplePushNotification :{url:null, payload:{"enableVibration":true,"importance":3,"lockScreenVisibility":1,"bypassDND":false,"lightColor":"GREEN","showBadge":true,"channelName":"My Channel Name","enableLights":true,"channelId":"Channel1"}, alert:My Message}

Following line seems to be the root cause of this issue.

https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-push/blob/0beaa8cec0592439d01349b1bfadaf40460f505b/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/push/internal/MFPInternalPushMessage.java#L128

Could you please fix that soon?