] # Subscribe the devices corresponding to the registration tokens to the topic response = messaging.subscribe_to_topic(registration_tokens, topic) # Unsubscribe the devices corresponding to the registration tokens to the topic response = messaging.unsubscribe_from_topic(registration_tokens, topic) 11
'score': '850', 'time': '2:45', }, topic=topic, ) # Send a message to the devices subscribed to the provided topic. response = messaging.send(message) 12
( SELECT event_timestamp AS accepted_time FROM `project ID.firebase_messaging.data` WHERE _PARTITIONTIME = TIMESTAMP('date as YYYY-MM-DD') AND message_id = 'your message id' AND instance_id = 'your instance id' AND event = 'MESSAGE_ACCEPTED' ) sent CROSS JOIN ( SELECT event_timestamp AS delivered_time FROM `project ID.firebase_messaging.data` WHERE _PARTITIONTIME = TIMESTAMP('date as YYYY-MM-DD') AND message_id = 'your message id' AND instance_id = 'your instance id' AND (event = 'MESSAGE_DELIVERED' ) delivered; 遅延を調査するクエリの例 28