diff --git a/push_notifications/gcm.py b/push_notifications/gcm.py index 10ded4b4..7e182a17 100644 --- a/push_notifications/gcm.py +++ b/push_notifications/gcm.py @@ -65,7 +65,6 @@ def dict_to_fcm_message(data: Dict[str, Any], dry_run: bool = False, **kwargs: A ttl=data.pop("time_to_live", None) or kwargs.get("time_to_live", None), restricted_package_name=data.pop("restricted_package_name", None) or kwargs.get( "restricted_package_name", None), - data=data, notification=android_notification ) diff --git a/tests/test_dict_to_message.py b/tests/test_dict_to_message.py index 00a3350c..5afddc3e 100644 --- a/tests/test_dict_to_message.py +++ b/tests/test_dict_to_message.py @@ -30,6 +30,12 @@ def test_kwargs(self): assert message.android.priority == "high" assert message.android.restricted_package_name == "restricted.package.name" + def test_data_only_in_message(self): + message = dict_to_fcm_message({"foo": "bar"}) + + assert message.data == {"foo": "bar"} + assert message.android.data is None + def test_payload_keys(self): """ old FCM_NOTIFICATIONS_PAYLOAD_KEYS payload is mapped to message object correctly