.. _apple:

==============
The Apple side
==============

Publishing an iPhone app means dealing with Apple, and a few things there only a human with an Apple
account can do - no tool can do them for you. This page explains each one in plain words, so you know what
it is and why it is needed. If you use an :doc:`AI agent <../ai_assistant/index>`, it walks you through
these and asks only for the parts it cannot do itself - this page is just your reference.

There are four pieces, and you set each up once:

- an **Apple Developer Program** membership - your paid account with Apple (99 € / year)
- an **App Store Connect API key** - a credential that lets Odevio talk to Apple on your behalf
- the **app record** - the entry in Apple's console that your app's page and versions hang off
- a **bundle identifier** - your app's unique id, like ``com.acme.mybudget``

None of this is something you keep doing: it is a one-time setup, mostly per account and once per app.

Apple Developer Program
=======================

To put an app on a real iPhone, on TestFlight or on the App Store, you need a paid **Apple Developer
Program** membership - 99 € per year. Enrol at
`developer.apple.com/programs/enroll <https://developer.apple.com/programs/enroll/>`_. There is no way
around this: no build service can replace the membership.

You also need the **Admin** role on your Apple team to fill in the App Privacy section later.

App Store Connect API key
=========================

Odevio talks to Apple with an App Store Connect **API key**, which only you can create:

#. Go to `App Store Connect → Users and Access → Integrations → App Store Connect API
   <https://appstoreconnect.apple.com/access/integrations/api>`_.
#. Create a key with the **Admin** role and download the ``.p8`` file (Apple lets you download it once).
#. Note the **Issuer ID**, the **Key ID** and the path to the ``.p8`` file.

Give them to Odevio once:

.. code-block::

    odevio apple add --apple-id APPLE_TEAM_ID --name TEXT --key-id APPLE_KEY_ID --issuer-id APPLE_ISSUER_ID --private-key PATH_TO_P8

An AI agent does this step for you - it only asks you to create the key and point it at the file, because
the file is a secret it will not read.

The app record in App Store Connect
===================================

Apple does not allow the App Store listing itself to be created through the API. Once per app, you create
it by hand:

#. Go to `App Store Connect → Apps <https://appstoreconnect.apple.com/apps>`_ and click **+** → **New App**.
#. Pick the platform, a public name, the primary language, your bundle identifier and an SKU.

That is about two minutes, once per app. Everything after it - metadata, screenshots, the build and the
submission - Odevio can do for you.

The bundle identifier (App ID)
==============================

Your app needs a unique **bundle identifier** such as ``com.acme.mybudget``. Odevio creates it for you:

.. code-block::

    odevio app mk --name MY_APP_NAME --bundle-id COM.COMPANY.APP_NAME

An AI agent proposes an identifier and asks you to confirm it, so you do not have to know the format.
