I’m using notnoop APNS Java library to send APNS notifications. Since we have a big number of users, we need to send APNS notifications in batch. According to the notnoop API, the following method seems to be the best choice:
push(Collection<String> deviceTokens, String payload)
http://notnoop.github.com/java-apns/apidocs/com/notnoop/apns/ApnsService.html
This method send a single message to multiple devices in a batch. We want to send different specific message for each device but still send all of the notifications in a batch. I didn’t find any proper methods in notnoop library to do this. Does anyone have experience on this? Is it possible to do this with notnoop library? Does Apple APNS server support this kind of pushing?
Thanks in advance!
Best,
J
You will have to iterate through your devices individually and build a separate payload for each of them. In this example, we pass a different badge count to every user:
Declare your ApnsService as a thread pool so the push goes fast
Build your payload base outside your device iteration
Iterate through your devices and add the custom message or parameters