I have a fleet of devices running python and need to be able to send messages to/from them each individually. I know that it is possible to send a message to an individual InstanceID token, but I can't figure out how to register a device to get an InstanceID token and then listen for messages.
I was hoping to have something like https://cloud.google.com/python/docs/reference/pubsub/latest/index.html#subscribing, where it would listen for messages for just that client. What I want is
client = messaging.client()
while true:
msg = client.getMessage()
print(msg)
I'm open to doing it with the REST API too, but can't find a way to do it there either. I've look at the python docs and the API docs.
I'm open to other ideas to accomplish this, like pub/sub, but that doesn't seem to support the individual device mapping. I could have a topic per device, but there's an upper limit of topics that may be too low.