manifestinteractive/easyapns — pull request #23 by trevoriancox (2012-10-18 06:00:22+00:00)
Title: Fix for iOS 5: Fix for multiple messages sent to one device after app reinstall.

With CFUUIDCreate you may get the same token from a new UUID after a reinstall. You can end up with multiple entries for the same app, all with the same valid token. Database changes:

CREATE UNIQUE INDEX `app_token` on apns_devices (`appname`,`devicetoken`);
With this change, if a new UID is generated but the token is unchanged, update the uid in the database:
ON DUPLICATE KEY UPDATE `deviceuid`='{$deviceuid}',