Reid
Reid

Reputation: 4544

Amazon SNS - Only send push notification if

I currently have an IoT device that posts its location to a PHP page, and then that page adds the location to the database (DynamoDB). [note: I am designing this as a platform for potentially thousands of devices]

I am creating an android app to view the current position of the device. I would like to push the current position to the app using SNS, but I am unclear on how to structure the flow.

I need to be able to post to a topic with the serial number of the device that was just updated, and somehow have the app only receive the message if its device is the one that was changed. How would I structure this and make sure that an app isnt being bombarded every time any device changes.

I know I am not explaining what I need too well, so hopefully this flowchart of what should happen helpsenter image description here

In basic terms app B never gets a push notification saying that Device A's position has changed, but App A does get that notification.

I know that this can be done if I have separate topics for each device, but I cant think of a good way for the PHP to interact with that.

Upvotes: 0

Views: 72

Answers (1)

stdunbar
stdunbar

Reputation: 17535

In effect you need a publish/subscribe mechanism that doesn't really exist in AWS. In the past I've used PubNub for something like this as it scales to pretty much whatever you need. It isn't free (well, after the first 100 devices) but you can set up a 1 to 1 or a 1 to many subscription pretty easily. I don't work for them but have used them professionally in the past.

Upvotes: 1

Related Questions