/** * Shrinks the alert message body so that the resulting payload * message fits within the passed expected payload length. * * This method performs best-effort approach, and its behavior * is unspecified when handling alerts where the payload * without body is already longer than the permitted size, or * if the break occurs within word. * * @param payloadLength the expected max size of the payload * @return this */ public PayloadBuilder resizeAlertBody(final int payloadLength) { return resizeAlertBody(payloadLength, ""); }
/** * Shrinks the alert message body so that the resulting payload * message fits within require Apple specification (256 bytes). * * This method performs best-effort approach, and its behavior * is unspecified when handling alerts where the payload * without body is already longer than the permitted size, or * if the break occurs within word. * * @param postfix for the truncated body, e.g. "..." * * @return this */ public PayloadBuilder shrinkBody(final String postfix) { return resizeAlertBody(Utilities.MAX_PAYLOAD_LENGTH, postfix); }