java - Multiple GCM Registration IDs for the same user sending push notifications multiple times -


in backend receive gcm registration_id, user_id (unique), latitude, longitude, score etc android application , save in amazon dynamodb table. when want send push notifications mobiles, fetch gcm registration ids, put java.util.set avoid duplicates , send push notifications android devices based on set of registration ids.

but problem is, since whenever user uninstall , install android application again, new registration_id generated , receive & save in database. hence, same user receive push notifications multiple number of times, , it's because of multiple gcm registration_ids saved same user.

how solve problem in backend? want send 1 push notification every user. using java spring framework? example code , code query dynamodb highly helpful. tia

you need keep 1 entry of gcm registration_id against each user in database, whenever user loagin or install application @ time should send gcm registration_id server , replace older 1 new id... check following link

http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/expressions.modifying.html#expressions.modifying.updateexpressions


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -