return;
}
final iOSVariant iOSVariant = (iOSVariant) variant;
Message message = pushMessage.getMessage();
PayloadBuilder builder = APNS.newPayload()
// adding recognized key values
.alertBody(message.getAlert()) // alert dialog, in iOS
.badge(message.getBadge()) // little badge icon update;
.sound(message.getSound()) // sound to be played by app
.category(message.getActionCategory()); // iOS8: User Action category
// apply the 'content-available:1' value:
if (message.isContentAvailable()) {
// content-available is for 'silent' notifications and Newsstand
builder = builder.instantDeliveryOrSilentNotification();
}
builder = builder.customFields(message.getUserData()); // adding other (submitted) fields
// we are done with adding values here, before building let's check if the msg is too long
if (builder.isTooLong()) {
// invoke the error callback and return, as it is pointless to send something out
callback.onError("Nothing sent to APNs since the payload is too large");