metadata library

Classes

AppStoreMetadata
ImageInfo
What a screenshot has to satisfy, read straight out of the file header.
LocaleMetadata
One locale's listing.
PreviewSpec
The pixel sizes Apple accepts for one PreviewType.
ScreenshotSpec
The pixel sizes Apple accepts for one ScreenshotDisplayType.
StoreImageRules
What one store accepts in the encoding of a listing image.
VideoInfo
What a preview has to satisfy, read straight out of the container.
VideoRules
What a store accepts in a preview video, named after whose rules they are.

Enums

ImageFormat
Which container a header came out of.
VideoContainer
Which container a header came out of.

Constants

appInfoLimits → const Map<String, int>
App Store Connect's limits on the listing text, in UTF-16 code units.
appStoreImageRules → const StoreImageRules
Apple, for every screenshot.
appStorePreviewRules → const VideoRules
Apple's app preview rules, from the App Store Connect help's preview specifications page.
contentRightsDeclarations → const Set<String>
The two answers Apple accepts for "does this app contain, show or access third-party content".
defaultPreviewFrameTimeCode → const String
Roughly where Apple poses a preview that names no frame.
maxPreviews → const int
Apple takes up to three previews per PreviewType per locale.
maxScreenshots → const int
minScreenshots → const int
Apple takes 1 to 10 screenshots per display type.
playIconImageRules → const StoreImageRules
Play's app icon, the exception in both directions: it is the one slot that asks for an alpha channel, and it is still 8 bits per channel.
playImageRules → const StoreImageRules
Play, for screenshots, the feature graphic and the TV banner — every slot this package checks but the icon. (Play's Android XR slot says only "PNG or JPEG"; nothing here uploads to it.)
previewExtensions → const Set<String>
The extensions Apple accepts for a preview, lowercased.
previewSpecs → const Map<String, PreviewSpec>
Keyed by PreviewType as the API spells it, because these are also the directory names in the tree — so a typo fails this lookup rather than uploading into the wrong slot.
previewTimeCodeSuffix → const String
What a preview's poster-frame sidecar file is called, appended to the video's own name — 01-ride.mp4 is posed by 01-ride.mp4.timecode.
reviewNotesLimit → const int
What Apple accepts in appStoreReviewDetails.notes.
reviewNotesMarker → const String
Where the reviewer-facing half of review-notes.md stops.
screenshotSpecs → const Map<String, ScreenshotSpec>
Keyed by ScreenshotDisplayType as the API spells it, because these names are also the directory names in the tree — so a typo fails this lookup rather than being uploaded into the wrong slot, or silently ignored.
urlLimit → const int
URLs are capped too, and Apple rejects the whole localization rather than the offending field.
versionLimits → const Map<String, int>

Functions

imageEncodingProblem(ImageInfo image, StoreImageRules rules) String?
What rules refuse about image's encoding, as a sentence to follow the file's name, or null when nothing does.
loadMetadata(String path) AppStoreMetadata
Loads and fully validates the tree rooted at path.
posterFrameSidecar(String videoPath, Iterable<String> candidates, {String label = ''}) String?
The one path among candidates that poses the video at videoPath, or null when none does.
previewFrameOffset(String value, double frameRate) Duration
value as a position in the video, given the rate its frames run at.
previewFrameTimeCodeProblem(String value, {double? frameRate}) String?
Why value is not a poster-frame timecode, or null when it is.
readImageInfo(List<int> bytes) ImageInfo?
Dimensions, transparency and bit depth of a PNG or JPEG, or null if bytes is neither.
readReviewNotes(File file, {String label = 'review-notes.md'}) String
The reviewer-facing half of a review-notes file, as plain text.
readVideoInfo(List<int> bytes) VideoInfo?
Dimensions, duration, frame rate and codec of an MP4 or QuickTime file, or null if bytes is neither.
videoEncodingProblem(VideoInfo video, VideoRules rules) String?
Why video is not something rules accepts, or null when it is.

Typedefs

LocalPreview = ({File file, String? frameTimeCode})
One preview video and the poster frame it was told to use.

Exceptions / Errors

MetadataException
Thrown for anything wrong with the tree. Always actionable: it names the file and says what would have to be true instead.