Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions packages/eas-cli/schema/metadata-0.json
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,65 @@
"vi": { "$ref": "#/definitions/apple/AppleAppClipLocalizedInfo", "description": "Vietnamese" }
}
},
"ApplePricing": {
"type": "object",
"additionalProperties": false,
"description": "App pricing configuration. NOTE: Apple migrated to base-territory pricing in 2023. EAS metadata currently uses the legacy `appPriceTier` API exposed by @expo/apple-utils.",
"properties": {
"tier": {
"type": "string",
"description": "App Store price tier id (e.g. \"0\" for free, \"1\" for tier 1).",
"defaultSnippets": [
{ "label": "Free", "body": "0" },
{ "label": "Tier 1", "body": "1" }
]
},
"schedule": {
"type": "array",
"description": "Future scheduled price changes. Each entry switches the app to the given tier on `startDate`. Currently parsed but not pushed (the underlying appPriceSchedules endpoint is not yet wrapped by @expo/apple-utils).",
"items": {
"type": "object",
"additionalProperties": false,
"required": ["startDate", "tier"],
"properties": {
"startDate": {
"type": "string",
"description": "ISO-8601 date the new price tier takes effect.",
"format": "date-time"
},
"tier": {
"type": "string",
"description": "App Store price tier id (e.g. \"0\" for free)."
}
}
}
}
}
},
"AppleAvailability": {
"type": "object",
"additionalProperties": false,
"description": "Territory availability configuration. Use ISO-3166 alpha-3 codes (e.g. \"USA\", \"GBR\", \"JPN\") which match App Store Connect Territory ids.",
"properties": {
"territories": {
"description": "Territories the app is available in. Use the literal string \"all\" to make the app available worldwide.",
"oneOf": [
{
"type": "array",
"uniqueItems": true,
"items": {
"type": "string",
"description": "ISO-3166 alpha-3 territory code (e.g. \"USA\")."
}
},
{
"type": "string",
"enum": ["all"]
}
]
}
}
},
"AppleAgeRatingOverride": {
"enum": [
"NONE",
Expand Down Expand Up @@ -1034,6 +1093,14 @@
"appClip": {
"$ref": "#/definitions/apple/AppleAppClip",
"description": "App Clip metadata. Only applies to apps that ship an App Clip target."
},
"pricing": {
"$ref": "#/definitions/apple/ApplePricing",
"description": "App pricing configuration (price tier + scheduled changes)."
},
"availability": {
"$ref": "#/definitions/apple/AppleAvailability",
"description": "Territory availability configuration."
}
}
}
Expand Down
12 changes: 12 additions & 0 deletions packages/eas-cli/src/metadata/apple/config/reader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ import {
AppleAppClip,
AppleAppClipDefaultExperience,
AppleAppClipLocalizedInfo,
AppleAvailability,
AppleMetadata,
ApplePreviews,
ApplePricing,
AppleScreenshots,
} from '../types';

Expand Down Expand Up @@ -257,4 +259,14 @@ export class AppleConfigReader {
public getAppClipLocalizedInfo(locale: string): AppleAppClipLocalizedInfo | null {
return this.schema.appClip?.defaultExperience?.info?.[locale] ?? null;
}

/** Get the pricing block, or null if not configured. */
public getPricing(): ApplePricing | null {
return this.schema.pricing ?? null;
}

/** Get the availability block, or null if not configured. */
public getAvailability(): AppleAvailability | null {
return this.schema.availability ?? null;
}
}
25 changes: 25 additions & 0 deletions packages/eas-cli/src/metadata/apple/config/writer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ import {
AppleAppClipDefaultExperience,
AppleAppClipLocalizedInfo,
AppleAppClipReviewDetail,
AppleAvailability,
AppleMetadata,
ApplePreviews,
ApplePricing,
AppleScreenshots,
} from '../types';

Expand Down Expand Up @@ -241,6 +243,29 @@ export class AppleConfigWriter {
}
}

/** Set the pricing configuration (price tier + scheduled changes). */
public setPricing(pricing: ApplePricing | null): void {
if (!pricing || (pricing.tier == null && !pricing.schedule?.length)) {
delete this.schema.pricing;
return;
}
this.schema.pricing = {
tier: pricing.tier,
schedule: pricing.schedule && pricing.schedule.length > 0 ? pricing.schedule : undefined,
};
}

/** Set the territory availability configuration. */
public setAvailability(availability: AppleAvailability | null): void {
if (!availability || availability.territories == null) {
delete this.schema.availability;
return;
}
this.schema.availability = {
territories: availability.territories,
};
}

/** Set per-locale App Clip info (subtitle + header image). */
public setAppClipLocalizedInfo(locale: string, info: AppleAppClipLocalizedInfo): void {
this.schema.appClip = this.schema.appClip ?? {};
Expand Down
4 changes: 3 additions & 1 deletion packages/eas-cli/src/metadata/apple/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type { AppInfoData } from './tasks/app-info';
import type { AppReviewData } from './tasks/app-review-detail';
import type { AppVersionData } from './tasks/app-version';
import type { PreviewsData } from './tasks/previews';
import type { PricingData } from './tasks/pricing';
import type { ScreenshotsData } from './tasks/screenshots';

/**
Expand All @@ -18,7 +19,8 @@ export type AppleData = { app: App; projectDir: string } & AppInfoData &
AppReviewData &
ScreenshotsData &
PreviewsData &
AppClipData;
AppClipData &
PricingData;

/**
* The unprepared partial apple data, used within the `prepareAsync` tasks.
Expand Down
Loading
Loading