
=================================================================================
6. How to configure App Store Connect for Flutter app iOS deployment with Odevio
=================================================================================

In this tutorial, you will learn how to **link your Apple Developer account with Odevio**.

.. note::
  If you are using the free version of Odevio, you can only have **one** Apple developer account linked to your user account. 
  
  To **link multiple accounts**, you have to **subscribe to a paid subscription**, you can discover our available plans |odevio_sub|.

Step 1: How to get an Apple API key
===================================

Go to |apple_developer| and click on the **"Account"** menu.

Log into your Apple developer account if you need to.

.. image:: /img/apple-developer-home.jpg
  :alt: Apple Developer Program Homepage
  :align: center

|

You can now see the overview of your account.

Access **Users and Access**.

.. image:: /img/app-store-connect-home.jpg
  :alt: App Store Connect home
  :align: center

|

Or via |apple_overview| and click on the **Users and Access** button.

.. image:: /img/app-store-connect-users.jpg
  :alt: App Store Connect home
  :align: center

|

You will see a list of the users. Go to the **"Keys"** tab to see a list of your keys and their status

To add a new key, press the **big "+" sign**.

.. image:: /img/apple-add-key.jpg
  :alt: Add API key
  :align: center

|

To generate an API key, simply define its name, select the role of the user and click on generate.

For more information about role permissions, check out Apple Developer Program's |official_doc|.

**In this case, developer is a sufficient pick.**

.. image:: /img/apple-generate-key.jpg
  :alt: Generate API key
  :align: center

|

Your API key has now been generated!

You have the possibility to **copy¹** the key id and to **download the API key²**.

.. danger:: **You can only download it ONCE. Make sure to save it in a safe place!**

.. image:: /img/apple-download-key.jpg
  :alt: Apple download API keys
  :align: center

|

.. image:: /img/apple-api-key.jpg
  :alt: Apple API keys
  :align: center

|

**But wait, do not close that tab yet !**

Step 2: Link the API key in Odevio
===================================

Now that you have successfully generated your API key, you can use it in the desktop client to link your accounts.

Go into the **Apple** section.

.. image:: /img/desktop-apple.jpg
  :alt: Desktop apple
  :align: center

|

You are required to complete a form with your Apple developer account informations.

Once you are done, you can press the **Add** button.

Step 3: Complete the required missing information and where to find it
======================================================================

Now that you know how to add an access between your Apple Developer account and Odevio, in this step, you will learn **where you can find the required information**.

For the **Apple ID**, you can find it on your |apple_developer_membership|.

Go to the **"Membership Details"** section and there you will find it. It is actually your Apple **Team ID**.

Just **copy & paste** it into the client in the correct field.

.. image:: /img/apple-membership.jpg
  :alt: Apple Membership
  :align: center

|

.. image:: /img/apple-team-id.jpg
  :alt: Apple Team ID
  :align: center

|

The next information you need is to give a **name** to your access.

You can name it however you want.

Next, is your **key ID**. The one you created earlier.

Go back to your App Store Connect, in the Users and Access menu and in the keys tab.

There will be your keys. You can easily **copy the key ID¹**.

You can also copy the **Issuer ID²** right above because it will be the next line Odevio will ask you to complete.

.. image:: /img/apple-id.jpg
  :alt: Apple Key ID
  :align: center

|

The **private key** is the last bit of information you need to complete. It is the **path** where you stored the file of the key you **downloaded³** earlier.

**Select the file** where you stored your key. The path should look like this:

.. code-block:: python

    /Users/USERNAME/Downloads/AuthKey_KeyID.p8

Now that your Apple Developer account was linked successfully you should see it appear in the **Apple** section like this:

.. image:: /img/desktop-apple-ls.jpg
  :alt: Desktop Apple ls
  :align: center

|

.. note::
    You can only link one Apple Developer acccount at a time with the trial version or the hobbyist plant.

    To **link multiple Apple Developer Account** to your user account, you have to **subscribe to Odevio**, check out our available plans |odevio_sub|.

.. _create_app_id:


And that is how you link your Apple Developer account with Odevio in just 3 easy steps!

.. |apple_developer| raw:: html

   <a href="https://developer.apple.com" target="_blank">https://developer.apple.com</a>

.. |apple_overview| raw:: html

   <a href="https://appstoreconnect.apple.com" target="_blank">https://appstoreconnect.apple.com</a>

.. |official_doc| raw:: html

   <a href="https://help.apple.com/app-store-connect/#/deve5f9a89d7" target="_blank">official documentation</a>

.. |apple_developer_membership| raw:: html

   <a href="https://developer.apple.com/account/#!/membership/ZQHY6MWMN2" target="_blank">Apple developper account</a>

.. |odevio_sub| raw:: html

   <a href="https://odevio.com/plans/" target="_blank">here</a>
