EasyAPNS - chat app

57 views
Skip to first unread message

George Marmaridis

unread,
Oct 25, 2013, 6:31:50 PM10/25/13
to easy...@googlegroups.com
Hey,

Up to now I have set up EasyAPNS and everything's working fine (I can send push notifications to my app via samples.php).

What I have trouble figuring out though, is how I should design my database in order to support basic chat functionality in my iOS app.

What I want to accomplish is:
1. User A composes a message for User B.
2. When User A hits the "Send" button, a HTTP request is made to my server, telling it to send a push notification to User B's device(s).

I hope the above logic is correct, if not, correct me.

What troubles my mind is that, every user (so User B included), may have more than one devices, so more than one entry in apns_devices table.

What would be the best practice to implement the above behaviour? Should I add a userId field in the apns_devices and then use SELECT to get all of a user's devices and send the notification to them? Or it's better if I don't mess with the default apns generated tables at all and do something else?

Thanks


Reply all
Reply to author
Forward
0 new messages