I haver read this post to:
Apple Push Notifications to specific Users
I need to send push to specific devices, but my problem is that users that log into my app, are identified by a generated UDID, not using the deprecated UIDevice. I see that easyAPNS stores this values into the MySQL:
CREATE TABLE `apns_device_history` (
2
`pid` int(9) unsigned NOT NULL auto_increment,
3
`appname` varchar(255) NOT NULL,
4
`appversion` varchar(25) default NULL,
5
`deviceuid` char(40) NOT NULL,
6
`devicetoken` char(64) NOT NULL,
7
`devicename` varchar(255) NOT NULL,
8
`devicemodel` varchar(100) NOT NULL,
9
`deviceversion` varchar(25) NOT NULL,
I don’t know how to link registered app users with this table, in order to achieve to send push to specific user. Is it possible to get by code user pid or device token?
Many thanks!
Developing any level of an APNS can be quite an undertaking unless you have a lot of knowledge into what is involved on both a server side and client side perspective.
Things to keep in mind:
Those 4 points really need to be understood before we begin any undertaking of creating any sort of push notification server.
The three listed fields are really all you need for a basic push notification server. Personal identification in your database, the token for the device entry so you know who will receive the push message, and the dateChanged is optional but good to know how long you’ve had this in your database for.
Going back to the concept of “streaming” push notifications – you should really look into how to send multiple notifications at once with a basic PHP script (I’ve done an entire server in PHP with less than 100 lines of code, so it can be pretty simple with class based PHP).
CODE:
Unfortunately it would take up a lot of space to put all the code necessary for a basic push service but I highly recommend looking into the points I’ve mentioned above as well some pretty amazing tutorials for this task listed below: