I am able to successfully send a title/text message using pyfcm:
result = push_service.notify_multiple_devices(registration_ids=registration_tokens, message_title="title",
message_body="testing")
But when I try to send a data message, it fails:
payload = {
'action': 'testing',
'test number': 1,
'question': "what do you do with a klondike bar?",
}
result = push_service.multiple_devices_data_message(registration_ids=registration_tokens, data_message=payload)
In the first case, I receive the text/message in my FirebaseMessagingService on the phone in the onMessageReceived method as expected. In the second case (dictionary data payload), it is never received:
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
super.onMessageReceived(remoteMessage);
RemoteMessage.Notification data = remoteMessage.getNotification();
System.out.print("here");
}
In both cases, result seems to be a success.
Any suggestions would be most welcome!