# Keys and Permissions

{% hint style="info" %}
You will need an Apple Developer Account for this step.
{% endhint %}

## Permissions

Apple requires you to add various premissions to your application in order to use ceartin Triumph functionality.&#x20;

{% tabs %}
{% tab title="Unity" %}
Unity games do this step for free! Move onto the step below.
{% endtab %}

{% tab title="Swift" %}
Navigate to `Info.plist`, which you can find by clicking on your root project file. You can add a key value pair here by hovering over a row and clicking the plus button

<figure><img src="/files/pB0FU7kDvYGgq8CNE858" alt=""><figcaption><p>Click the root of your project and select the Info tab to configure your Info.plist. You must do this before continuing the rest of the integration.</p></figcaption></figure>

You must add permissions for the following:

* **Device Camera** (for uploading profile photos): Use the key `NSCameraUsageDescription` and value "We will only use your camera when you'd like to upload a profile photo."
* **Photo Library** (also for profile photos): Use the key `NSPhotoLibraryUsageDescription` and value "We will only use your camera library if you choose to upload a profile photo from it"
* **Location Services** (for verifying player eligibility): Use the keys `NSLocationWhenInUseUsageDescription`, `NSLocationUsageDescription`, `NSLocationAlwaysAndWhenInUseUsageDescription` and value "We need to ensure you are in one of our operating states for real money functionality."

Now, navigate to the **Capabilities** section by clicking on the root of your project file and select **"Signing & Capabilities."** Hit the plus button at the upper right corner and add the **Push Notification** capability.

<figure><img src="/files/PPXNPlEbYQValRgwoalv" alt=""><figcaption><p>Click the signing and capabilities tab to add a capability to your project.</p></figcaption></figure>
{% endtab %}
{% endtabs %}

## Apple Keys&#x20;

Here you will configure (i) a push notification key and (ii) a device check key. The push notification key lets us notify players' when their tournament results are ready, and the device check key helps us ensure all scores submitted are in fact coming from a real device.&#x20;

### Push Notifications

Log in to your Apple Developer Account [here](https://idmsa.apple.com/IDMSWebAuth/signin?appIdKey=891bd3417a7776362562d2197f89480a8547b108fd934911bcbea0110d07f757\&path=%2Faccount%2F\&rv=1), and and click **Keys** under **Certificates, Identifiers & Profiles.**&#x20;

<figure><img src="/files/B4MzaLLPjE5IuEwJ5qhA" alt=""><figcaption><p>Click Identifiers Under Certificates, Indentifiers, and Profiles</p></figcaption></figure>

Under **Keys**, click the **+** button to add an key.

<figure><img src="/files/LHzGrgB2mTp8qrusLx4g" alt=""><figcaption><p>Click the + button to add a new key</p></figcaption></figure>

Create a new Apple Push Notification Service (APNs) key. Keep track of the key ID, and download the key.

### Device Check

Now, in the same place, create a **DeviceCheck** key. Keep track of the key ID, and download the key.

### Team ID

Your team ID will be in the upper right corner of the Certificates, Identifiers, & Profiles page. Keep track of your team ID.

<figure><img src="/files/m1ojrZPbgyXgG7EQ9r8d" alt=""><figcaption><p>Your TeamID will be available in the upper right corner of Certificates, Identifiers, and Profiles</p></figcaption></figure>

### Upload Keys to Triumph&#x20;

{% hint style="danger" %}
Do not mix up your keys, or Triumph will not work in production. Triple check that this step is done correctly!&#x20;
{% endhint %}

Go to Settings -> Apple Keys in the Triumph dashboard. Upload each key and type out the KeyID for each entry and hit submit.&#x20;

<figure><img src="/files/JBOP0ooSWYYQPxvRl1gm" alt=""><figcaption><p>Upload your keys under Settings -> Apple Keys in the Triumph dashboard</p></figcaption></figure>

## Next Steps&#x20;

[Build your project.](broken://pages/6eqrwnXcHVcLQixhNXxJ)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.triumpharcade.com/triumph-sdk/keys-and-permissions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
