getMaxAttachmentCount static method

int getMaxAttachmentCount()

The maximum number of attachments allowed in a single message (file.count.max, default 10), from the cached app settings — falling back to the documented client default when the key is absent. Validate the attachment count against this before starting an upload.

Implementation

static int getMaxAttachmentCount() {
  final settings = SdkRegistry.getInstance().settings.getCachedSettings();
  return settings?.maxFileCount ?? UploadLimits.defaultMaxFileCount;
}