# Initializing AR Using an IAP

By default, in the ARwayKit SDK, visitors can start navigation from IAPs only if they enter the map through the map list tab, select a map from the list, tap "Enter Map," and then tap the "Scan Access Point" button. This is because the map ID must first be selected so that the scanner can load the possible IAPs to the device.

To modify this functionality so map visitors can scan IAPs from the main button on the homepage, some additional code can be added. Keep in mind that this modification will only allow the selected map to be opened by the map visitor.

### Steps:

1. **Get the Selected Map ID and Map Code:**
   * From the Creator Portal, navigate to the Maps tab, select a map, and copy the Map ID and Map Code from the map details page.
2. **Modify the ARwayKit SDK:**
   * Open the following file to begin making the modifications: `Assets\ARWay\ViewerMode\2_Scripts\dashboard\MapListManager.cs`.
   * Scroll down to the function named `StartARSession()` and modify it as follows:

```csharp
public void StartARSession(bool isFromScanButton)
{
    SelectedMap map = new()
    {
        mapId = "2397c3394a5c475aa861e87d", // Replace with your own map id
        mapCode = "8184917418531", // Replace with your own map id
        isOwnMap = false,
        isVenueMap = false,
        isConnectedMap = false
    };
    EventManager<SelectedMap>.TriggerEvent("GetSelectedMapInfo", map);
    m_SceneLoader.LoadLevel("ARMapSession");
}
```

Now, with this change added, you can initialize AR using an IAP for the selected map. Keep in mind that you will only be able to open the selected map from the sample app.


---

# 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.arway.ai/arway-sdk/enhancing-the-sample-app/initializing-ar-using-an-iap.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.
