I'm trying to send data-only FCM message to topic subscribers. But it not works nether when app in background or closed.
My android app have following code:
FirebaseMessaging.getInstance().subscribeToTopic("topicname");
My FCM-sender code
from pyfcm import FCMNotification
API_KEY = "AAAA....akZKg"
push_service = FCMNotification(api_key=API_KEY)
data = {
"title":"mytitle",
"body":"mybody",
"url":"myurl"
}
print(push_service.notify_topic_subscribers(topic_name="topicname", data_message=data))
outputs
{'canonical_ids': 0, 'results': [], 'failure': 0, 'success': 1, 'multicast_id': None}
But notification not appear. Need to show message to all topic subscribers that are not have running-right-now-app (have background or closed state)