Skip to content

Use new submit for review API #55

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 13, 2025
Merged
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ version = client.app.create_new_version(version="1.2.3", app_id=app.identifier)
client.version.set_build(version_id=version.identifier, build_id=build.identifier)

# Submit for review
client.version.submit_for_review(version_id=version.identifier)
client.version.submit_for_review(app_id=app.identifier, platform=Platform.IOS)
```

It's that easy. Most of the time at least. If you don't have previous version to inherit information from you'll need to do things like set screenshots, reviewer info, etc. All of which is possible through this library.
Expand Down
23 changes: 12 additions & 11 deletions asconnect/version_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,30 +439,29 @@ def set_uses_idfa(
def submit_for_review(
self,
*,
version_id: str,
app_id: str,
platform: Platform,
max_attempts: int = 3,
) -> None:
"""Submit the version for review

:param version_id: The ID of the version to submit for review
:param app_id: The ID of the app to submit for review
:param platform: The platform to submit for review
:param max_attempts: The number of attempts allowed

:raises AppStoreConnectError: If runs into unretriable error or exceeds retry count
"""

try:
self.log.info(f"Submitting version for review {version_id}")
self.log.info(f"Submitting app for review {app_id}")

self.http_client.post(
endpoint="appStoreVersionSubmissions",
endpoint="reviewSubmissions",
data={
"data": {
"type": "appStoreVersionSubmissions",
"relationships": {
"appStoreVersion": {
"data": {"type": "appStoreVersions", "id": version_id}
}
},
"type": "reviewSubmissions",
"attributes": {"platform": platform.value},
"relationships": {"app": {"data": {"type": "apps", "id": app_id}}},
}
},
log_response=True,
Expand All @@ -478,7 +477,9 @@ def submit_for_review(
f"Submit failed due to server-side intermittent issue. Will sleep for 1 minute and try again, left attempt: {max_attempts - 1}."
)
time.sleep(60)
self.submit_for_review(version_id=version_id, max_attempts=max_attempts - 1)
self.submit_for_review(
app_id=app_id, platform=platform, max_attempts=max_attempts - 1
)
else:
raise # Re-raise the caught exception

Expand Down