public static int validatePayloadLength( string locKey, string locArgs, string message, string actionLocKey, string launchImage, string badge, string sound, string payload, int contentAvailable) { string s = ApnsUtils.processPayload(locKey, locArgs, message, actionLocKey, launchImage, badge, sound, payload, contentAvailable); try { return(Encoding.UTF8.GetBytes(s).Length); } catch (Exception ex) { throw new Exception("payload json get bytese error", ex); } }
public static bool validatePayload(string locKey, string locArgs, string message, string actionLocKey, string launchImage, string badge, string sound, string payload, int contentAvailable) { return(ApnsUtils.validatePayloadLength(locKey, locArgs, message, actionLocKey, launchImage, badge, sound, payload, contentAvailable) <= 256); }