Open GoogleCodeExporter opened 9 years ago
Ubuntu operating system
Original comment by coder.a...@gmail.com
on 10 Jul 2013 at 1:19
This is the code I am using to send more than 50,000 notifications
@Override
public List<PushedNotifications> pushAlert(String environment, InputStream is,
String password, Map<Integer, PushDevice> mapPushDevices, int numberOfThreads) throws JSONException, KeystoreException, CommunicationException, Exception {
List<PushedNotifications> pushedNotifications = new ArrayList<PushedNotifications>();
try {
for (PushDevice pushDevice : mapPushDevices.values()) {
PushMessage pushMessage = pushDevice.getPushMessage();
Payload payload = new PushNotificationPayload(pushMessage.getMessage(), pushMessage.getBadge(), "default");
Map<String, Object> fields = pushMessage.getFields();
if (fields != null) {
for (Map.Entry<String, Object> entry : fields.entrySet()) {
payload.addCustomDictionary(entry.getKey(), String.valueOf(entry.getValue()));
}
}
PushedNotifications pushedNotification = null;
if ("Sandbox".equals(environment)) {
pushedNotification = Push.payload(payload, is, password, Boolean.FALSE, numberOfThreads, pushDevice.getDevicePushTokens());
} else {
pushedNotification = Push.payload(payload, is, password, Boolean.TRUE, numberOfThreads, pushDevice.getDevicePushTokens());
}
pushedNotifications.add(pushedNotification);
}
} catch (KeystoreException ex) {
throw ex;
} catch (CommunicationException ex) {
throw ex;
} catch (Exception ex) {
throw ex;
}
return pushedNotifications;
}
Original comment by coder.a...@gmail.com
on 10 Jul 2013 at 1:33
Please try latest build in the trunk. Also, did you use the Feedback service
to find out if Apple has issues with all your failed notifications?
Original comment by sype...@gmail.com
on 11 Oct 2014 at 9:47
Original issue reported on code.google.com by
coder.a...@gmail.com
on 10 Jul 2013 at 1:16