# Introduction

Welcome to the ARwayKit documentation.

Get a look at all the features and components of **ARwayKit** including how to use our Unity SDK, ARway App,  and the Creator Portal to create Real World Metaverse experiences.

## **Why use ARwayKit?**

At ARway, we are building ARwayKit to power camera devices with AI, to recognize their surroundings for hyper-accurate location apps. No Hardware. No beacons, accurate map scale, and 6DoF accurate pose.

Compared to ARKit or ARCore, ARwayKit is fast, scalable, highly customizable, Web-based, real-time, and tightly integrated with a cloud infrastructure that makes it the easiest way to build, deploy, and manage spatial apps on any platform.

It comes with an integrated Web Studio so the developers can create and manage their Location AR content and map in real-time from the Web.

### Key Features:

* **Easy Setup:** Sample scene and multiple tutorials.
* **Cross-platform:** Capable of running on both Android and iOS.
* **Persistent:** Localization for AR experiences that stay at their place.&#x20;
* **Occlusion:** Occlusion of AR Content in the real world and human occlusion.
* **Intelligent way-finding:** Dynamic AR navigation and guidance.
* **Customization:** Customise experiences with interactive elements.
* **Privacy Focused:** Built from the ground with your privacy in mind.
* **Analytics:** Optimise your operations with actionable data.

## Components:

* **ARway App:** Map Setup App to create and deploy image targets in your surroundings and Content creation ability to quickly prototype AR Content in a physical space.
* **ARway Creator Portal:** A one-stop place for creating and editing maps, adding floor plans for navigation along with overlaying 3D assets, waypoints, destinations, text, and pictures over it.
* **ARwayKit SDK:** Unity SDK for quick and easy development of AR applications.


# Change Log

Change Log for ARwayKit SDK

## ARway SDK v4.0.1

**Updates:**

1. Updated Unity version to 2022.3.62f3

## ARway SDK v4.0.0

**Updates:**

1. Fixed issue with the Properties file in the inspector.
2. Resolved touch interaction issue on iOS builds.
3. **Unity Version Update:** The Unity version used by ARwayKit has been updated from 2022.3.29f1 to 2022.3.60f1.

## ARway SDK v3.1.4

We are excited to announce the release of ARwayKit SDK v3.1.4, which brings a host of bug fixes and performance improvements to enhance your experience.

**Updates:**

1. **Floor Plan Display:** Resolved an issue where a blank floor plan was shown when viewing different maps in a venue.
2. **Navigation Style:** Corrected the navigational style displayed for specific tours.
3. **UI Enhancement:** Improved the UI to better accommodate lengthy tour names.
4. **QR Code Scanning:** Fixed an issue with the QR code prefab moving when scanned from a 45-degree angle.
5. **QR Code Scanner Button:** Addressed the disappearance of the QR code scanner button from the home screen during low network connectivity.
6. **Navigation Arrows:** Corrected misguiding arrows during navigation.
7. **Repeated Navigation:** Fixed incorrect directions when navigating to the same location pin twice and skipping a turn.
8. **Tilt Detection:** Increased the threshold for the Tilt Detected condition in the app.
9. **Location Pin Display:** Resolved an issue where the location pin position was not displayed when viewing the route selection page or map options.
10. **Live App Detail Error:** Fixed the "Live App Detail Failed" error occurring while saving a guided tour path under low network connectivity conditions.

## ARway SDK v3.1.0

We're excited to introduce ARway SDK v3.1.0, packed with new features and enhancements designed to optimize your development workflow and elevate the augmented reality experience. From innovative navigation styles to dynamic UI adjustments, this update offers tools and improvements to enhance your AR applications. Explore the detailed changes and enhancements in this release.

**What’s New:**

1. **New Path Style – Jumbo Chevron:** Introduces a new drift-friendly navigation style for guided tours and navigation paths. Enhanced ground tracking and large directional arrows ensure precise guidance across large venues.
2. **New Path Style – Flat Path:** Adds a new flat path option for guided tours and location pin navigation. Provides creators with additional flexibility in path creation, ensuring straightforward navigation in various environments.
3. **Mini Map Navigation:** Introduces a mini map feature within the AR screen, positioned below the jumbo chevron path. Offers visitors a preview of the route and real-time navigation progress. The mini map always faces the direction of the destination, helping users navigate even if the path is obstructed.
4. **Network Failure Back-up Flow:** New APIs allow creators to resume the map setup process if there is an unstable network connection. Ensures progress is not lost during the map setup process.
5. **Guided Tour Updates:** Enhanced route guidance for guided tours. Intuitive arrows point users back towards the tour path if they stray.
6. **Updated Location Pin Design and Animation:** Improved location pin design and animation adds interactive gamification to AR navigation.
7. **Dynamic UI Enhancement in-App for 2D Map:** Dynamic size adjustment for Points of Interest, Amenity pins, labels, and Access Points. Ensures map items scale and move appropriately as visitors zoom in and out of the 2D map.

**Updates:**

1. **Unity Version Update:** The Unity version used by ARwayKit has been updated from 2022.3.17f1 (LTS) to 2022.3.29f1 (LTS).
2. **Ground Detection Improvements:** Enhancements to ground detection for better navigation accuracy.
3. Various bug fixes.
4. General performance improvements.

## ARway SDK v3.0.1

This update includes bug fixes and performance improvements for our SDK.

**Bug Fixes:**

1. Bug fixes with Android QR code scanning resolved
2. Minor bug fixes in navigation and floor plan view
3. Updated scan environment UI

## ARway SDK v3.0.0

In this latest update, we're excited to announce the integration of all features from the official ARway app into our SDK. Explore the enhancements and additions in the updated ARwayKit SDK to discover the latest advancements in augmented reality experiences.

**What's New:**

1. **Peripheral Marker Tracking:** Peripheral Access Points elevate scanning access points by offering creators flexibility in scanning. Allowing for map visitors to scan access points from different angles and distances.
   * Select the size of the Access Points (QR codes and Image Access Points).&#x20;
   * Access points can now be position either horizontally or vertically (on the floor or ceiling).
   * The size of Access points is no longer restricted to 20x20cm. Creators can now choose from standard paper sizes, US printer paper sizes, or custom sizes for their access points.
2. **Venue Maps:** We've added support for the Venue maps to the SDK allowing visitors to navigate to location pins on connected map from the multi-map directory.
3. **Multi-Map and Multi-Floor Navigation:** Map visitors can now navigate across multiple floors with the Venue Maps and connector pins.
4. **Multi-Map Directory:** For venue maps, the directory will show map visitors location pins for all connected maps.
5. **Location Accuracy Dial Toggle:** Toggle the location accuracy dial in the Creator Portal for more control over the navigation experience.
6. **Audio Directions:** Assist visitors with audio directions for location pin navigation.
7. **Improved Accuracy & Range:**
   * Refined computer vision and image tracking capabilities.
   * Enhanced rendering accuracy of AR experiences in the real-world.
   * Upgraded scanning speed and accuracy of visual markers.
8. **Improved Texture and Rendering for Tour Paths:** The tour path appears smooth and level as visitors navigate the guided tour path on a journey throughout the map.
9. **Navigation Path and Location Pin Display:** Updated height calculations for tour paths mean that the paths will stay at a set height above the ground, even if there are fluctuations in ground height.&#x20;

**Bug Fixes:**

1. Improved navigation time calculation.
2. Fixed occasional crashes during high resolution floor plan alignment.
3. Added missing translations.
4. Minor bug fixes and performance improvements.

**Updates:**

1. **Unity Version Update:** The Unity version used by ARwayKit has been updated from 2021.3.17f1 (LTS) to 2022.3.17f1 (LTS) or higher (LTS).

**Migration Notes:**

1. **Unity Version Update:** The Unity version used by ARwayKit has been updated from 2021.3.17f1  (LTS) to 2022.3.17f1 (LTS) or higher (LTS).

## ARwayKit SDK v2.5.1

We're excited to introduce our latest app update, version 2.5.1. Below, you'll find the key enhancements that will enhance your navigation and location discovery experience. Dive into the details to discover what's new and improved!

**What's New:**

1. **Location Pin Directory Updates:** We've added the improved location pin directory, now you can see customized branding for each location pin the the directory.
2. **Turn-by-Turn Navigation:** Enjoy seamless turn-by-turn navigation when viewing location pins. We offer multiple navigation path styles to suit your preferences - Chevron, Glowing Stripes, and Spheres.
3. **2D Map View:** Dot navigation shows the user's position on the uploaded 2D floorplan, offering real-time user positioning updates to provide you them accurate directions as they explore different routes.
4. **Enhanced Location Pin Search:** Finding location pins is now more efficient. Our updated search functionality includes category, amenity, and other metadata filters, helping you discover the places that matter most to you.
5. **Language Support:** Provide users with multiple language options for your app. Add multiple languages to your app by adding new entries to the String Table.

**Updates:**

1. **Unity Version Update:** The Unity version ARwayKit has been tested with has been updated from 2021.3.1f1 (LTS) to 2021.3.17f1 (LTS) or higher (LTS).

## ARwayKit SDK v2.3.1

#### Fixed

* Support for location pins added from newer versions of ARway added.

## ARwayKit SDK v2.3.0

#### Added&#x20;

* Image Access Points to activate AR Maps and experience.&#x20;
* Videos spatial content in AR.&#x20;
* Advanced content occlusion in AR.&#x20;
* Updated relocalization method with background tracking.&#x20;
* Relocalization notifications in case of significant drift.&#x20;

#### Fixed&#x20;

* Drifting issues in AR maps after scanning QR codes.&#x20;
* Improved QR code recognition and tracking accuracy.&#x20;
* Fixed random selection of AR contents while using UI by introducing long touch for selection.&#x20;

## ARwayKit SDK v2.0.1

#### Fixed

* Anchor scanning improvements in case multiple QR codes are scanned in the same AR Session.

## ARwayKit SDK v2.0.0

#### Added

* Realtime authentication with ARway Maps Studio through developer Auth credentials.
* Ability to enable/disable SDK app usage in real-time.
* Viewing of all published maps in the account.
* Viewing and interacting with the AR content of your map.
* Location Pins and Guided Tours.
* Plane Occlusion of AR Contents.
* Map usage and Location Analytics.
* QR code access points.


# FAQ

Frequently Asked Question for the ARway Team

### For detailed FAQs on ARway Please visit - <https://www.arway.ai/faq>

###

{% content-ref url="/pages/-MG-3i9rrhuDBkwPhzT1" %}
[Support](/developer-feedback/support)
{% endcontent-ref %}


# Getting Started

Getting started with the ARway SDK

## Requirements

We support both **Android** and **iOS** devices using Unity's **AR Foundation** for quick and easy development of AR applications.

### Software

Our Unity SDK is tested with **Unity** Version **2022.3.62f3** (LTS) or Above (LTS).

### Hardware&#x20;

Requires an [**ARCore**](https://developers.google.com/ar/discover/supported-devices) or [**ARKit**](https://developer.apple.com/library/archive/documentation/DeviceInformation/Reference/iOSDeviceCompatibility/DeviceCompatibilityMatrix/DeviceCompatibilityMatrix.html) supported Android/iOS device.

### High-Level understanding of how ARwayKit SDK works&#x20;

### Mapping Process

When using **ARway App** during Mapping you create a Map consisting of QR Codes or Image Access Points. During Mapping a creator has to physically place QR Codes or Image Access Point then associate those with a map, It's important to notice that the **origin** of the map is determined by where you **place** the Primary QR code of the Map. This Map is stored in the ARway cloud and is further used during the localization process.

### Viewing Process&#x20;

During Map view, the AR application detects the Anchor and resolves the user's current **pose** (position and rotation) in the mapped area, it then downloads the AR content accordingly.

The content that is in close proximity to the user(s) location is downloaded initially and the application keeps track of user movement in AR Map and downloads additional content if required &#x20;

### Creator Portal

The ARway Creator Portal is one place where you can manage your AR/3D content, QR Codes, or Image Access Points. It gives you the ability to update AR/3D content in your application in **real time.**

The Creator Portal  helps you in managing more extensive environments like shopping malls, airports, etc. it gives you direct access to multiple maps and you can update anchor data of maps or AR content in real-time, without doing anything from Unity Editor.&#x20;


# Building from the Source Code

Building the sample app provided in the ARwayKit SDK

To build the sample app directly from the source code (.zip) provided in the release, follow the below steps.

## **Get the ARwayKit SDK** Source Code

Download the .zip from our [GitHub](https://github.com/arway-ai/unity-viewer-sdk/releases). Please [contact us](https://www.arway.ai/contact) for access.

## Prerequisites

In this guide, we will be using the following versions of Unity:

* **Unity:** 2022.3.62f3
  * Include the following platforms in your Unity install:&#x20;
    * Android Build Support&#x20;
      * OpenJDK
      * Android SDK & NDK Tools
    * iOS Build Support

## **Implementation**

In the instructions below, we will be using the provided .zip source code to create a new app. If you already have an existing Unity app to which you wish to add the package, please refer to the instructions provided in the link below.

{% content-ref url="/pages/-MGcwgrg7rXrUARQG1bU" %}
[Integrating the Unity Package](/arway-sdk/quickstart-in-unity)
{% endcontent-ref %}

### Getting the Account ID and Secret Key

1. From the ARway Creator Portal, go to "For Developers -> Create a New App -> Enter App Name".
2. Copy your **Account ID** and **SecretKey** for that App.

<figure><img src="/files/qlKyEyWiR7uymrKz8nTE" alt=""><figcaption><p>The "For Developers" page of the Creator Portal</p></figcaption></figure>

### **Opening the Project in Unity**

1. Download the .zip file source code for the latest release.
2. Extract the .zip file to a new folder.
3. Open Unity Hub, and click "Add" > "Add project from disk" and select the extracted zip file.
4. Open the project using Unity Editor Version **2022.3.62f3**.

### **Adding the Account ID and Secret Key**

1. In the Project Window, go to "Assets -> ARway -> Viewer Mode -> Resource-> ARWayKitConfig " and add your credentials for the Account ID and Secret Key.

<figure><img src="/files/05QDigfNtEm4FxVlXnek" alt=""><figcaption><p>AR Way Kit Config</p></figcaption></figure>

### **Switch Build Platform to** Android or iOS.

1. "File -> Build Settings -> Build -> Select iOS/Android"

### **Updating the** Addressables Groups

1. Navigate to "Window -> Asset Management -> Addressable -> Groups".
2. In the Addressables Groups window, click on "Build -> New Build -> Default Build Script".

{% hint style="info" %}
When making any changes that affect localization strings, you will need to update the Addressables Groups.
{% endhint %}

### Android Build Signing

When building for Android, Unity requires a keystore to sign the application.

1. Go to **Project Settings > Player > Android > Publishing Settings**.
2. Under **Custom Keystore**, you have two options:
   * **Use your own keystore**: If you have a production key (recommended for release builds), set the path to your `.keystore` file and provide the alias, password, and key details.
   * **Use the debug key for testing**: If you don’t need a custom key (e.g., for local development or quick testing), uncheck **Custom Keystore**. Unity will then sign the app automatically with the default debug keystore.

**Important**:

* A debug key is fine for testing, but **Google Play requires your app to be signed with your own keystore**. Make sure to generate and securely store a keystore for release builds.

### Building the App

1. In Unity select "File -> Build Settings".
2. Ensure the following scenes are selected in the following order:

   * ARWay/ViewerMode/0\_Scene/Dashboard-SDK
   * ARWay/ViewerMode/0\_Scene/ARMapSession

   <figure><img src="/files/44c6xaa3hMLNclSwq5SX" alt=""><figcaption><p>Build Settings Window</p></figcaption></figure>
3. Change the platform to either Android or iOS by selecting "Android or iOS -> Switch Platform".
4. Select "Build and Run" to run the app.
   1. If you see a pop-up for "Unsupported Input Handling" click "Yes"

After successfully building the app on your device, you can scan QR codes that you created for your ARway maps in the Creator Portal.     &#x20;

&#x20; &#x20;

<figure><img src="/files/KQKOA0tupzvhaeQnG77x" alt=""><figcaption><p>Dashboard scene</p></figcaption></figure>


# Integrating the Unity Package

Add the ARwayKit Unity package to an existing Unity Project

If you have an existing Unity app follow these steps to add the .unitypackage. Otherwise, we recommend that you build from the source:

{% content-ref url="/pages/fbaryUns9yh3L3xIiQO4" %}
[Building from the Source Code](/arway-sdk/building-from-the-source-code)
{% endcontent-ref %}

## **Get the ARwayKit SDK .unitypackage**

Download the .unitypackage from our [GitHub](https://github.com/arway-ai/unity-viewer-sdk/releases). Please [contact us](https://www.arway.ai/contact) for access.

## Prerequisites

In this guide, we will be using the following versions of Unity:

* **Unity:** 2022.3.29f1 LST
  * Include the following platforms in your Unity install:&#x20;
    * Android Build Support&#x20;
      * OpenJDK
      * Android SDK & NDK Tools
    * iOS Build Support

## **Implementation**

In the below instructions, we will be creating a new project in Unity, skip the step for creating a new project if you already have an existing Unity codebase.

### Getting the Account ID and Secret Key

1. From the ARway Creator Portal, go to "For Developers -> Create a New App -> Enter App Name".
2. Copy your **Account ID** and **SecretKey** for that App.

<figure><img src="/files/qlKyEyWiR7uymrKz8nTE" alt=""><figcaption><p>The "For Developers" page of the Creator Portal</p></figcaption></figure>

### **Creating a new project in Unity**

If you have an existing project in Unity, skip this step.

1. Open Unity Hub and click the "New project" button on the top right.&#x20;

<figure><img src="/files/7QWiudEByK5vth6MilVn" alt=""><figcaption><p>Create a new project in Unity hub</p></figcaption></figure>

2. Select the template "3D (Built-In Render Pipeline)" and create your new project (Unity Version **2022.3.29f1**).

   <figure><img src="/files/gdh7WyL6i7oYiAui08vx" alt=""><figcaption><p>Select the 3D (Core) project template. This was renamed from 3D (Core) in the latest version of Unity Hub.</p></figcaption></figure>

   <figure><img src="/files/sq1CACO8Yi41DS8gh2eb" alt=""><figcaption><p>Select the "3D (Built-In Render Pipeline)" project template. This was changed from "3D" in the latest version of Unity Hub.</p></figcaption></figure>

### **Change Project Platform**

1. Go to "File -> Build Settings..." and select either Android or iOS and then click "Switch Platform".

<figure><img src="/files/0UYyqKV9GPmCAj0jhjFj" alt="" width="488"><figcaption><p>Changing the build settings</p></figcaption></figure>

### **Importing Packages**

1. Go to "Assets -> Import Package -> Custom Package". Then select the ARwayKit SDK **.unitypackage**.
2. In the "Import Unity Package" window import the package.

   <figure><img src="/files/TL6IMRPbixh4Cq4R1r2Y" alt=""><figcaption><p>Import ARwayKit SDK package in Unity</p></figcaption></figure>
3. Next, the package setup will begin. Click "Install Packages" to install all of the required packages.

<figure><img src="/files/4bZNoj5kyPbJsru3uD2M" alt=""><figcaption><p>ARwayKit SDK Setup</p></figcaption></figure>

4. Wait for the packages to install and for the scripts to compile.
5. In the warning pop-up for enabling the backends for the input system package, select either "Yes" or "No" as it is optional for the ARwayKit SDK.

<figure><img src="/files/fnIcGs9pBIVJxuVd50GR" alt=""><figcaption><p>Choose 'Yes' or 'No' as it is optional for the ARwayKit SDK</p></figcaption></figure>

6. Then click 'Setup SDK' to finish part 2/2 for the setup.

<figure><img src="/files/sF4KQ6LG20kTbNuqRPiO" alt=""><figcaption><p>Click Setup SDK</p></figcaption></figure>

7. Next, click "import" to import the project settings. Please note that this will overwrite all of your previous project settings.

<figure><img src="/files/WpWGRkJo9Jd6Dyc57n6h" alt=""><figcaption><p>Import project settings</p></figcaption></figure>

8. In the Import Unity Package window, select all and click "Next" then "Import".

<figure><img src="/files/WJQkhTG4HZNUcN97eomp" alt=""><figcaption><p>Unity Package Window files</p></figcaption></figure>

<figure><img src="/files/VQHYLKtt0xSYudemoj3L" alt=""><figcaption><p>Unity Package Window settings</p></figcaption></figure>

#### Resolving Issue With No Active LocalizationSettings

{% hint style="info" %}
If after importing the Unity Package you get an error in the console that says "There is no active LocalizationSettings", you can manually resolve this in the Player Settings.  Otherwise, skip to the next step.
{% endhint %}

<figure><img src="/files/S3EE7lTLkN0YsCxlicEG" alt=""><figcaption><p>Localization Settings error</p></figcaption></figure>

In the Unity Editor go to "Edit -> Project Settings", the select the "Localization" category on the left. Then if you see beside "Active Settings" the text "None (Localization Settings)" click the button to the right to select the localization settings.

<figure><img src="/files/K5UkHiMeZr80VHZusHHN" alt=""><figcaption><p>Project Settings Localization Settings</p></figcaption></figure>

Then in the new window, Localization Settings Asset. To confirm that it was selected the Available Locales will be shown in the Project Settings window.

<figure><img src="/files/EOOevuaWfdJApsivRQEa" alt=""><figcaption><p>Select Localization Settings</p></figcaption></figure>

Completing these steps will resolve the "There is no active LocalizationSettings" issue.

### Adding the Scenes to the Build

1. Open the Dashboard-SDK scene. Under in the Project tab go to "Assets -> ARWay -> ViewerMode -> 0\_Scene" and double-click Dashboard-SDK.
2. Then open "File -> Build Settings..." and click the "Add Open Scenes" button to add the scene to the build.

<figure><img src="/files/DjFpLJL1g5fEelgGv6NL" alt=""><figcaption><p>Build Settings</p></figcaption></figure>

3. Then do the same for ARMapSession scene "Assets -> ARWay -> ViewerMode -> 0\_Scene" and double-click ARMapSession.
4. Then open "File -> Build Settings..." and click the "Add Open Scenes" button to add the scene to the build.
5. Now both Dashboard-SDK and ARMapSession should be in the "Scenes in Build". Ensure that Dashboard-SDK is the top scene in the build.

<figure><img src="/files/wwKa3d41jEHptOMfDbLK" alt=""><figcaption><p>Build Settings</p></figcaption></figure>

### **Adding the Account ID and Secret Key**

1. In the Project Window, go to "Assets -> ARWay -> ViewerMode -> Resources -> ARWayKitConfig " and add your credentials for the Account ID and Secret Key.

<figure><img src="/files/52SiYn5hsMDkvgGvcRZS" alt=""><figcaption><p>Add credentials in the ARway config file</p></figcaption></figure>

### **Updating the** Addressables Groups

1. Navigate to "Window -> Asset Management -> Addressable -> Groups".
2. In the Addressables Groups window, click on "Build -> New Build -> Default Build Script".

{% hint style="info" %}
When making any changes that affect localization strings, you will need to update the Addressables Groups "Build -> New Build -> Default Build Script".
{% endhint %}

### Building the App

1. In Unity select "File -> Build Settings -> Build -> Select iOS/Android -> Build and Run" to run the app.

<figure><img src="/files/45senRNMoEgxEjV71V4y" alt=""><figcaption><p>Build Settings screen in Unity</p></figcaption></figure>

After successfully building the app on your device, you can scan QR codes that you created for your ARway maps in the Creator Portal.


# Managing App Localizations

Manage the displayed text in your app for multiple languages

The ARwayKit Sample App utilizes the [Unity Localization package](https://docs.unity3d.com/Packages/com.unity.localization@1.3/manual/QuickStartGuideWithVariants.html) to configure the localization settings.

**You will need to modify the localization strings to remove any mention of ARway** if you want to customize your own app with unique branding.

## Choosing a Default Locale <a href="#choose-a-default-locale" id="choose-a-default-locale"></a>

Follow this [guide ](https://docs.unity3d.com/Packages/com.unity.localization@1.3/manual/QuickStartGuideWithVariants.html#choose-a-default-locale)by Unity to select which locale your application will use by default.

## Importing and Exporting <a href="#importing-and-exporting-csv-files" id="importing-and-exporting-csv-files"></a>

The Unity localization package offers three ways to modify and export: CSV, Google Sheets, and XLIFF.

### Importing and Exporting CSV files <a href="#importing-and-exporting-csv-files" id="importing-and-exporting-csv-files"></a>

You can use the CSV (Comma Separated Values) format to import and export [String Table Collections](https://docs.unity3d.com/Packages/com.unity.localization@1.3/manual/StringTables.html). This makes it easier to work with translators who use CSV for translation; you can export String Table Collections from Unity to CSV files, send them to the translator for modification, and then re-import the modified files back into Unity.

#### Exporting the CSV

1. Navigate to "Window -> Asset Management -> Localization Tables"

   <figure><img src="/files/rzIauQ8s8SoVe80AEJ0I" alt=""><figcaption><p>Navigating to Localization Tables</p></figcaption></figure>
2. In Localization Tables window, click on the "Edit Table Collection" tab to open the table collection with the name "StringTable\_Localization"

   <figure><img src="/files/OhWQQRp4udfLRdAXD726" alt="" width="375"><figcaption><p>StringTable_Localization Table Collection</p></figcaption></figure>
3. Click the three vertical dots at the top right of the window and select "Export -> CSV…".

   <figure><img src="/files/rbMCsGYjQ7WWmnS4K5YS" alt=""><figcaption><p>CSV export menu</p></figcaption></figure>
4. Then select a location to store the CSV and then save.

After you have exported the CSV, you can make changes to the different string stored in each cell.

#### Importing the CSV

1. Navigate to "Window -> Asset Management -> Localization Tables"

   <figure><img src="/files/rzIauQ8s8SoVe80AEJ0I" alt=""><figcaption><p>Navigating to Localization Tables</p></figcaption></figure>
2. In Localization Tables window, click on the "Edit Table Collection" tab to open the table collection with the name "StringTable\_Localization"

   <figure><img src="/files/OhWQQRp4udfLRdAXD726" alt="" width="375"><figcaption><p>StringTable_Localization Table Collection</p></figcaption></figure>
3. Click the three vertical dots at the top right of the window and select "Import -> CSV…".

   <figure><img src="/files/Asngv5zMlVNXpLRPqUOX" alt=""><figcaption><p>CSV import menu</p></figcaption></figure>
4. Select CSV file to be imported.
   * Note: When importing, make sure that the structure / headers of the CSV file that was exported remains the same.
5. Once imported, check the data in the Table Collection to ensure that the imported data is correct.

### Google Sheets

The Unity Localization package allows you to synchronize [Google Sheets](https://docs.google.com/spreadsheets) data with the content of a String Table Collection. By default, this feature can synchronize a String Table’s keys, values, and comment metadata. You can also add support for additional data through scripts.

More information can be found on the [Localization Unity package](https://docs.unity3d.com/Packages/com.unity.localization@1.3/manual/Google-Sheets.html) page.

### XLIFF <a href="#xliff" id="xliff"></a>

XML Localisation Interchange File Format (XLIFF) is a standardized way to store localization data. It is supported by many different Computer Aided Translation (CAT) tools, which allows for a smoother translation pipeline when working with translators.

You can export String Table Collections from Unity to one or more XLIFF files, modify them with external CAT tools, and finally re-import them back into Unity with the updated translations.

More information can be found on the [Localization Unity package](https://docs.unity3d.com/Packages/com.unity.localization@1.3/manual/XLIFF.html) page.

## Building the Localization Assets <a href="#preview-and-configure-your-build" id="preview-and-configure-your-build"></a>

To use the localized assets in the player, you must build the Addressables player content.&#x20;

After updating source codes, take these conditions into account to determine if building Addressable is necessary:

* If this is the initial build after checking out the source code.
* If Addressable hasn't been built successfully in previous attempts.
* If there have been modifications to String Tables.

To do this, in the Addressables window:

1. Navigate to "Window -> Asset Management -> Addressable -> Groups".
2. In the Addressables Groups window, click on "Build -> New Build -> Default Build Script".

{% hint style="info" %}
When making any changes that affect localization strings, you will need to update the Addressables Groups.
{% endhint %}


# Enabling Right-to-Left (RTL) Text

In order to enable RTL support in ARwayKit SDK, please follow below steps

This guide will help you enable RTL (Right-to-Left) text support in your Unity project using the RTLTMPro library. RTLTMPro is an extension for TextMeshPro that adds support for RTL languages like Arabic, Persian, and Hebrew.

#### Prerequisites <a href="#prerequisites" id="prerequisites"></a>

* Unity installed on your system.
* TextMeshPro plugin installed via the Unity Package Manager.

### Install RTLTMPro <a href="#install-rtltmpro" id="install-rtltmpro"></a>

GitHub Repository : <https://github.com/pnarimani/RTLTMPro>

#### Install from OpenUPM

In the Unity editor, add RTLTMPro as a scoped registry by selecting "Edit" in the top bar, the clicking "Project Settings" then open the "Package Manager" category on the left.

Then add OpenUPM as a scoped registry as shown below :

Copy the below to add as new scoped registry.

```
NAME:  OpenUPM
URL :  https://package.openupm.com
SCOPE: com.nosuchstudio.rtltmpro 
```

<figure><img src="https://shyamdev.gitbook.io/~gitbook/image?url=https%3A%2F%2Fcontent.gitbook.com%2Fcontent%2FSok1Shzgk9QINR3vVDhu%2Fblobs%2F3rfH1WjymCdZ9D80WUDq%2FScreenshot%25202024-06-12%2520at%25207.06.48%25E2%2580%25AFPM.png&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=e8404fd774fdb59094ea3eb9a63acc5a4d86a0be5632080b4bb273e1fccbf648" alt=""><figcaption><p>The image above shows the Projects Settings window on the Package Manager category adding OpenUPM as a scoped registry.</p></figcaption></figure>

Click "Save" once you have added the Name, URL, and Scope(s).

Then in Package Manager window, from the Unity editor top bar Window -> Package Manager, change scope to *Packages: My Registries* by selecting the "Packages: Unity Registry" text on the top left of the window.&#x20;

Select "RTL Text Mesh Pro" package and press *Install* on the top right.

<figure><img src="https://shyamdev.gitbook.io/~gitbook/image?url=https%3A%2F%2Fcontent.gitbook.com%2Fcontent%2FSok1Shzgk9QINR3vVDhu%2Fblobs%2FTZEVW5dyCp7bgv3bwMzF%2FScreenshot%25202024-06-12%2520at%25207.07.29%25E2%2580%25AFPM.png&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=7a0ef406a2b5eb253a5e66b29b7fcb8f64be34ef34349ccc59f2b5fd2195932a" alt=""><figcaption></figcaption></figure>

The sample scenes and demo resources (fonts, shaders, etc.) are included in the package as a .unitypackage file. You need to import those into your Assets folder to use them. From the project window navigate to the package folder and double click "RTLTMPro-demo-resources" file to import these assets into your project.

<figure><img src="https://shyamdev.gitbook.io/~gitbook/image?url=https%3A%2F%2Fcontent.gitbook.com%2Fcontent%2FSok1Shzgk9QINR3vVDhu%2Fblobs%2Flh0oaYDJgbjQuOtysKVR%2FScreenshot%25202024-06-12%2520at%25207.09.23%25E2%2580%25AFPM.png&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=c46147c7877817ea57e28b2d338d2aff4c4d2f2ec075606583c0397d12db21e9" alt=""><figcaption></figcaption></figure>

Double click and import RTLTMPro-demo-resources:

<figure><img src="https://shyamdev.gitbook.io/~gitbook/image?url=https%3A%2F%2Fcontent.gitbook.com%2Fcontent%2FSok1Shzgk9QINR3vVDhu%2Fblobs%2FL0iM9WeBZI3ilDtPEU1r%2FScreenshot%25202024-06-12%2520at%25207.09.46%25E2%2580%25AFPM.png&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=e6e53c970ac1d0431d1a4882bfb32d98654f25246e20df742bcfdbef0f5822a9" alt=""><figcaption></figcaption></figure>

Installation is successful here.

#### Update Font Assets for RTL Languages <a href="#update-font-assets-for-rtl-languages" id="update-font-assets-for-rtl-languages"></a>

1. Ensure you have a font that supports your RTL language.
2. Download and copy NotoSansArabic Font that supports RTL from here : <https://fonts.google.com/noto/specimen/Noto+Sans+Arabic>
3. Create a new Font Asset for your RTL font if needed.
   * Go to `Window` -> `TextMeshPro` -> `Font Asset Creator`.
   * Follow the steps to create a new Font Asset. For Arabic text, you can follow the steps here:
     * &#x20;<https://github.com/pnarimani/RTLTMPro?tab=readme-ov-file#how-to-create-font-assets>&#x20;
4. Assign the Font Asset to your `RTLTextMeshPro` component if required.
5. In order to Convert Text component string to RTL just need to update the **Font** file and for TextMeshPro need **FontAsset.**

#### How to Apply RTL support to existing Text and TextMeshPro components? <a href="#how-to-apply-rtl-support-to-existing-text-and-textmeshpro-components" id="how-to-apply-rtl-support-to-existing-text-and-textmeshpro-components"></a>

For existing project where all the Text and TextMeshPro components are Localized, RTL support can be added to it without changing whole component.

Copy NotoSansArabic font and NotoSansArabic Font Assets in a **Resources** directory.

Use the below RTLTextUpdater script to Update Text/TextMeshPro component string with RTL support. Create a new C# Script in Unity in the Project tab by right clicking the Assets folder directory and click Create -> C# Script and call it "RTLTextUpdater".

Copy

```csharp
using TMPro;
using UnityEngine;
using UnityEngine.UI;
using RTLTMPro;
using System.Collections;

public class RTLTextUpdater : MonoBehaviour
{
    public Font newUIFont;
    public TMP_FontAsset newFontAsset;
    bool fontsImported = false;

    void OnEnable()
    {
        if (!fontsImported)
        {
            if (newUIFont == null)
            {
                newUIFont = Resources.Load<Font>("NotoSansArabic");
            }
            if (newFontAsset == null)
            {
                newFontAsset = Resources.Load<TMP_FontAsset>("NotoSansArabic SDF");
            }
            fontsImported = true;
        }

        StartCoroutine(UpdateRTLSupport());
    }

    IEnumerator UpdateRTLSupport()
    {
        yield return new WaitForSeconds(0.02f);
        
        Text uiText = GetComponent<Text>();
        if (uiText != null)
        {
            ApplyRTLToTextComponent(uiText);
        }

        TextMeshProUGUI textMeshProUGUI = GetComponent<TextMeshProUGUI>();
        if (textMeshProUGUI != null)
        {
            ApplyRTLToTMPComponent(textMeshProUGUI);
        }

        TextMeshPro textMeshPro = GetComponent<TextMeshPro>();
        if (textMeshPro != null)
        {
            ApplyRTLToTMPComponent(textMeshPro);
        }

    }


    void ApplyRTLToTextComponent(Text uiText)
    {
        uiText.font = newUIFont; 
        
        string originalText = uiText.text;
        FastStringBuilder fastStringBuilder = new FastStringBuilder(RTLSupport.DefaultBufferSize);
        RTLSupport.FixRTL(originalText, fastStringBuilder, true, true);
        uiText.text = fastStringBuilder.ToString();
    }

    void ApplyRTLToTMPComponent<T>(T tmpComponent) where T : TMP_Text
    {
        tmpComponent.font = newFontAsset; 
    
        string originalText = tmpComponent.text;
        FastStringBuilder fastStringBuilder = new FastStringBuilder(RTLSupport.DefaultBufferSize);
        RTLSupport.FixRTL(originalText, fastStringBuilder, true, true);
        tmpComponent.text = fastStringBuilder.ToString();
    }
}
```

This Script has to be applied on all the Text and TextMeshPro in whole scene. The RTL support happens at run time.

To automatically apply the above to every `Text` and `TextMeshPro` component in the scene, you can use the following editor script.

Create a new C# Script in Unity in the Project tab by right clicking the Assets folder directory and click Create -> C# Script and call it "AddRTLTextUpdater"

Copy the below into the newly created file:

```csharp
using UnityEditor;
using UnityEngine;
using TMPro;
using UnityEngine.UI;

public class AddRTLTextUpdater : EditorWindow
{
    [MenuItem("Tools/Add RTL Text Updater")]
    public static void ShowWindow()
    {
        GetWindow<AddRTLTextUpdater>("Add RTL Text Updater");
    }

    void OnGUI()
    {
        if (GUILayout.Button("Add RTLTextUpdater to all Text/TMP components"))
        {
            AddRTLUpdaterToAllTextComponents();
        }
    }

    private void AddRTLUpdaterToAllTextComponents()
    {
        Text[] allUITextComponents = Resources.FindObjectsOfTypeAll<Text>();
        foreach (Text uiText in allUITextComponents)
        {
            if (uiText.gameObject.activeInHierarchy || uiText.gameObject.scene.isLoaded)
            {
                if (uiText.GetComponent<RTLTextUpdater>() == null)
                {
                    uiText.gameObject.AddComponent<RTLTextUpdater>();
                }
            }
        }

        TextMeshProUGUI[] allTextMeshProUGUIComponents = Resources.FindObjectsOfTypeAll<TextMeshProUGUI>();
        foreach (TextMeshProUGUI textMeshProUGUI in allTextMeshProUGUIComponents)
        {
            if (textMeshProUGUI.gameObject.activeInHierarchy || textMeshProUGUI.gameObject.scene.isLoaded)
            {
                if (textMeshProUGUI.GetComponent<RTLTextUpdater>() == null)
                {
                    textMeshProUGUI.gameObject.AddComponent<RTLTextUpdater>();
                }
            }
        }

        TextMeshPro[] allTextMeshProComponents = Resources.FindObjectsOfTypeAll<TextMeshPro>();
        foreach (TextMeshPro textMeshPro in allTextMeshProComponents)
        {
            if (textMeshPro.gameObject.activeInHierarchy || textMeshPro.gameObject.scene.isLoaded)
            {
                if (textMeshPro.GetComponent<RTLTextUpdater>() == null)
                {
                    textMeshPro.gameObject.AddComponent<RTLTextUpdater>();
                }
            }
        }
    }
}
```

To Run the RTLTextUpdater : Tools -> Add RTL Text Updater

By running the editor script, you ensure that all relevant text components in your scene will have the `RTLTextUpdater` component attached, and the RTL conversion logic will be applied whenever they are enabled.

<figure><img src="https://shyamdev.gitbook.io/~gitbook/image?url=https%3A%2F%2F2542705751-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FSok1Shzgk9QINR3vVDhu%252Fuploads%252FveLnaz937MFLnuoIBrTp%252FScreenshot%25202024-06-19%2520at%25207.34.42%25E2%2580%25AFPM.png%3Falt%3Dmedia%26token%3D6c059684-828d-4105-9bb6-8adce82fdaa6&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=6a371259a45c5f51f966e200b936dea1ecf74d9b6e8c507261c3636d8f20535f" alt=""><figcaption></figcaption></figure>

It opens another Window with option to add **RTLTextUpdater**

<figure><img src="https://shyamdev.gitbook.io/~gitbook/image?url=https%3A%2F%2F2542705751-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FSok1Shzgk9QINR3vVDhu%252Fuploads%252Fy7SDFcDmZwK6j4VZtm38%252FScreenshot%25202024-06-19%2520at%25207.34.52%25E2%2580%25AFPM.png%3Falt%3Dmedia%26token%3Db5dca18f-fa03-406f-a6ee-54ea00341087&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=59fac6f1b2deb560e119ace7b72f92bf2ddbe5856a19afd5729e2812abce9794" alt=""><figcaption></figcaption></figure>

After running clicking "**Add RTLTextUpdater to all Text/TMP components**" it adds **RTLTextUpdater** to all the Text and TextMeshPro components

<figure><img src="https://shyamdev.gitbook.io/~gitbook/image?url=https%3A%2F%2F2542705751-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FSok1Shzgk9QINR3vVDhu%252Fuploads%252FF8JqhxWtGTyCIMNCUGqJ%252FScreenshot%25202024-06-19%2520at%25207.35.19%25E2%2580%25AFPM.png%3Falt%3Dmedia%26token%3D43efcfc3-b0e4-4142-88dd-0b74f2290364&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=d28e85e3f99dadcf57972dbe89e6548021fbb1a6229ca5a4ae4aa9d63edc3588" alt=""><figcaption></figcaption></figure>

As soon as component gets enabled, it will convert the normal string into RTL text.


# Sample Scenes

A Set of Scenes to help you get started.

### Scenes in the ARway Unity SDK:

<figure><img src="/files/GINe7h3bWl3fE7XIyQbq" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}

* **Dashboard-SDK:** One place to manage maps, like listing, searching, and Metadata details viewing.
* **ARMapSession**: Used to View AR Content of the map, including turn-by-turn navigation, guided tours, 3D models, images, hotspots, text, and videos.
  {% endhint %}

### Essential Components of **ARway SDK.**

This component handles Authentication from your App to ARway Backend service, this Gameobject doesn't get destroyed in any of the scenes.

<img src="/files/cnQrGWSaNJ8fUeVKiL3R" alt="" width="563">

{% hint style="info" %}

* **Account Id:** This you will get from ARway Creator Portal, used to connect your App to the ARway Backend.
* **Secret Key:**  This is app-specific credentials, you can create new App secret key on ARway Creator Portal.&#x20;
  {% endhint %}


# Dashboard

Unity Sample Scene: Dashboard

This scene is used for viewing all maps and their details, this scene is optional and can be used if you want your users to choose between maps.

<figure><img src="/files/KQKOA0tupzvhaeQnG77x" alt="" width="299"><figcaption><p>Dashboard scene</p></figcaption></figure>


# AR Map Session

Unity Sample Scene - Content Placement

This scene is used for Localization, post localization the contents of the scene are initiated at their desired location. Contents in Map are placed relative to the Map Origin. This scene has also examples of Location Pins and Tours.

{% hint style="info" %}
This Scene requires Location (Precise) and Camera permission for its work.
{% endhint %}

## Interact with AR Contents of a Map

ARMapController is the script that handles the loading of Map contents in AR, each content is initiated as [Unity Gameobject](https://docs.unity3d.com/ScriptReference/GameObject.html), developers can use this script to customize the behavior of Content like its visibility, adding more interaction, custom logic, etc.

**Content Types:**

1. Text
2. Images
3. 3D models
4. Audio files
5. Location pins
6. Guided tours
7. Hostpots

### Code example for content visiting using content properties

Using the ID property of content to enable visibility

{% code overflow="wrap" lineNumbers="true" %}

```csharp
#region TextContent
foreach (Text3D text in arContent.texts)
{
    if (text.id == "text_60954")
    {
        ContentStorageManager.Instance.LoadTextData(text);
    }
    if (text.id == "text_92055")
    {
        ContentStorageManager.Instance.LoadTextData(text);
    }
}
#endregion
```

{% endcode %}


# Branding the Sample App

How to brand the sample app

After following the previous steps, the sample app can be further modified to change the branding. In this example, we will be modifying the default text and images in the sample app.

## Modifying the dashboard scene

The dashboard contains the ARway logo and text for the user to edit by default, and these elements can be changed in the Unity editor. The majority of the UI elements can be modified from the Hierarchy window in Unity. This guide will showcase how to modify some of these elements.

<figure><img src="/files/KQKOA0tupzvhaeQnG77x" alt="" width="299"><figcaption><p>Dashboard scene</p></figcaption></figure>

### Changing the default logo

In this example we will be modifying the ARway logo.

1. To add the new logo image to the Assets in Unity, navigate to the project window and select "Assets -> ARway -> ViewerMode -> 1\_UI -> Dashboard". From here, you can drag and drop your new logo into the Splash folder in the Project window.

<figure><img src="/files/DslniUzcxEKSjZzS6bcx" alt=""><figcaption><p>Dashboard folder in Unity</p></figcaption></figure>

Select the uploaded logo, change the "Texture Type" to "Sprite (2D and UI)" and the "Sprite Mode" to "Single", and then click on "Apply" at the bottom.

<figure><img src="/files/ffkIRgV81TOn7juNGHvb" alt=""><figcaption><p>Uploading new logo</p></figcaption></figure>

2. Navigate to "Dashboard -> Canvas -> DashboardPage -> Scroll View -> Viewport -> Content -> ScanQRPanel -> Background -> Branding" in the Unity Hierarchy window.    &#x20;

<figure><img src="/files/BbVBVOkTd2qvgNt13W0l" alt=""><figcaption><p>Unity Hierarchy window</p></figcaption></figure>

3. Now select the "logo" prefab from the Hierarchy window and change the "Source Image" to the new logo.

<figure><img src="/files/x0TQutfSsnQ0Vf962Xda" alt=""><figcaption><p>Swapping the logo</p></figcaption></figure>

4. In this case, the second prefab "name" under branding is deleted as only one logo is needed.
5. Modify the positioning and size of the logo in the "Inspector" window.

<figure><img src="/files/vi9YQRmB7wg7gsHJ8ArT" alt=""><figcaption><p>Editing the position of the logo</p></figcaption></figure>

### Modifying the text

Next, we will modify the text that is displayed on the dashboard.&#x20;

In the Hierarchy window, navigate to the section "Dashboard -> Canvas -> DashboardPage -> Scroll View -> Viewport -> Content -> ScanQRPanel -> Background" and select the 'Sub Text' object. In the "Text" input field in the Inspector window, update the text to your desired content.

<figure><img src="/files/JnujtUYcrTBuaplbZ9cg" alt=""><figcaption><p>Editing the subtext</p></figcaption></figure>

### Changing the background color

In the Hierarchy window, go to the section Dashboard -> Canvas -> DashboardPage -> dashboard\_bg. Then in the Inspector window change to color of the dashboard to match your branding.

<figure><img src="/files/vNvRLJCkDRC8YbpKU2xW" alt=""><figcaption><p>Modifying the background color</p></figcaption></figure>


# Replacing ARway Logos in the Sample App

Swap existing images for custom branding.

The sample app includes multiple images featuring the ARway logo, which can be replaced as needed. With the sample app, you can replace the provided image assets with your own and add your custom branding to replace the ones from ARway.

## Image Assets

The following list of image assets contain the ARway logo:

* Assets/ARWay/ViewerMode/1\_UI/Dashboard/Arway\_logo.png
  * W: 512px | H: 512px - Square logo
* Assets/ARWay/ViewerMode/1\_UI/Dashboard/Arway\_text.png
  * W: 512px | H: 143px - ARway text
* Assets/ARWay/ViewerMode/1\_UI/Dashboard/arway\_logo\_h.png
  * W: 512px | H: 132px - ARway logo on dashboard
* Assets/ARWay/ViewerMode/1\_UI/Dashboard/arway\_thumbnail\_1x1.png
  * W: 512px | H: 512px - ARway thumbnails
* Assets/ARWay/ViewerMode/1\_UI/Dashboard/SampleThumbnail.png
  * W: 327px | H: 279px - ARway thumbnails
* Assets/ARWay/ViewerMode/3\_Assets/VideoTexture/Thumbnail.png
  * W: 750px | H: 512px - Thumbnail image for videos in AR session
* Assets/ARWay/ViewerMode/3\_Assets/Prefabs/ARMapSession/QR Info/QR/QR\_Primary.png
  * W: 190px | H: 190px - Image of a primary QR code with the ARway logo
* Assets/ARWay/ViewerMode/3\_Assets/Prefabs/ARMapSession/QR Info/QR/QR\_Secondary.png
  * W: 153px | H: 157px Image of a secondary QR code with the ARway logo
* Assets/ARWay/ViewerMode/1\_UI/Buttons/Access Point Button Pressed.png
  * W: 1792px | H: 512px - Location accuracy dial background pressed
* Assets/ARWay/ViewerMode/1\_UI/Buttons/Access Point Button.png
  * W: 1792px | H: 512px - Location accuracy dial background
* Assets/ARWay/ViewerMode/1\_UI/DriftIndicatorUI/Center Logo.png
  * W: 512px | H: 512px - Square logo
* Assets/ARWay/ViewerMode/1\_UI/Logo/ARway\_logo\_512x512.png
  * W: 512px | H: 512px - Square logo
* Assets/ARWay/ViewerMode/1\_UI/Logo/ARway\_logo\_1024x1024.png
  * W: 512px | H: 512px - App icon
* Assets/ARWay/ViewerMode/1\_UI/Logo/arway\_logo\_3.png
  * W: 512px | H: 518px - square icon
* Assets/ARWay/ViewerMode/1\_UI/Dashboard/qr\_overlay.png
  * W: 1024px | H: 1024px - Overlay that appears when scanning QR codes
* Assets/ARWay/ViewerMode/1\_UI/Dashboard/sample\_thumbnail.png
  * W: 327px | H: 279px - Default map thumbnail for dashboard
* Assets/ARWay/ViewerMode/1\_UI/Dashboard/qr\_thumbnail\_sample.png
  * W: 512px | H: 512px - Sample showing what QR code looks like
* Assets/ARWay/ViewerMode/1\_UI/UI\_UX/Buttons V2/QR-CODE.png
  * W: 512px | H: 512px - QR code image

## Replacing the Image Assets

These image assets can be replaced with your own images. Here is how to do so:

1. Copy the image assets from the above list.
2. Modify the image assets to replace them with your own.
3. Swap the images with your modified assets in the above folders.
4. Build your app.

<figure><img src="/files/asLcsbj3fjdVMBlCCrZ2" alt=""><figcaption><p>Replacing images in the ARway sample app.</p></figcaption></figure>


# Third Party

The following third party software was used to in example sample scenes

1. Unity Web-View - <https://github.com/gree/unity-webview>
2. ZXing Unity for QR code
3. Path Creator for Unity - <https://github.com/SebLague/Path-Creator>
4. Native gallery for Unity - <https://github.com/yasirkula/UnityNativeGallery>
5. Unity Native Share Plugin - <https://github.com/yasirkula/UnityNativeShare>


# SDK Upgrade Guide

List of the different available versions and upgrade instructions.

### **General Information**

Before you proceed with the upgrade, here are some essential points to keep in mind:

1. **Backup Your Project**: Before making any changes, it is crucial to back up your Unity project to avoid any potential data loss or issues during the upgrade process.
2. **Version Compatibility**: Ensure that the version of Unity you are using is compatible with ARway. Check the [Getting Started](/arway-sdk/getting-started) page for more information about supported versions of Unity.
3. **Asset Compatibility**: If your project relies on third-party assets that interact with ARway, make sure those assets are also compatible with the new version.
4. **Test Thoroughly**: After the upgrade, thoroughly test your project's functionality to identify and fix any issues that may have arisen during the transition.

### Versions

[v3.1.0 -> v3.1.4](/arway-sdk/sdk-upgrade-guide/3.1.0-greater-than-3.1.4)

[v3.0.1 -> v3.1.0](/arway-sdk/sdk-upgrade-guide/3.0.1-greater-than-3.1.0)

[v3.0.0 -> v3.0.1](/arway-sdk/sdk-upgrade-guide/3.0.0-greater-than-3.0.1)

[v2.5.1 -> v3.0](/arway-sdk/sdk-upgrade-guide/2.5.1-greater-than-3.0.0)

[v2.3.1 -> v2.5.1](/arway-sdk/sdk-upgrade-guide/2.3.1-greater-than-2.5.1)

[v2.3 -> v2.3.1](/arway-sdk/sdk-upgrade-guide/2.3-greater-than-2.3.1)


# 3.1.0 -> 3.1.4

### **Steps to Upgrade**

This guide will walk you through the process of upgrading v3.1.0 of the ARwayKit SDK to v3.1.4. Please follow the instructions carefully to ensure a smooth transition to the new version.

1. **Enable Version Control:** Enable version control on your local machine by enabling Git in the repo.
2. **Backup Your Project:** Save & Commit your Unity project with your version control system (Git) to ensure you can revert in case of any unforeseen issues.
3. **Download the New Version:** Download the new ARwayKit SDK v3.1.4 .zip file.
4. **Extract the .ZIP File:** Extract the .zip to a new folder.
5. **Copy Extracted Files to Existing Repository:** Copy the folders “Assets”, “Packages” and “Project Settings” from the zip to your existing project and choose the option to replace the existing files.
6. **Delete Files & Folders:** Delete the files and folders in the list “Files & Folders to Delete” below to resolve upgrade conflicts.
7. **Review File Changes:** Review the file changes in Git, remove any changes to the files that are unnecessary to your project such as the logos or other branding assets.
8. **Build and Test:** Rebuild your Unity project and thoroughly test all the ARway features and functionalities that your application uses.

### List of File Changes

#### **Files & Folders to Delete:**

1. Assets/AddressableAssetsData/link.xml
2. Assets/AddressableAssetsData/link.xml.meta

#### **Modified Files:**

1. Assets/ARWay/ViewerMode/0\_Scene/ARMapSession.unity&#x20;
2. Assets/ARWay/ViewerMode/2\_Scripts/ARMapSession/LocalizationPopup.cs alogBox/DriftIndicatorPopup.prefab&#x20;
3. Assets/ARWay/ViewerMode/3\_Assets/Prefabs/ARMapSession/DialogBox/InstructionsPanelViewer.prefab&#x20;
4. Assets/ARWay/ViewerMode/3\_Assets/Prefabs/ARMapSession/DialogBox/LocalizationRequired.prefab&#x20;
5. Assets/ARWay/ViewerMode/3\_Assets/Prefabs/ARMapSession/Notification/FindPlane.prefab
6. Assets/ARWay/ViewerMode/3\_Assets/Prefabs/ARMapSession/UI Panels/QRScanPanel.prefab&#x20;
7. &#x20;Assets/ARWay/ViewerMode/Plugins/ARwayKit-Viewer.dll
8. Assets/ARWay/ViewerMode/Resources/ARContent/JumboChevron.prefab&#x20;
9. Assets/ARWay/ViewerMode/Resources/AnchorPrefab.prefab
10. Assets/Localization/Localization Tables/StringTable\_Localization Shared Data.asset&#x20;
11. Assets/Localization/Localization Tables/StringTable\_Localization\_en.asset&#x20;
12. ProjectSettings/ProjectSettings.asset

#### **New Files:**&#x20;

1. Assets/ARWay/ViewerMode/1\_UI/Icons/GroundScan.png&#x20;
2. Assets/ARWay/ViewerMode/1\_UI/Icons/GroundScan.png.meta&#x20;
3. Assets/ARWay/ViewerMode/1\_UI/Icons/PlaneFound.png&#x20;
4. Assets/ARWay/ViewerMode/1\_UI/Icons/PlaneFound.png.meta&#x20;
5. Assets/ARWay/ViewerMode/1\_UI/Icons/Scan.png&#x20;
6. Assets/ARWay/ViewerMode/1\_UI/Icons/Scan.png.meta&#x20;


# 3.0.1 -> 3.1.0

### **Steps to Upgrade**

This guide will walk you through the process of upgrading v3.0.1 of the ARwayKit SDK to v3.1.0. Please follow the instructions carefully to ensure a smooth transition to the new version.

1. **Enable Version Control:** Enable version control on your local machine by enabling Git in the repo.
2. **Backup Your Project:** Save & Commit your Unity project with your version control system (Git) to ensure you can revert in case of any unforeseen issues.
3. **Download the New Version:** Download the new ARwayKit SDK v3.1.0 .zip file.
4. **Extract the .ZIP File:** Extract the .zip to a new folder.
5. **Copy Extracted Files to Existing Repository:** Copy the folders “Assets”, “Packages” and “Project Settings” from the zip to your existing project and choose the option to replace the existing files.
6. **Delete Files & Folders:** Delete the files and folders in the list “Files & Folders to Delete” below to resolve upgrade conflicts.
7. **Review File Changes:** Review the file changes in Git, remove any changes to the files that are unnecessary to your project such as the logos or other branding assets.
8. **Build and Test:** Rebuild your Unity project and thoroughly test all the ARway features and functionalities that your application uses.

### List of File Changes

#### **Files & Folders to Delete:**&#x20;

1. .DS\_Store Assets/ARWay/ViewerMode/1\_UI/Dashboard/ConnectorPin center.png
2. Assets/ARWay/ViewerMode/1\_UI/Dashboard/ConnectorPin center.png.meta
3. Assets/ARWay/ViewerMode/1\_UI/Dashboard/ConnectorpPin BG.png
4. Assets/ARWay/ViewerMode/1\_UI/Dashboard/ConnectorpPin BG.png.meta
5. Assets/ARWay/ViewerMode/1\_UI/Dashboard/ar location pin.png
6. Assets/ARWay/ViewerMode/1\_UI/Dashboard/ar location pin.png.meta
7. Assets/ARWay/ViewerMode/1\_UI/Icons/path\_end\_new\.png
8. Assets/ARWay/ViewerMode/1\_UI/Icons/path\_end\_new\.png.meta
9. Assets/ARWay/ViewerMode/1\_UI/Icons/path\_start\_new\.png
10. Assets/ARWay/ViewerMode/1\_UI/Icons/path\_start\_new\.png.meta
11. Assets/ARWay/ViewerMode/1\_UI/Icons/path\_visual.png
12. Assets/ARWay/ViewerMode/1\_UI/Icons/path\_visual.png.meta
13. Assets/ARWay/ViewerMode/1\_UI/UI\_UX/View Tour Instructions.png
14. Assets/ARWay/ViewerMode/1\_UI/UI\_UX/View Tour Instructions.png.meta
15. Assets/ARWay/ViewerMode/2\_Scripts/ARMapSession/ContentTriggerHandler.cs
16. Assets/ARWay/ViewerMode/2\_Scripts/ARMapSession/ContentTriggerHandler.cs.meta
17. Assets/ARWay/ViewerMode/2\_Scripts/ARMapSession/PlayerCollisionController.cs
18. Assets/ARWay/ViewerMode/2\_Scripts/ARMapSession/PlayerCollisionController.cs.meta
19. Assets/ARWay/ViewerMode/3\_Assets/Materials/End Point Pin.mat
20. Assets/ARWay/ViewerMode/3\_Assets/Materials/End Point Pin.mat.meta
21. Assets/ARWay/ViewerMode/3\_Assets/Materials/Navigation Path.mat
22. Assets/ARWay/ViewerMode/3\_Assets/Materials/Navigation Path.mat.meta
23. Assets/ARWay/ViewerMode/3\_Assets/Materials/Point Pin.mat
24. Assets/ARWay/ViewerMode/3\_Assets/Materials/Point Pin.mat.meta
25. Assets/ARWay/ViewerMode/3\_Assets/Materials/Start Point Pin.mat
26. Assets/ARWay/ViewerMode/3\_Assets/Materials/Start Point Pin.mat.meta
27. Assets/ARWay/ViewerMode/3\_Assets/Models/EndModel 2D Text.glb
28. Assets/ARWay/ViewerMode/3\_Assets/Models/EndModel 2D Text.glb.meta
29. Assets/ARWay/ViewerMode/3\_Assets/Models/StartModel 2D Text.glb
30. Assets/ARWay/ViewerMode/3\_Assets/Models/StartModel 2D Text.glb.meta
31. Assets/ARWay/ViewerMode/3\_Assets/Shaders/NavigationPath.shader
32. Assets/ARWay/ViewerMode/3\_Assets/Shaders/NavigationPath.shader.meta
33. Assets/ARWay/ViewerMode/PathCreator.meta&#x20;
34. Assets/ARWay/ViewerMode/PathCreator/
35. Assets/ARWay/ViewerMode/Resources/ARContent/PathPointPin.prefab
36. Assets/ARWay/ViewerMode/Resources/ARContent/PathPointPin.prefab.meta

#### **Modified Files:**&#x20;

1. Assets/ARWay/ViewerMode/0\_Scene/ARMapSession.unity
2. Assets/ARWay/ViewerMode/0\_Scene/Dashboard-SDK.unity
3. Assets/ARWay/ViewerMode/1\_UI/DriftIndicatorUI/IndicatorUIHandler.cs
4. Assets/ARWay/ViewerMode/1\_UI/Icons/Mute.png Assets/ARWay/ViewerMode/1\_UI/Icons/Play Audio.png&#x20;
5. Assets/ARWay/ViewerMode/1\_UI/UI\_UX/ScanAnimation/LoadingText.cs
6. Assets/ARWay/ViewerMode/2\_Scripts/ARMapSession/ContentInfo.cs
7. Assets/ARWay/ViewerMode/2\_Scripts/ARMapSession/ContentLoadingAnimation.cs
8. Assets/ARWay/ViewerMode/2\_Scripts/ARMapSession/LocalizationPopup.cs
9. Assets/ARWay/ViewerMode/2\_Scripts/ARMapSession/MiniMapPreviewManager.cs
10. Assets/ARWay/ViewerMode/2\_Scripts/ARMapSession/NavigationTourViewPanel.cs
11. Assets/ARWay/ViewerMode/2\_Scripts/ARMapSession/PreviewMap.cs
12. Assets/ARWay/ViewerMode/2\_Scripts/ARMapSession/ViewerMapDetailsUI.cs
13. Assets/ARWay/ViewerMode/2\_Scripts/ARMapSession/ViewerScanUI.cs
14. Assets/ARWay/ViewerMode/2\_Scripts/ARSessionViewHandler.cs
15. Assets/ARWay/ViewerMode/2\_Scripts/Locationpin/Camera2dPos.cs
16. Assets/ARWay/ViewerMode/2\_Scripts/Locationpin/DirectoryPanel.cs
17. Assets/ARWay/ViewerMode/2\_Scripts/Locationpin/LocationPinUIHandler.cs
18. Assets/ARWay/ViewerMode/2\_Scripts/Locationpin/LocationpinViewer.cs
19. Assets/ARWay/ViewerMode/2\_Scripts/Utils/ARSessionTrackingState.cs
20. Assets/ARWay/ViewerMode/2\_Scripts/Utils/CustomPermissionHandler.cs
21. Assets/ARWay/ViewerMode/2\_Scripts/dashboard/AccessPointManager.cs
22. Assets/ARWay/ViewerMode/2\_Scripts/dashboard/MapDetailsManager.cs
23. Assets/ARWay/ViewerMode/2\_Scripts/dashboard/MapListManager.cs
24. Assets/ARWay/ViewerMode/2\_Scripts/dashboard/ToggleControllerCustom.cs
25. Assets/ARWay/ViewerMode/3\_Assets/Fonts/Poppins-Medium SDF.asset
26. Assets/ARWay/ViewerMode/3\_Assets/Materials/NavigationSphere.mat
27. Assets/ARWay/ViewerMode/3\_Assets/Prefabs/ARMapSession/API Limits Exceeded Popup.prefab
28. Assets/ARWay/ViewerMode/3\_Assets/Prefabs/ARMapSession/DialogBox/ClosestAccessPoint.prefab
29. Assets/ARWay/ViewerMode/3\_Assets/Prefabs/ARMapSession/DialogBox/DriftIndicatorPopup.prefab
30. Assets/ARWay/ViewerMode/3\_Assets/Prefabs/ARMapSession/DialogBox/ExitFromNavigation.prefab
31. Assets/ARWay/ViewerMode/3\_Assets/Prefabs/ARMapSession/DialogBox/InvalidQR.prefab
32. Assets/ARWay/ViewerMode/3\_Assets/Prefabs/ARMapSession/DialogBox/LeaveMapConfirmation - Viewer.prefab
33. Assets/ARWay/ViewerMode/3\_Assets/Prefabs/ARMapSession/DialogBox/LoaderPanel.prefab
34. Assets/ARWay/ViewerMode/3\_Assets/Prefabs/ARMapSession/DialogBox/LocalizationRequired.prefab
35. Assets/ARWay/ViewerMode/3\_Assets/Prefabs/ARMapSession/DialogBox/UnknownError.prefab
36. Assets/ARWay/ViewerMode/3\_Assets/Prefabs/ARMapSession/DialogBox/ViewTourInstructions.prefab
37. Assets/ARWay/ViewerMode/3\_Assets/Prefabs/ARMapSession/Notification/FindPlane.prefab
38. Assets/ARWay/ViewerMode/3\_Assets/Prefabs/ARMapSession/QR Info/QRInfoContent.cs
39. Assets/ARWay/ViewerMode/3\_Assets/Prefabs/ARMapSession/UI Panels/LocationpinViewerPanel.prefab
40. Assets/ARWay/ViewerMode/3\_Assets/Prefabs/ARMapSession/UI Panels/MiniMap Panel Viewer Mode.prefab&#x20;
41. Assets/ARWay/ViewerMode/3\_Assets/Prefabs/ARMapSession/UI Panels/PreviewMapMenu.prefab
42. Assets/ARWay/ViewerMode/3\_Assets/Prefabs/ARMapSession/UI Panels/QRScanPanel.prefab
43. Assets/ARWay/ViewerMode/3\_Assets/Prefabs/ARMapSession/UI Panels/Video Player Panel.prefab&#x20;
44. Assets/ARWay/ViewerMode/3\_Assets/Prefabs/ARMapSession/View Navigation Path Panel.prefab&#x20;
45. Assets/ARWay/ViewerMode/3\_Assets/Prefabs/Choose Color Scroll View\.prefab
46. Assets/ARWay/ViewerMode/3\_Assets/Prefabs/Dashboard/MapPrefsSettingsPanel.prefab
47. Assets/ARWay/ViewerMode/3\_Assets/Prefabs/Dimension Dropdown Prefab.prefab
48. Assets/ARWay/ViewerMode/3\_Assets/Prefabs/Radio Toggle.prefab
49. Assets/ARWay/ViewerMode/Plugins/ARwayKit-Viewer.dll
50. Assets/ARWay/ViewerMode/Plugins/ArwayTTS/SampleCode/Scripts/SpeechController.cs
51. Assets/ARWay/ViewerMode/Resources/ARContent/2dAnchor.prefab
52. Assets/ARWay/ViewerMode/Resources/ARContent/2dLocationpinPrefab.prefab
53. Assets/ARWay/ViewerMode/Resources/ARContent/AudioPrefab.prefab
54. Assets/ARWay/ViewerMode/Resources/ARContent/EndPointPin.prefab
55. Assets/ARWay/ViewerMode/Resources/ARContent/ImagePrefab.prefab
56. Assets/ARWay/ViewerMode/Resources/ARContent/LocationpinPrefab.prefab
57. Assets/ARWay/ViewerMode/Resources/ARContent/ModelPrefab.prefab
58. Assets/ARWay/ViewerMode/Resources/ARContent/StartPointPin.prefab
59. Assets/ARWay/ViewerMode/Resources/ARContent/VideoPrefab.prefab
60. Assets/ARWay/ViewerMode/Resources/AnchorPrefab.prefab
61. Assets/AddressableAssetsData/AddressableAssetSettings.asset
62. Assets/AddressableAssetsData/AssetGroups/Localization-String-Tables-English.asset
63. Assets/Localization/Localization Tables/StringTable\_Localization Shared Data.asset
64. Assets/Localization/Localization Tables/StringTable\_Localization\_en.asset
65. Assets/XR/Settings/OpenXR&#x20;
66. Package Settings.asset&#x20;
67. Packages/manifest.json
68. Packages/packages-lock.json
69. &#x20;ProjectSettings/GraphicsSettings.asset
70. ProjectSettings/ProjectSettings.asset&#x20;
71. ProjectSettings/ProjectVersion.txt

#### **New Files:**&#x20;

1. Assets/ARWay/ViewerMode/1\_UI/Icons/2D MAP ARROW ICON.png&#x20;
2. Assets/ARWay/ViewerMode/1\_UI/Icons/2D MAP ARROW ICON.png.meta&#x20;
3. Assets/ARWay/ViewerMode/1\_UI/Icons/Circle Shadow\.png&#x20;
4. Assets/ARWay/ViewerMode/1\_UI/Icons/Circle Shadow\.png.meta&#x20;
5. Assets/ARWay/ViewerMode/1\_UI/Icons/End Marker Tour.png&#x20;
6. Assets/ARWay/ViewerMode/1\_UI/Icons/End Marker Tour.png.meta&#x20;
7. Assets/ARWay/ViewerMode/1\_UI/Icons/Glowing Stripes Vertical.png&#x20;
8. Assets/ARWay/ViewerMode/1\_UI/Icons/Glowing Stripes Vertical.png.meta
9. Assets/ARWay/ViewerMode/1\_UI/Icons/Menu Chevron.png&#x20;
10. Assets/ARWay/ViewerMode/1\_UI/Icons/Menu Chevron.png.meta&#x20;
11. Assets/ARWay/ViewerMode/1\_UI/Icons/Scan\_Hand.png&#x20;
12. Assets/ARWay/ViewerMode/1\_UI/Icons/Scan\_Hand.png.meta&#x20;
13. Assets/ARWay/ViewerMode/1\_UI/Icons/Scan\_QRImage.png&#x20;
14. Assets/ARWay/ViewerMode/1\_UI/Icons/Scan\_QRImage.png.meta&#x20;
15. Assets/ARWay/ViewerMode/1\_UI/Icons/Start Marker Tour.png&#x20;
16. Assets/ARWay/ViewerMode/1\_UI/Icons/Start Marker Tour.png.meta&#x20;
17. Assets/ARWay/ViewerMode/1\_UI/Icons/Tour Color Picker Selected.png&#x20;
18. Assets/ARWay/ViewerMode/1\_UI/Icons/Tour Color Picker Selected.png.meta&#x20;
19. Assets/ARWay/ViewerMode/1\_UI/Icons/Tour Color Picker.png&#x20;
20. Assets/ARWay/ViewerMode/1\_UI/Icons/Tour Color Picker.png.meta&#x20;
21. Assets/ARWay/ViewerMode/1\_UI/Icons/Tour Icon BG.png&#x20;
22. Assets/ARWay/ViewerMode/1\_UI/Icons/Tour Icon BG.png.meta&#x20;
23. Assets/ARWay/ViewerMode/1\_UI/Icons/Tour Icon.png&#x20;
24. Assets/ARWay/ViewerMode/1\_UI/Icons/Tour Icon.png.meta&#x20;
25. Assets/ARWay/ViewerMode/1\_UI/Icons/Vector 524.png&#x20;
26. Assets/ARWay/ViewerMode/1\_UI/Icons/Vector 524.png.meta&#x20;
27. Assets/ARWay/ViewerMode/1\_UI/Icons/Vector 526.png&#x20;
28. Assets/ARWay/ViewerMode/1\_UI/Icons/Vector 526.png.meta&#x20;
29. Assets/ARWay/ViewerMode/1\_UI/Icons/navPathTexture.png&#x20;
30. Assets/ARWay/ViewerMode/1\_UI/Icons/navPathTexture.png.meta&#x20;
31. Assets/ARWay/ViewerMode/1\_UI/Icons/path\_disk.png&#x20;
32. Assets/ARWay/ViewerMode/1\_UI/Icons/path\_disk.png.meta&#x20;
33. Assets/ARWay/ViewerMode/1\_UI/Icons/ring.png&#x20;
34. Assets/ARWay/ViewerMode/1\_UI/Icons/ring.png.meta&#x20;
35. Assets/ARWay/ViewerMode/1\_UI/Locationpin.meta&#x20;
36. Assets/ARWay/ViewerMode/1\_UI/Locationpin/LocationpinBG.png&#x20;
37. Assets/ARWay/ViewerMode/1\_UI/Locationpin/LocationpinBG.png.meta&#x20;
38. Assets/ARWay/ViewerMode/1\_UI/UI\_UX/MotionHand.png&#x20;
39. Assets/ARWay/ViewerMode/1\_UI/UI\_UX/MotionHand.png.meta&#x20;
40. Assets/ARWay/ViewerMode/1\_UI/UI\_UX/MotionPopupBG.png&#x20;
41. Assets/ARWay/ViewerMode/1\_UI/UI\_UX/MotionPopupBG.png.meta&#x20;
42. Assets/ARWay/ViewerMode/1\_UI/UI\_UX/ScanWarning.png&#x20;
43. Assets/ARWay/ViewerMode/1\_UI/UI\_UX/ScanWarning.png.meta&#x20;
44. Assets/ARWay/ViewerMode/1\_UI/UI\_UX/Tour Instructions Chevrons.png&#x20;
45. Assets/ARWay/ViewerMode/1\_UI/UI\_UX/Tour Instructions Chevrons.png.meta&#x20;
46. Assets/ARWay/ViewerMode/1\_UI/UI\_UX/Tour Instructions Guided Path.png&#x20;
47. Assets/ARWay/ViewerMode/1\_UI/UI\_UX/Tour Instructions Guided Path.png.meta&#x20;
48. Assets/ARWay/ViewerMode/1\_UI/UI\_UX/Vertical Gradient Dark.png&#x20;
49. Assets/ARWay/ViewerMode/1\_UI/UI\_UX/Vertical Gradient Dark.png.meta&#x20;
50. Assets/ARWay/ViewerMode/1\_UI/UI\_UX/Vertical Gradient.png&#x20;
51. Assets/ARWay/ViewerMode/1\_UI/UI\_UX/Vertical Gradient.png.meta&#x20;
52. Assets/ARWay/ViewerMode/2\_Scripts/ARMapSession/TourInstructions.cs&#x20;
53. Assets/ARWay/ViewerMode/2\_Scripts/ARMapSession/TourInstructions.cs.meta&#x20;
54. Assets/ARWay/ViewerMode/2\_Scripts/Locationpin/ArVideoPlayer.cs&#x20;
55. Assets/ARWay/ViewerMode/2\_Scripts/Locationpin/ArVideoPlayer.cs.meta&#x20;
56. Assets/ARWay/ViewerMode/3\_Assets/ARFoundation/AR Plane/DebugPlane.mat&#x20;
57. Assets/ARWay/ViewerMode/3\_Assets/ARFoundation/AR Plane/DebugPlane.mat.meta&#x20;
58. Assets/ARWay/ViewerMode/3\_Assets/Materials/Discs.mat&#x20;
59. Assets/ARWay/ViewerMode/3\_Assets/Materials/Discs.mat.meta&#x20;
60. Assets/ARWay/ViewerMode/3\_Assets/Materials/GlowingStripe.mat&#x20;
61. Assets/ARWay/ViewerMode/3\_Assets/Materials/GlowingStripe.mat.meta&#x20;
62. Assets/ARWay/ViewerMode/3\_Assets/Materials/GuidedPath.mat&#x20;
63. Assets/ARWay/ViewerMode/3\_Assets/Materials/GuidedPath.mat.meta&#x20;
64. Assets/ARWay/ViewerMode/3\_Assets/Materials/JumboChevron Mat.mat&#x20;
65. Assets/ARWay/ViewerMode/3\_Assets/Materials/JumboChevron Mat.mat.meta&#x20;
66. Assets/ARWay/ViewerMode/3\_Assets/Materials/NavigationMinimap.mat&#x20;
67. Assets/ARWay/ViewerMode/3\_Assets/Materials/NavigationMinimap.mat.meta&#x20;
68. Assets/ARWay/ViewerMode/3\_Assets/Models/JumboChevron.glb&#x20;
69. Assets/ARWay/ViewerMode/3\_Assets/Models/JumboChevron.glb.meta&#x20;
70. Assets/ARWay/ViewerMode/3\_Assets/Prefabs/ARMapSession/QR Info/QR/IAP.png&#x20;
71. Assets/ARWay/ViewerMode/3\_Assets/Prefabs/ARMapSession/QR Info/QR/IAP.png.meta&#x20;
72. Assets/ARWay/ViewerMode/3\_Assets/Shaders/NavPath.shader&#x20;
73. Assets/ARWay/ViewerMode/3\_Assets/Shaders/NavPath.shader.meta&#x20;
74. Assets/ARWay/ViewerMode/4\_VFX/Shaders.meta&#x20;
75. Assets/ARWay/ViewerMode/4\_VFX/Shaders/ChromaKey.shader&#x20;
76. Assets/ARWay/ViewerMode/4\_VFX/Shaders/ChromaKey.shader.meta&#x20;
77. Assets/ARWay/ViewerMode/4\_VFX/Shaders/Confetti Video.mp4&#x20;
78. Assets/ARWay/ViewerMode/4\_VFX/Shaders/Confetti Video.mp4.meta&#x20;
79. Assets/ARWay/ViewerMode/4\_VFX/Shaders/ImageToKey.mat&#x20;
80. Assets/ARWay/ViewerMode/4\_VFX/Shaders/ImageToKey.mat.meta&#x20;
81. Assets/ARWay/ViewerMode/4\_VFX/Shaders/New Render Texture.renderTexture&#x20;
82. Assets/ARWay/ViewerMode/4\_VFX/Shaders/New Render Texture.renderTexture.meta&#x20;
83. Assets/ARWay/ViewerMode/5\_ExternalPlugin/KDTree.meta&#x20;
84. Assets/ARWay/ViewerMode/5\_ExternalPlugin/KDTree/Color.mat&#x20;
85. Assets/ARWay/ViewerMode/5\_ExternalPlugin/KDTree/Color.mat.meta&#x20;
86. Assets/ARWay/ViewerMode/5\_ExternalPlugin/KDTree/Cube.prefab&#x20;
87. Assets/ARWay/ViewerMode/5\_ExternalPlugin/KDTree/Cube.prefab.meta&#x20;
88. Assets/ARWay/ViewerMode/5\_ExternalPlugin/KDTree/CubeSpawner.cs&#x20;
89. Assets/ARWay/ViewerMode/5\_ExternalPlugin/KDTree/CubeSpawner.cs.meta&#x20;
90. Assets/ARWay/ViewerMode/5\_ExternalPlugin/KDTree/KDTree.unity&#x20;
91. Assets/ARWay/ViewerMode/5\_ExternalPlugin/KDTree/KDTree.unity.meta&#x20;
92. Assets/ARWay/ViewerMode/5\_ExternalPlugin/KDTree/Test.cs&#x20;
93. Assets/ARWay/ViewerMode/5\_ExternalPlugin/KDTree/Test.cs.meta&#x20;
94. Assets/ARWay/ViewerMode/5\_ExternalPlugin/KDTree/testSceneSettings.lighting&#x20;
95. Assets/ARWay/ViewerMode/5\_ExternalPlugin/KDTree/testSceneSettings.lighting.meta&#x20;
96. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator.meta&#x20;
97. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core.meta&#x20;
98. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Editor.meta&#x20;
99. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Editor/Helper.meta&#x20;
100. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Editor/Helper/MouseUtility.cs&#x20;
101. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Editor/Helper/MouseUtility.cs
102. .meta&#x20;
103. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Editor/Helper/PathHandle.cs&#x20;
104. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Editor/Helper/PathHandle.cs.
105. meta&#x20;
106. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Editor/Helper/ScreenSpacePolyLine.cs&#x20;
107. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Editor/Helper/ScreenSpacePolyLine.cs.meta&#x20;
108. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Editor/PathCreatorEditor.asmdef&#x20;
109. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Editor/PathCreatorEditor.asmdef.meta&#x20;
110. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Editor/PathEditor.cs&#x20;
111. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Editor/PathEditor.cs.meta&#x20;
112. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Runtime.meta&#x20;
113. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Runtime/Objects.meta&#x20;
114. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Runtime/Objects/BezierPath.cs&#x20;
115. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Runtime/Objects/BezierPath.cs.meta
116. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Runtime/Objects/EndOfPathInstruction.cs&#x20;
117. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Runtime/Objects/EndOfPathInstruction.cs.meta&#x20;
118. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Runtime/Objects/GlobalDisplaySettings.cs&#x20;
119. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Runtime/Objects/GlobalDisplaySettings.cs.meta&#x20;
120. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Runtime/Objects/MinMax3D.cs&#x20;
121. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Runtime/Objects/MinMax3D.cs.meta&#x20;
122. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Runtime/Objects/PathCreator.cs&#x20;
123. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Runtime/Objects/PathCreator.cs.meta&#x20;
124. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Runtime/Objects/PathCreatorData.cs&#x20;
125. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Runtime/Objects/PathCreatorData.cs.meta&#x20;
126. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Runtime/Objects/PathSpace.cs&#x20;
127. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Runtime/Objects/PathSpace.cs.meta&#x20;
128. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Runtime/Objects/VertexPath.cs&#x20;
129. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Runtime/Objects/VertexPath.cs.meta&#x20;
130. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Runtime/PathCreator.asmdef&#x20;
131. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Runtime/PathCreator.asmdef.meta&#x20;
132. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Runtime/Utility.meta&#x20;
133. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Runtime/Utility/CubicBezierUtility.cs&#x20;
134. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Runtime/Utility/CubicBezierUtility.cs.meta&#x20;
135. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Runtime/Utility/MathUtility.cs&#x20;
136. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Runtime/Utility/MathUtility.cs.meta&#x20;
137. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Runtime/Utility/VertexPathUtility.cs&#x20;
138. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Runtime/Utility/VertexPathUtility.cs.meta&#x20;
139. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Settings.meta&#x20;
140. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Settings/GlobalDisplaySettings.asset&#x20;
141. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Core/Settings/GlobalDisplaySettings.asset.meta
142. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/GeneratePATH.unity&#x20;
143. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/GeneratePATH.unity.meta&#x20;
144. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/PathWaypointsManager.cs&#x20;
145. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/PathWaypointsManager.cs.meta&#x20;
146. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Scripts.meta&#x20;
147. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Scripts/Editor.meta&#x20;
148. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Scripts/Editor/PathSceneToolEditor.cs&#x20;
149. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Scripts/Editor/PathSceneToolEditor.cs.meta&#x20;
150. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Scripts/NavigationPathCreator.cs&#x20;
151. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Scripts/NavigationPathCreator.cs.meta
152. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Scripts/PathPlacer.cs&#x20;
153. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Scripts/PathPlacer.cs.meta&#x20;
154. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Scripts/PathSceneTool.cs&#x20;
155. Assets/ARWay/ViewerMode/5\_ExternalPlugin/PathCreator/Scripts/PathSceneTool.cs.meta&#x20;
156. Assets/ARWay/ViewerMode/Resources/ARContent/ARMinimap.prefab&#x20;
157. Assets/ARWay/ViewerMode/Resources/ARContent/ARMinimap.prefab.meta&#x20;
158. Assets/ARWay/ViewerMode/Resources/ARContent/JumboChevron.prefab&#x20;
159. Assets/ARWay/ViewerMode/Resources/ARContent/JumboChevron.prefab.meta&#x20;
160. Assets/ARWay/ViewerMode/Resources/ARContent/NavigationMinimap.renderTexture&#x20;
161. Assets/ARWay/ViewerMode/Resources/ARContent/NavigationMinimap.renderTexture.meta&#x20;
162. Assets/ARWay/ViewerMode/Resources/ARContent/NavigationPath.prefab&#x20;
163. Assets/ARWay/ViewerMode/Resources/ARContent/NavigationPath.prefab.meta
164. Assets/ARWay/ViewerMode/Resources/ARContent/PathCreationAnimation.prefab&#x20;
165. Assets/ARWay/ViewerMode/Resources/ARContent/PathCreationAnimation.prefab.meta&#x20;
166. Assets/ARWay/ViewerMode/Resources/Marker.meta&#x20;
167. Assets/ARWay/ViewerMode/Resources/Marker/MarkerPrefab.prefab&#x20;
168. Assets/ARWay/ViewerMode/Resources/Marker/MarkerPrefab.prefab.meta&#x20;
169. Assets/ARWay/ViewerMode/Resources/Marker/Test.mat&#x20;
170. Assets/ARWay/ViewerMode/Resources/Marker/Test.mat.meta&#x20;
171. Assets/ARWay/ViewerMode/Resources/Plane/DebugPlane.prefab&#x20;
172. Assets/ARWay/ViewerMode/Resources/Plane/DebugPlane.prefab.meta&#x20;
173. Assets/AddressableAssetsData/AssetGroups/Localization-String-Tables-English (en).asset&#x20;
174. Assets/AddressableAssetsData/AssetGroups/Localization-String-Tables-English (en).asset.meta&#x20;
175. Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-English (en)\_BundledAssetGroupSchema.asset&#x20;
176. Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-English (en)\_BundledAssetGroupSchema.asset.meta&#x20;
177. Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-English (en)\_ContentUpdateGroupSchema.asset&#x20;
178. Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-English (en)\_ContentUpdateGroupSchema.asset.meta&#x20;
179. Assets/AddressableAssetsData/link.xml&#x20;
180. Assets/AddressableAssetsData/link.xml.meta


# 3.0.0 -> 3.0.1

#### Changes

* Bug fixes with Android QR code scanning resolved
* Minor bug fixes in navigation and floor plan view
* Updated scan environment UI

### **Steps to Upgrade**

This guide will walk you through the process of upgrading v3.0.0 of the ARwayKit SDK to v3.0.1. Please follow the instructions carefully to ensure a smooth transition to the new version.

1. **Download the New Version**: Download the ARway Unity Package v3.0.0 from the official ARway website or your client portal.
2. **Backup Your Project**: Save your Unity project with your version control system (such as Git) to ensure you can revert in case of any unforeseen issues.
3. **Copy the Modified Files**: The following files are changed in this update:
   1. Assets/ARWay/ViewerMode/0\_Scene/ARMapSession.unity
   2. Assets/ARWay/ViewerMode/1\_UI/Icons/Hand.png
   3. Assets/ARWay/ViewerMode/1\_UI/Icons/Hand.png.meta
   4. Assets/ARWay/ViewerMode/1\_UI/Icons/Scan\_your\_environment.png&#x20;
   5. Assets/ARWay/ViewerMode/2\_Scripts/NavigationTourViewPanel.cs
   6. Assets/ARWay/ViewerMode/2\_Scripts/ARSessionViewHandler.cs
   7. Assets/ARWay/ViewerMode/2\_Scripts/Utils/GLTFLoader.cs
   8. Assets/ARWay/ViewerMode/2\_Scripts/Utils/UIMover.cs
   9. Assets/ARWay/ViewerMode/2\_Scripts/Utils/UIMover.cs.meta
   10. Assets/ARWay/ViewerMode/2\_Scripts/dashboard/AccessPointManager.cs
   11. Assets/ARWay/ViewerMode/2\_Scripts/dashboard/MapDetailsManager.cs
   12. Assets/ARWay/ViewerMode/3\_Prefabs/ARMapSession/Notification/FindPlane.prefab
   13. Assets/ARWay/ViewerMode/3\_Prefabs/ARMapSession/UIPanels/QRScanPanel.prefab
   14. Assets/ARWay/ViewerMode/Plugins/ARwayKit-Viewer.dll
   15. Assets/ARWay/ViewerMode/Resources/Properties.asset
   16. ProjectSettings/ProjectSettings.asset
   17. Assets/ARWay/ViewerMode/1\_UI/Icons/Hand.png
   18. Assets/ARWay/ViewerMode/1\_UI/Icons/Hand.png.meta
   19. Assets/ARWay/ViewerMode/2\_Scripts/Utils/UIMover.cs
   20. Assets/ARWay/ViewerMode/2\_Scripts/Utils/UIMover.cs.meta
4. **Build and Test**: Rebuild your Unity project and thoroughly test all the ARway features and functionalities that your application uses.


# 2.5.1 -> 3.0.0

With the update from v2.5.1 to v3.0, ARway has reworked the entire structure of the SDK to enable us to update the ARway app alongside the SDK. This way, updates to the SDK will be performed more frequently.

For this update, your ARway project will need to be rebuilt from the source code for access to the new features.

Instructions on how to build from the source code can be found from the following link:

{% content-ref url="/pages/fbaryUns9yh3L3xIiQO4" %}
[Building from the Source Code](/arway-sdk/building-from-the-source-code)
{% endcontent-ref %}

If you have integrated the ARwayKit .unitypackage with your own app, you can follow these steps to remove the old version and integrate the new one.

### **Replacing ARwayKit in an existing Unity Project.**

This guide will walk you through the process of upgrading v2.5.1 of the ARwayKit SDK to v3.0.

1. **Backup Your Project**: Save your Unity project with your version control system (such as Git) to ensure you can revert in case of any unforeseen issues.
2. **Delete the ARwayKitSDK Folder:** To remove the package, delete its folder from the "Assets" directory. Right-click on the folder "ARwayKitSDK" and select "Delete".
3. **Remove References:** After deleting the folder, you may need to clean up any references to the package in your project, such as script references or references in your scenes. Unity might display errors in the Console window indicating missing assets, so you should address and remove those references as well.
4. **Add the latest ARwayKit .unitypackage**: Integrate the latest .unitypackage by following these steps: [Integrating the Unity Package](/arway-sdk/quickstart-in-unity)
5. **Build and Test**: Rebuild your Unity project and thoroughly test all the ARway features and functionalities that your application uses.


# 2.3.1 -> 2.5.1

With the update from v2.3.1 to v2.5.1, several changes have been made that significantly affect how the Sample App functions. If you've only made branding changes to the app, **we recommend rebuilding the app from the source code** and then reapplying your branding changes.

If you have integrated the ARwayKit .unitypackage with your own app, you can follow these steps to remove the old version and integrate the new one.

### **Steps to Upgrade**

This guide will walk you through the process of upgrading v2.3.1 of the ARwayKit SDK to v2.5.1.

1. **Backup Your Project**: Save your Unity project with your version control system (such as Git) to ensure you can revert in case of any unforeseen issues.
2. **Delete the ARwayKitSDK Folder:** To remove the package, delete its folder from the "Assets" directory. Right-click on the folder "ARwayKitSDK" and select "Delete".
3. **Remove References:** After deleting the folder, you may need to clean up any references to the package in your project, such as script references or references in your scenes. Unity might display errors in the Console window indicating missing assets, so you should address and remove those references as well.
4. **Add the latest ARwayKit .unitypackage**: Integrate the latest .unitypackage by following these steps: [Integrating the Unity Package](/arway-sdk/quickstart-in-unity)
5. **Build and Test**: Rebuild your Unity project and thoroughly test all the ARway features and functionalities that your application uses.


# 2.3 -> 2.3.1

### 2.3.1 Changes

#### Fixed

* Support for location pins added from newer versions of ARway added.

### **Steps to Upgrade**

This guide will walk you through the process of upgrading v2.3 of the ARwayKit SDK to v2.3.1. Please follow the instructions carefully to ensure a smooth transition to the new version.

1. **Download the New Version**: Download the ARway Unity Package v2.3.1 from the official ARway website or your client portal.
2. **Backup Your Project**: Save your Unity project with your version control system (such as Git) to ensure you can revert in case of any unforeseen issues.
3. **Replace ARWayKit.dll**: The only file that has changed between v2.3 and v2.3.1 is located at `/Assets/ARwayKitSDK/Plugins/ARWayKit.dll`. Extract the zip file (or download the file directly from the repo) containing the new version and replace the existing `ARWayKit.dll` in your project with the one from the new package.
4. **Verify Integration**: Double-check that the `ARWayKit.dll` integration went smoothly and there were no errors during import.
5. **Build and Test**: Rebuild your Unity project and thoroughly test all the ARway features and functionalities that your application uses.


# Enhancing the Sample App

Modifying the code to add new features

With the given Sample App, you can personalize it by incorporating additional features. This section will walk you through the code adjustments that can be applied to enhance the sample app.

* [Instant Navigation](/arway-sdk/enhancing-the-sample-app/instant-location-pin-navigation)
* [Customizing the Default Navigation Arrow](/arway-sdk/enhancing-the-sample-app/customizing-the-default-navigation-arrow)


# Instant Location Pin Navigation

Immediately open the location pin navigation preview after scanning the QR code

This page will showcase how to add in the feature to open the location pin path preview after scanning the QR code.

## Triggering the Location Pin Path Preview

In the scene "ARMapSession" you can trigger the location pin path preview with the following code:

```csharp
WindowManager.Instance.OpenPanel("LocationpinViewerPanel");
LocationpinViewer.Instance.OpenLocationDetails(location);
LocationpinViewer.Instance.GetDirection();
```

We use the existing WindowManager and LocationPinViewHandler to open the panels required for the path preview.

## Example 1: Passing Location Pin Information from the Scene

### Selecting a Location Pin from the Creator Portal

The first thing we need to do is acquire a value from the location pin that we can reference. You can choose from the following location pin values: id, name, description, or notes.

In this example, we'll use the "notes" section, located under the "Advanced Settings" when selecting the location pins.&#x20;

<figure><img src="/files/DoZXlPKk9VHDF0h0ttOI" alt=""><figcaption><p>Location Pin Advanced Settings</p></figcaption></figure>

### Modifying the SDK Code

#### Modifying the "Dashboard" Scene

You can add a new function to save a value to the PlayerPrefs that can be fetched when the "ARMapSession" scene is opened.

<pre class="language-csharp"><code class="lang-csharp"><strong>public void OpenLocationPinPreview(string destinationValue)
</strong>{
    // Find the MapsInfoManager GameObject
    GameObject mapsInfoManagerObject = GameObject.Find("MapsInfoManager");

    if (mapsInfoManagerObject != null)
    {
        // Attempt to get the MapsInfoManager component
        MapsInfoManager mapsInfoManager = mapsInfoManagerObject.GetComponent&#x3C;MapsInfoManager>();

        if (mapsInfoManager != null)
        {
            // Set destination value in PlayerPrefs
            PlayerPrefs.SetString("NavToValue", destinationValue);
            PlayerPrefs.Save();

            // Start AR session
            mapsInfoManager.StartARSession(true);
        }
    }
}
</code></pre>

#### Modifying the "ARMapSession" Scene

In the file "Assets/ARway/ViewerMode/2\_Scripts/SDK/ARMapLoader.cs" add the following function:

```csharp
public void CheckForNavTo()
{
    if (!PlayerPrefs.HasKey("NavToValue"))
    {
        return;
    }

    string navToValue = PlayerPrefs.GetString("NavToValue");
    PlayerPrefs.DeleteKey("NavToValue");
    PlayerPrefs.Save();

    Dictionary<string, LocationPinUi> locationPinsWithID = ContentStorageManager.Instance.m_LocationPinsWithID;

    foreach (KeyValuePair<string, LocationPinUi> pair in locationPinsWithID)
    {
        string id = pair.Key;
        LocationPinUi locationPinUi = pair.Value;
        string note = locationPinUi.locationPin.advanced.note;
        if (!string.IsNullOrEmpty(note) && note == navToValue)
        {
            LocationPinUi? location = ContentStorageManager.Instance.m_LocationPinsWithID[id];
            if (location != null)
            {
                WindowManager.Instance.OpenPanel("LocationpinViewerPanel");
                LocationpinViewer.Instance.OpenLocationDetails(location);
                LocationpinViewer.Instance.GetDirection();
            }
        }
    }
}
```

Then, include the function call at the end of LoadLocationpinContent, around line 111.

<pre class="language-git"><code class="lang-git">...
    #region WayPointContent
    foreach (Waypoint3d tour in arContent.waypoints3ds)
    {
        ContentStorageManager.Instance.LoadNavigationTour(tour);
    }
    #endregion    
+   CheckForNavTo();  
}
<strong>...     
</strong></code></pre>

Then in that same file, add the following to line #5:

```csharp
using System.Collections.Generic;
```

Then, on line #15, add the following line `PlayerPrefs.SetInt("ArwayKit.Viewer.InstructionRequired", 0);` to the OnEnable function. This is to hide the pop-up that appears after entering the map, as we will be proceeding directly to the instant navigation instead.

```git
...
private void OnEnable()
{
    ContentStorageManager.OnReadyForARContentInitialize += LoadARContent;
    LocationpinViewController.OnLocationPinConfigured += LoadLocationpinContent;
+   PlayerPrefs.SetInt("ArwayKit.Viewer.InstructionRequired", 0);
}
... 
```

From there, if there is a matching value in the "notes" section of the Location Pin it will open the Location Pin Path Preview after the QR code is scanned, and the map content is loaded.

## Example 2: Using the Anchor Description

### Edit the Description of an Anchor to Include a Location Pin Name

In the Creator Portal Studio, select an Anchor, and then in the left menu, enter the following: `InstantNav: locationPinName`. We will use the "InstantNav:" portion as the identifier so that only if the keyword is present in the anchor that has been scanned, it will use the locationPinName to choose the instant navigation location pin. This means that you can replace "locationPinName" with the name of your location pin. Once you've added the description, click the "Save" button at the bottom, and then publish your map.

<figure><img src="/files/V7N2kbMMkuEoaw9LtPzQ" alt=""><figcaption><p>Adding the text InstantNav: locationPinName to the description of a QR code.</p></figcaption></figure>

The location pin for instant navigation matches what has been set in the anchor description.

<figure><img src="/files/Vo4m3xIyX7zqzKUfxcTH" alt=""><figcaption><p>Location pin name matches the value in the QR code description.</p></figcaption></figure>

### Modifying the SDK Code

In the file "Assets/ARway/ViewerMode/2\_Scripts/SDK/ARMapLoader.cs" add the following function:

```csharp
public void CheckForNavTo()
{
    string keyword = "InstantNav:";
    string lastQRCodeScanId = ArwayMapController.Instance.LastScanQRID();
    // Create a dictionary for faster lookup
    Dictionary<string, LocationPinUi> locationPinsWithID = ContentStorageManager.Instance.m_LocationPinsWithID;
    foreach (Anchor m_Anchor in ArwayMapController.MapData.data.metadata.anchors)
    {
        if (m_Anchor.id == lastQRCodeScanId && m_Anchor.description.StartsWith(keyword))
        {
            // Extract location pin name directly without using Substring
            string locationPinName = m_Anchor.description.Substring(keyword.Length).Trim();
            foreach (var kvp in locationPinsWithID)
            {
                LocationPinUi locationPinUi = kvp.Value;
                if (locationPinUi.locationPin.name == locationPinName)
                {
                    WindowManager.Instance.OpenPanel("LocationpinViewerPanel");
                    LocationpinViewer.Instance.OpenLocationDetails(locationPinUi);
                    LocationpinViewer.Instance.GetDirection();
                    return; // Exit loop if found
                }
            }
        }
    }
}
```

Then in that same file, add the following to line #5:

```csharp
using System.Collections.Generic;
```

Then, on line #15, add the following line `PlayerPrefs.SetInt("ArwayKit.Viewer.InstructionRequired", 0);` to the OnEnable function. This is to hide the pop-up that appears after entering the map, as we will be proceeding directly to the instant navigation instead.

```git
private void OnEnable()
{
    ContentStorageManager.OnReadyForARContentInitialize += LoadARContent;
    LocationpinViewController.OnLocationPinConfigured += LoadLocationpinContent;
+   PlayerPrefs.SetInt("ArwayKit.Viewer.InstructionRequired", 0);
}
```

Then at the bottom of the file, on line #139, add the line to the end of the LoadMapContent function, and the file will look like this:

```csharp
...
    #region WayPointContent
    foreach (Waypoint3d tour in arContent.waypoints3ds)
    {
        ContentStorageManager.Instance.LoadNavigationTour(tour);
    }
    #endregion

    CheckForNavTo();
}
```

Then you can build your app. When you add the keywords to the anchor description in the Creator Portal Studio, you can enable the instant navigation functionality in your customized app.


# Customizing the Default Navigation Arrow

Changing the default 3D model of the location pin navigation

The default navigation arrow on the platform is a .glb 3D model that rotates in place. Below is an example of what the default orange arrow looks like.

<figure><img src="/files/M1HcHebrJk9PeMPF6CAS" alt="" width="166"><figcaption><p>Default navigation with orange arrow.</p></figcaption></figure>

This model is added as an asset to the the sample app and can be found at:

`/Assets/ARWay/ViewerMode/3_Assets/Models/arrowNew.glb`

## Using the Default Arrow Navigation Style

The default navigation icon is used for location pin turn-by-turn navigation and is one of the available navigation styles for location pins.

This navigation style can be set in the Creator Portal Studio for the location.

{% hint style="info" %}
[Watch this video](https://www.youtube.com/watch?v=k_RBBZ3kfCE) to learn more about location pins.
{% endhint %}

To change the navigation style of your location pins, follow these steps: Go to the Creator Portal, navigate to the My Maps tab, select a map, click the Open in Studio button, then, at the top, click the Location Pins button. Finally, select a location pin and choose the navigation style.

This navigation style is displayed to the map visitor when they are navigating to the location pin.

The default arrow navigation will also be used when the map visitor is more than 3 meters away from a path created in the Creator Portal Studio.

## Swapping the .glb File

### Getting a New Model

If you prefer using a 3D model other than the default arrow, you can replace the existing 3D model.&#x20;

Start by converting the model to .glb format using any 3D modeling editor. Afterward, rename it to arrowNew\.glb. The reason for naming it this way is that it replaces the existing arrow 3D model file.

### Swapping the Model

To replace the current model, swap out your new arrowNew\.glb file with the one in the`/Assets/ARWay/ViewerMode/3_Assets/Models/` folder. Now when you build the sample app, the default arrow will be replaced with your 3D model.

### Adjusting Model

One thing you may notice is that the scale, rotation, and positioning of your new 3D model may appear off. These settings can be adjusted from the DefaultArrow prefab.

First, open the prefab DefaultArrow located at `/Assets/ARWay/Resources/ARContent/DefaultArrow`.Then navigate to the Location Pin Arrow object from the hierarchy. DefaultArrow -> Location Pin Arrow.

When you have the location pin arrow selected, you can modify the transform settings of the 3D model.

<figure><img src="/files/z3s06bMPhpYQM98fuy0h" alt=""><figcaption><p>Accessing the transform for the 3D model.</p></figcaption></figure>

#### Removing the Shaded Semicircle from the Screen

After adding the new model, you may notice that a background for the shaded semicircle still appears at the bottom of the screen.

<figure><img src="/files/Te4ZXfROU2LSY6JuD2Ou" alt="" width="217"><figcaption><p>Shaded semicircle at screen bottom.</p></figcaption></figure>

To remove the semicircle, in the DefaultArrow prefab and select the Arrow Background game object from the hierarchy. DefaultArrow -> Location Pin Arrow -> Arrow Background.

Then in the inspector window, uncheck the Sprite Renderer on the game object.

<figure><img src="/files/RGq2EZHM5Av8OwSzsO8R" alt=""><figcaption><p>Uncheck the sprite renderer on the game object to hide the shaded semicircle from the default navigation.</p></figcaption></figure>

#### Settings for Animated 3D Models

If your chosen 3D model has an animation that isn't playing, try switching the animation from Mecanim to Legacy in the inspector window.&#x20;

In the Project tab, navigate to `/Assets/ARWay/ViewerMode/3_Assets/Models/arrowNew.glb`. Then, in the inspector window, change the animation from Mecanim to Legacy.

<figure><img src="/files/WidVyRQt4DBpi43Gn10q" alt=""><figcaption><p>Changing animation in the inspector window.</p></figcaption></figure>

With these changes, you can build your app to preview the updated default navigation model.

<figure><img src="/files/dTDAnYkRsasgh2iVQ1K0" alt="" width="220"><figcaption><p>Location pin navigation with new 3D model replacing the default arrow.</p></figcaption></figure>


# 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.


# Overview

Overview of the ARway Developer Portal

## What is ARway Maps Studio Portal?

ARway Map Studio portal is a one-stop place that allows you to -

* Add and Edit Maps Contents, QR codes, and Image access points via the ARway Web Studio.
* Get your unique App Authentication Credentials for Linking SDK with Your Maps Studio.
* Look for Account and Current Plan information.
* Look up the Documentation and Tutorials to help you get started.
* Contact us for technical support or general inquiries.
* Download the latest SDK release and the ARway app.

## Creating an account

In order to create a new account, go to the [ARway Maps Studio](https://maps-studio.nextechar.com/) and register yourself by entering the following details -

* Your Email ID
* A Secure Password&#x20;

<figure><img src="/files/4tMAdKX2UJJJS6C32Egd" alt=""><figcaption></figcaption></figure>

## Logging In&#x20;

After you have registered yourself on the ARway Developer portal, you can log in to your account by entering -

* Your Registered Email ID
* Your Password

<figure><img src="/files/eGfHACSDVbV3IG9v2gj7" alt=""><figcaption></figcaption></figure>

## Reset Password

In order to reset your password, go to the [Password Reset](https://maps-studio.nextechar.com/auth/forgotpassword) page, enter your registered email ID and click on the Next button. Then you will receive instructions on how to change your password.

<figure><img src="/files/z67US2NPavji4Nru6JoB" alt=""><figcaption></figcaption></figure>


# Maps Studio

Create and Edit Maps in the Web Studio

## What is ARway Maps Studio?

The ARway Maps Studio is a one-stop place that allows you to -

* Edit existing maps.
* Add Tours and Location Pins.
* Add 3D assets, Text, Hotspots, Images, and more.
* Manage Map Utilities like QR Codes, map markers, and Image access points.&#x20;

<figure><img src="/files/k2bTydG6y1SnhwgHPm1r" alt=""><figcaption><p>ARway Maps Studio Dashboard</p></figcaption></figure>

<figure><img src="/files/u2HhC8p5iUCNjNkvyMHv" alt=""><figcaption><p>List of all maps in account</p></figcaption></figure>


# Creating a Map

Create a map with ARway

## Maps Studio

**Step 1:** In the Maps Studio dashboard, click the "My Maps" button on the sidebar on the left.

<figure><img src="/files/ijxM3R7JwXhQzfipYfBP" alt=""><figcaption><p>Maps Studio dashboard</p></figcaption></figure>

**Step 2:** Click the "Create New Map" button on the top right.

<figure><img src="/files/av3exkTApu9xISmA7Ekd" alt=""><figcaption><p>My Maps</p></figcaption></figure>

**Step 3:** Enter the map details for the title and description and thumbnail. These will be visible to viewers of the map. You can also upload a Floorplan to use for accurate content placement in our studio.

<figure><img src="/files/qQUoV8jUUHPiN4V7SwOk" alt=""><figcaption><p>Map Setup</p></figcaption></figure>

**Step 4:** After entering that information you will be prompted to download a QR code to continue. The QR code will need to be placed where users can scan it to enter the ARway map.

<figure><img src="/files/CCN9FjvnZQCWlpgYXofj" alt=""><figcaption><p>QR code</p></figcaption></figure>

**Step 5:** Using the ARway app, activate the QR code to begin managing the content on the map.

<figure><img src="/files/Nq5IrbG9S6GjF75lw8Ey" alt=""><figcaption><p>Map activation</p></figcaption></figure>


# Editing Map Details

Edit an existing map in the editor

## How to edit a map?

**Step 1:** In order to edit a map, click on the Map details you like to edit for the desired map.

<figure><img src="/files/3MSE2acNTMLmKOaXRpAd" alt=""><figcaption></figcaption></figure>

**Step 2:** After updating all details click on the Save Changes buttons to save.


# Uploading Content

Uploading content to the Maps Studio

Content can be uploaded to the "Content Library" of the ARway dashboard for usage within the ARway maps.

<figure><img src="/files/x80Pk7SB2MIytzAXfA2i" alt=""><figcaption></figcaption></figure>

### What types of content can be uploaded?

ARway supports the following content types:

* 3D models (.glb) with a file size limit of 10MB, 10K Polys
* Images (.png, .jpg, .jpeg) with a file size limit of 3MB
* Videos (.mp4) with a file size limit of 12MB
* Audio files (.mp3, .wav, .m4a, .ogg) with a file size limit of 3MB
* Floorplans (.png, .jpg, .jpeg) with a file size limit of 20MB

You can also add hotspots (hyperlinks) to your map for a more interactive experience.


# QR Codes

QR Code usage in the ARway platform

## What are QR code access points?

QR code access points are physical codes that are placed in specific locations within a space. These codes can be scanned by users with their mobile devices, which then direct them to a specific AR experience.

## Purpose of QR Codes

The ARway app allows users to enter an AR experience by scanning a QR code using their camera on their mobile device. Once the QR code is scanned the app retrieves the necessary map data and then initiates the positioning and re-localization process to accurately place AR content in the user’s environment.

QR code access points are a feature of the ARway platform that allow users to easily access augmented reality (AR) content using their mobile devices. With QR code access points, users can scan a code and open a ARway map AR experience in their space.

## How do QR code access points work?

When a user scans a QR code access point, it triggers the ARway platform to direct the user to a specific AR experience. This is done through the ARway app, which uses the mobile device's camera to scan the code and then directs the user to the appropriate content.

1. A QR code is generated for each ARway map, and it can be accessed in the Creator Portal by clicking on the map and selecting "QR code" in the menu.
2. The QR code can be downloaded as a PDF or PNG file and placed in a location where users can easily scan it (e.g., on a wall or sign).
3. When a user scans the QR code with their smartphone camera app, they will be directed to the ARway app if it is already installed. If the app is not installed, they will be taken to the app store to download it.
4. Once the app is opened, the user will be prompted to scan the access point to localize themselves on the map.


# Image Access Points (IAPs)

IAPs usage in the ARway platform

## What are Image Access Points?

Image Access Points (IAPs) utilize computer vision technology to recognize 2D images, activating an AR map experience linked to a specific location.

They are images found in the real-world that are used to activate the ARway maps.

## Purpose of Image Access Points

Image Access Points (IAPs) utilize computer vision technology to recognize 2D images, activating an AR map experience linked to a specific location.

These image access points fill the same role as QR codes on the platform. They allow users to scan an image in the real-world to activate the ARway maps.

## Best Practices

For Image Access Point mapping best practices, please refer to the following [document](https://www.arway.ai/_files/ugd/ee6c8e_76ed93f9be944f6fb2f6b88a5765eea9.pdf). Watch this video&#x20;


# Floorplans

How floorplans work with ARway

## What is the Floorplan Auto-Alignment feature?&#x20;

ARway's Floorplan auto-alignment feature allows users to easily align their digital content to the physical space using a 2D floorplan image. The feature scales and rotates the floorplan to ensure quick and accurate alignment. To align their floorplan using the ARway app, users are required to place six pegs in their space in AR.&#x20;

## How do I align my floorplan?&#x20;

Client can utilize the floorplan alignment tool to align their selected floorplan with the AR content. The steps for alignment are as follows: &#x20;

* User uploads a floorplan during map creation in the Maps Studio.
* In the app they will be prompted to align the floorplan.
* User will place the pegs in their space and match the positioning on a 2D floorplan.

## ​Where should I place the pegs?&#x20;

Make sure that the pegs are aligned correctly with your floorplan, if one peg is in the wrong spot it will cause issues with alignment. Place the pegs with the bottom of the tip being where it should be.&#x20;

## ​What are the best practices for floorplan alignment?&#x20;

* Use a JPG or PNG file for the floorplan image.&#x20;
* Place the 6 pegs in easily identifiable areas on the floorplan, within a 20-meter radius of the initial access point to minimize drift.&#x20;


# Using the Editor

Using the Creator Portal Studio to modify the ARway map

## Content Types

To anchor virtual content to your map, simply choose your content type from the top menu and use the editor controls to adjust its position, rotation, and scale. ARway supports the following file types for upload:

* 3D models (.glb) with a file size limit of 10MB
* Images (.png, .jpg, .jpeg) with a file size limit of 3MB
* Videos (.mp4) with a file size limit of 12MB
* Audio files (.mp3, .wav, .m4a, .ogg) with a file size limit of 3MB
* Floorplans (.png, .jpg, .jpeg) with a file size limit of 3MB

You can also add hotspots (hyperlinks) to your map for a more interactive experience.

## Images

To anchor virtual content to your map, select the content type from the top menu. To add images, select the "Image" option and choose from an existing recently uploaded image or upload a new image (.png, .jpg, .jpeg). Once created, position the image in the 3D environment with reference to your floor plan and mapping path for accurate placement.

<figure><img src="/files/zjwuwhBufTQHvCVYAtdC" alt=""><figcaption></figcaption></figure>

## Text

To anchor 3D text to your map, select the "Text" option from the left menu. Fill in the required fields for text and text color, and position the text in the 3D environment with reference to your floor plan and mapping path for accurate placement.

<figure><img src="/files/73Y7ao8Pr1RHoE3BBPXS" alt=""><figcaption></figcaption></figure>

## Audio

To anchor an audio note to your map, select the audio content type from the top menu and choose to upload your own audio file or add an existing audio clip. You can toggle on autoplay for the audio clip to trigger when a user is near the virtual prompt. Position the audio clip in the 3D environment with reference to your floor plan and mapping path for accurate placement.

<figure><img src="/files/Jwuf5zWvSN4hVMRHFdUf" alt=""><figcaption></figcaption></figure>

## Hotspot

To anchor a hotspot to your map, select the "Hotspot" from the top menu. Fill in the required text fields for title and description, and optionally add a hyperlink attached to your hotspot. Position the hotspot in the 3D environment with reference to your floor plan and mapping path for accurate placement.

<figure><img src="/files/wanE8caLJkljfroDlF7M" alt=""><figcaption></figcaption></figure>

## 3D Models

To anchor a 3D model to your map, simply select your desired model from the existing library or upload your own 3D model (.glb file format). Once added, transform, rotate, and scale the 3D model within the map as you’d like with reference to the floor plan and mapping path for accurate placement.

<figure><img src="/files/ooiWYBvO3ppu8HJhBTpp" alt=""><figcaption></figcaption></figure>

## Location Pins

Add your location pins in the creator portal by right-clicking on the space you want to place the pin. Create a name and description attached to your location pins to describe its whereabouts. Once added, the location pins can be viewed and interacted with in a dropdown menu for the end-user.

<figure><img src="/files/ufOg2ssO0H7AK8bix7Vo" alt=""><figcaption></figcaption></figure>

## Guided Tours

Create a guided tour in the creator portal and customize the experience with multi-color selection. Once created, the guided tour will appear on the spatial map for the end-user as a life-scale virtual pathway.

<figure><img src="/files/RAh2GERWahI5B1ROaxgU" alt=""><figcaption></figcaption></figure>

## Map Options

Users can save their progress or publish their map for others to scan using the "Save" or "Publish Map" button located at the top right. The "Scene Options" and "View Options" buttons in the bottom left allow the user to toggle the visibility of the map content and content types. On the bottom right, the three-axis indicator is used to show the current orientation of the camera viewing the map.


# Occlusion

Occlusion in the ARway app

From the map details page, you can modify your map settings such as the name, description, and thumbnail.​

<figure><img src="/files/l6Gy8EQ5gUmx1LGm1rdU" alt=""><figcaption></figcaption></figure>

When you scroll down to the map settings, you can also enable or disable the occlusion for the map from this page.​

* AR occlusion is the process of digitally blocking objects in augmented reality so that virtual objects appear to be realistically hidden behind real-world objects.​

<figure><img src="/files/spIcQzQYG2QY8VMBq5Qj" alt=""><figcaption></figcaption></figure>


# Analytics

View analytics on your map usage​

Gain valuable insights into how your maps are being viewed and where viewer interest lies, with location-based accuracy down to the centimeter. Use data analytics to inform meaningful improvements and curate new experiences.

Our analytic metrics include:

* Location: Track map visits within specific regions to measure engagement and target marketing efforts more effectively.
* Time: Identify the hours when map visits are highest to optimize user engagement.
* Content: Measure engagement across your digital map contents to create more engaging campaigns and improve user experience.


# Flutter

Introduction to using ARwayKit SDK with Flutter

## What is Flutter?

Flutter is Google’s UI toolkit for building beautiful, natively compiled applications for [mobile](https://flutter.dev/docs), [web](https://flutter.dev/web), and [desktop](https://flutter.dev/desktop) from a single codebase. The goal is to enable developers to deliver high-performance apps that feel natural on different platforms, embracing differences where they exist while sharing as much code as possible.

## Key Features:

* **Fast Development:** Flutter's *hot reload* helps you quickly and easily experiment, build UIs, add features, and fix bugs faster. Experience sub-second reload times without losing state on emulators, simulators, and hardware.
* **Expressive and Flexible UI:** Delight your users with Flutter's built-in beautiful Material Design and Cupertino (iOS-flavor) widgets, rich motion APIs, smooth natural scrolling, and platform awareness. The layered architecture allows for full customization, which results in incredibly fast rendering and expressive and flexible designs.
* **Native Performance:** Flutter’s widgets incorporate all critical platform differences such as scrolling, navigation, icons, and fonts, and your Flutter code is compiled to native ARM machine code using [Dart's native compilers](https://dart.dev/platforms).

## Why use ARwayKit with Flutter?

Using ARwayKit with Flutter allows the developers to use their existing Android/iOS apps built with Flutter and then integrate ARwayKit into it as a scene rather than rebuilding the app from the ground up in Unity.

This allows the app to have the power of Unity for creating amazing AR experiences, all without losing on the native performance and battery life you get with Flutter.

## **Components of ARwayKit SDK + Flutter:**

* **Flutter Project:** Your new/existing Flutter project used for the integration with ARwayKit Unity SDK.
* **ARway Maps Studio:** A one-stop place for creating and editing maps, adding floor plans for navigation along with overlaying 3D assets, waypoints, destinations, text, and pictures over it.
* **ARwayKit SDK:** Our Unity SDK for linking the AR experiences created here and adding them to the Flutter application as a page/scene.


# Quickstart in Flutter

Integrate the ARwayKit SDK with Flutter

In this quickstart guide, we will be integrating the ARwayKit SDK in the standard flutter app

## Installed Versions

In this guide, we will be using the following versions of Flutter, Dart, and Unity:

* **Flutter version:** 3.10.5
* **Dart version:** 3.0.5
* **Unity:** 2022.3.29f1 LST

## Download the ARwayKit SDK

**Steps**

1. Download the ARwayKit SDK project from GitHub as a **ZIP**. You can [contact us](https://www.arway.ai/contact) for access to the ARwayKit SDK.

## Creating a Blank Project in Flutter

If you have already created a Flutter project, you may skip the installation instructions and proceed with the next steps. Otherwise, kindly refer to the [Flutter documentation](https://docs.flutter.dev/) for installation guidelines.

```
flutter create my_project_name
```

## Configure the Flutter Project&#x20;

{% hint style="info" %}
We are using the **flutter\_unity\_widget** package to integrate our ARwayKit SDK with Flutter. <https://pub.dev/packages/flutter_unity_widget>
{% endhint %}

**Steps**

1. Open the `pubspec.yaml` file and add **flutter\_unity\_widget** to it under the *dependencies section.*

   ```yaml
   dependencies:
     flutter_unity_widget: ^2022.2.0
   ```

   * Now inside your Dart code you can import it.

     ```dart
     import 'package:flutter_unity_widget/flutter_unity_widget.dart';
     ```
2. After adding the dependencies, you need to fetch them into your Flutter project. \
   *You can fetch the dependencies by* -
   * From the terminal: Run `flutter pub get`\
     **OR**
   * From Android Studio/IntelliJ: Click **Packages get** in the action ribbon at the top of `pubspec.yaml`.
   * From VS Code: Click **Get Packages** located on the right side of the action ribbon at the top of `pubspec.yaml`.
3. Then add an import statement for using the package inside your Dart code.

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>We have created sample Dart files with unity pre-integrated to help you get started quickly with the project. The Dart files are located in the <strong>lib folder</strong> within the Flutter project.</p></div>

## Add the ARwayKit SDK to the Flutter Folder

**Steps:**

1. Download the Source code (zip) from the[ GitHub repo](https://github.com/arway-ai/ARwayKit-Unity-SDK/releases) (unity-viewer-sdk-3.1.4.zip).&#x20;
2. Extract the source code from the downloaded zip file by right-clicking on it and selecting "Extract All" or using a zip extraction tool of your choice.
3. In your Flutter app directory, create a new folder named "unity".

   * Move the extracted Unity project folder into the newly created "unity" folder. The expected path should be: `unity/unity-viewer-sdk-3.1.4/...`

   ```
   .
   ├── my_project_name
   │   └── .dart_tool
   │   └── .idea
   │   └── android
   │   └── ios
   │   └── lib
   │   └── linux
   │   └── macos
   │   └── test
   │   └── unity    // Create this folder
   │       └── <Your Unity Project>    // Example: unity-viewer-sdk-3.1.4
   │   └── web
   │   └── windows
   ```
4. Make sure you have the Unity editor version 2022.3.29f1  installed on your computer. If you don't have it, download and install it from the official Unity website.
5. Open the Unity editor and navigate to the "unity-viewer-sdk-3.1.4" folder by selecting "Open Project" from the Unity editor's file menu and choosing the appropriate folder.
6. Before opening the project, ensure that you have the required modules downloaded and installed for both Android and iOS builds. If you haven't already, download and install the following modules in the Unity Hub:
   * Android Build Support
   * OpenJDK
   * Android SDK & NDK Tools
   * iOS Build Support
7. Once you have the required modules installed, open the Unity project by selecting it from the Unity Hub or by double-clicking on the Unity project file in the "unity-viewer-sdk-3.1.4" folder.
8. After opening the project, the Unity editor will start importing the necessary files, and a new Unity editor window will open, displaying the project's contents.

## Update Addressables Groups & Set Account ID and Secret Key

### Getting the Account ID and Secret Key

1. From the ARway Creator Portal, go to "For Developers -> Create a New App -> Enter App Name".
2. Copy your **Account ID** and **SecretKey** for that App.

<figure><img src="/files/qlKyEyWiR7uymrKz8nTE" alt=""><figcaption><p>The "For Developers" page of the Creator Portal</p></figcaption></figure>

### **Adding the Account ID and Secret Key**

1. In the Project Window, go to "Assets -> ARway -> Viewer Mode -> Resource-> ARWayKitConfig " and add your credentials for the Account ID and Secret Key.

<figure><img src="/files/05QDigfNtEm4FxVlXnek" alt=""><figcaption><p>AR Way Kit Config</p></figcaption></figure>

### **Switch Build Platform to** Android or iOS.

1. "File -> Build Settings -> Build -> Select iOS/Android"

### **Updating the** Addressables Groups

1. Navigate to "Window -> Asset Management -> Addressable -> Groups".
2. In the Addressables Groups window, click on "Build -> New Build -> Default Build Script".

{% hint style="info" %}
When making any changes that affect localization strings, you will need to update the Addressables Groups.
{% endhint %}

## Configure the flutter\_unity\_widget Package

Configuring the [flutter\_unity\_widget](https://github.com/juicycleff/flutter-unity-view-widget) can be done by following the instructions in their README.md, or by following the steps outlined below.

{% hint style="info" %}
Make sure to add the Account ID and Secret Key variables to the Unity project. Follow the guide for [Integrating Unity Packages](/arway-sdk/quickstart-in-unity) for instructions.
{% endhint %}

**Steps**

1. Download the [*fuw-2022.2.0.unitypackage*](https://github.com/juicycleff/flutter-unity-view-widget/blob/master/unitypackages/fuw-2022.2.0.unitypackage) file and place it into the Unity project folder.
   * The expected path is `unity/unity-viewer-sdk-3.1.4/fuw-2022.2.0.unitypackage`
2. Using Unity, open the Unity project, go to **File -> Build Settings -> Player Settings -> Settings for Android -> Other Settings** and change the following under the **Configuration** section:
   * In **Scripting Backend**, change to IL2CPP
   * In **Target Architectures**, select ARMv7 and ARM64
3. **File -> Build Settings -> Player Settings -> Settings for iOS -> Other Settings** and change the following under the **Configuration** section:
   * In **Scripting Backend**, change to IL2CPP
   * In **Target Device**, choose iPhone Only
   * In **Target SDK**, choose Device SDK
4. After importing, click on **Flutter** and select the **Export Android Debug** or **Export Android Release** option (will export to *android/unityLibrary*) or the **Export iOS Debug** or **Export iOS Release** option (will export to *ios/UnityLibrary*).

{% hint style="info" %}
The "**Release**" export option is recommended due to optimizations.
{% endhint %}

To build for Android or iOS, follow the instructions below:

<details>

<summary><strong>Android</strong></summary>

6.1. Open the *android/settings.gradle* file and add the following:

```git
+    include ":unityLibrary"
+    project(":unityLibrary").projectDir = file("./unityLibrary")
+    include ':unityLibrary:xrmanifest.androidlib'
```

6.2. The minimum SDK version required for this app is 24. Open the *android/app/build.gradle* file and change the following:

```git
     android {
          defaultConfig {
+            minSdkVersion 24                                                                            
          }  
     }
     dependencies {
+        implementation project(':unityLibrary')
     }
```

6.3. If you need to build a release package, open the *android/app/build.gradle* file and change the following:

```git
     buildTypes {
         release {
             signingConfig signingConfigs.debug
         }
+        debug {
+            signingConfig signingConfigs.debug
+        }
+        profile {
+            signingConfig signingConfigs.debug
+        }
+        innerTest {
+            matchingFallbacks = ['debug', 'release']
+        }
+   }
```

The code above use the `debug` signConfig for all buildTypes, which can be changed as you well if you need specify signConfig.

6.4. **(Optional)** If you use `minifyEnabled true` in your *android/app/build.gradle* file, open the *android/unityLibrary/proguard-unity.txt* and change the following:

```git
+    -keep class com.xraph.plugin.** {*;}
```

6.5. Open the *android/unityLibrary/src/main/AndroidManifest.xml* and change the following:

<pre class="language-git"><code class="lang-git"><strong>-    &#x3C;provider android:name="androidx.core.content.FileProvider" android:authorities="com.arway.sdkviewer.unitywebview.fileprovider" android:exported="false" android:grantUriPermissions="true"> 
</strong>-        &#x3C;meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/unitywebview_file_provider_paths" /> 
-    &#x3C;/provider>
</code></pre>

6.6. **(Optional)** If you want Unity in it's own activity as an alternative, open the *android/unityLibrary/src/main/AndroidManifest.xml* and change the following:

```git
+    <activity
+        android:name="com.xraph.plugin.flutter_unity_widget.OverrideUnityActivity"
+        android:theme="@style/UnityThemeSelector"
+        android:screenOrientation="fullSensor"
+        android:launchMode="singleTask"
+        android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density"
+        android:hardwareAccelerated="false"
+        android:process=":Unity">
+    <meta-data android:name="com.xraph.plugin.flutter_unity_widget.OverrideUnityActivity" android:value="true" />
+    </activity>
```

</details>

<details>

<summary>iOS</summary>

6.1. Open the *ios/Runner.xcworkspace* (workspace, not the project) file in Xcode, right-click on the Navigator (not on an item), go to **Add Files to "Runner"** and add the *ios/UnityLibrary/Unity-Iphone.xcodeproj* file.

6.2. (Optional) Select the *Unity-iPhone/Data* folder and change the Target Membership for Data folder to UnityFramework.

6.3.1. If you're using Swift, open the *ios/Runner/AppDelegate.swift* file and change the following:

```git
     import UIKit
     import Fluttergit
+    import flutter_unity_widget
     @UIApplicationMain
     @objc class AppDelegate: FlutterAppDelegate {
         override func application(
             _ application: UIApplication,
             didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
         ) -> Bool {
+            InitUnityIntegrationWithOptions(argc: CommandLine.argc, argv: CommandLine.unsafeArgv, launchOptions)

             GeneratedPluginRegistrant.register(with: self)
             return super.application(application, didFinishLaunchingWithOptions: launchOptions)
         }
     }
```

6.3.2. If you're using Objective-C, open the *ios/Runner/main.m* file and change the following:

```git
+    #import "flutter_unity_widget.swift.h"

     int main(int argc, char * argv[]) {
          @autoreleasepool {
+             InitUnityIntegration(argc, argv);
              return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
          }
     }
```

6.4. Add the *UnityFramework.framework* file as a library to the Runner project

6.5 If you are using Xcode 14 or a newer version, and your Unity version is older than 2021.3.17f1 or 2022.2.2f1, there is a possibility that your app may crash when running from Xcode. To resolve this issue, you need to disable the Thread Performance Checker feature in Xcode. Follow these steps:

1. Open Xcode and navigate to Product > Scheme > Edit Scheme...
2. With the "Run" option selected on the left side, go to the Diagnostics tab.
3. Uncheck the checkbox for Thread Performance Checker.

6.6 Open the *ios/Runner/Info.plist* and change the following:

```git
     <dict>
+        <key>NSCameraUsageDescription</key> 
+        <string>Used for AR Content and mapping</string> 
+        <key>NSLocationWhenInUseUsageDescription</key> 
+        <string>Used to attach maps with global coordinates and public map searching</string> 
+        <key>NSMicrophoneUsageDescription</key> 
+        <string>Used for creating audio content</string> 
+        <key>NSPhotoLibraryAddUsageDescription</key> 
+        <string>The app requires access to Photos to save media to it.</string> 
+        <key>NSPhotoLibraryUsageDescription</key> 
+        <string>The app requires access to Photos to interact with it.</string> 
     </dict>
```

</details>

## Sample Dart Files

We have created sample Dart files to help you get started quickly with the project.

<details>

<summary>main.dart</summary>

<pre class="language-dart" data-title="main.dart" data-line-numbers><code class="lang-dart"><strong>import 'package:flutter/material.dart';
</strong>
import 'menu_screen.dart';
import 'arwaysdk_unity_screen.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'My Flutter App',
      theme: ThemeData.dark(),
      initialRoute: '/',
      routes: {
        '/': (context) => MenuScreen(),
        '/unity': (context) => ARwayKitUnityScreen(),
      },
    );
  }
}
</code></pre>

</details>

<details>

<summary>menu_screen.dart</summary>

{% code title="menu\_screen.dart" lineNumbers="true" %}

```dart
import 'package:flutter/material.dart';

class MenuScreen extends StatefulWidget {
  const MenuScreen({Key? key}) : super(key: key);

  @override
  // ignore: library_private_types_in_public_api
  _MenuScreenState createState() => _MenuScreenState();
}

class _MenuScreenState extends State<MenuScreen> {
  final String title = 'Open ARway SDK';
  final String route = '/unity';

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('ARwayKit Flutter Demo'),
      ),
      body: Center(
        child: Column(
          children: [
            const SizedBox(
              height: 32,
            ),
            const Padding(
              padding: EdgeInsets.all(30),
              child: Text(
                'Example scene to show how to link "ARwayKit SDK" scenes with '
                'Flutter.',
                style: TextStyle(
                  fontSize: 24,
                  letterSpacing: 2,
                  wordSpacing: 5,
                  fontStyle: FontStyle.italic,
                ),
              ),
            ),
            const SizedBox(
              height: 96,
            ),
            Padding(
              padding: const EdgeInsets.all(30),
              child: ElevatedButton(
                onPressed: () {
                  Navigator.of(context).pushNamed(route);
                },
                style: ElevatedButton.styleFrom(
                  elevation: 10,
                  primary: Color(0xFF1AB146),
                  minimumSize: Size(192, 64),
                ),
                child: Text(
                  title,
                  style: const TextStyle(
                    fontSize: 20,
                    fontWeight: FontWeight.bold,
                  ),
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
```

{% endcode %}

</details>

<details>

<summary>arwaysdk_unity_screen.dart</summary>

{% code title="arwaysdk\_unity\_screen.dart" lineNumbers="true" %}

```dart
import 'package:flutter/material.dart';
import 'package:flutter_unity_widget/flutter_unity_widget.dart';

class ARwayKitUnityScreen extends StatefulWidget {
  ARwayKitUnityScreen({Key? key}) : super(key: key);

  @override
  _ARwayKitUnityScreenState createState() => _ARwayKitUnityScreenState();
}

class _ARwayKitUnityScreenState extends State<ARwayKitUnityScreen> {
  static final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();

  late UnityWidgetController _unityWidgetController;

  @override
  void initState() {
    super.initState();
  }

  @override
  void dispose() {
    _unityWidgetController.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      key: _scaffoldKey,
      appBar: AppBar(
        title: const Text('Home'),
      ),
      body: Card(
        margin: const EdgeInsets.all(8),
        clipBehavior: Clip.antiAlias,
        shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.circular(20.0),
        ),
        child: Stack(
          children: [
            UnityWidget(
              onUnityCreated: _onUnityCreated,
              onUnityMessage: onUnityMessage,
              onUnitySceneLoaded: onUnitySceneLoaded,
              useAndroidViewSurface: true,
              borderRadius: const BorderRadius.all(Radius.circular(70)),
            ),
          ],
        ),
      ),
    );
  }

  void setRotationSpeed(String speed) {
    _unityWidgetController.postMessage(
      'Cube',
      'SetRotationSpeed',
      speed,
    );
  }

  void onUnityMessage(message) {
    print('Received message from unity: ${message.toString()}');
  }

  void onUnitySceneLoaded(SceneLoaded? scene) {
    print('Received scene loaded from unity: ${scene?.name}');
    print('Received scene loaded from unity buildIndex: ${scene?.buildIndex}');
  }

  // Callback that connects the created controller to the unity controller
  void _onUnityCreated(controller) {
    controller.resume();
    this._unityWidgetController = controller;
  }
}
```

{% endcode %}

</details>

### **How to use ARway SDK Scenes?**

For how to use the scenes in the **ARwayKit SDK**, kindly look at the documentation for those scenes linked below.

{% content-ref url="/pages/-MGJUzOuZB-mCUeqDWWJ" %}
[ARWAY SDK](/arway-sdk/getting-started)
{% endcontent-ref %}

## Build And Run:

Run the app on **Android** with the following command. For **iOS**, build an XCode project to deploy it to an iOS device from the IDE of your choice.

```bash
flutter run
```

{% hint style="info" %}
The application must be run on a real device rather than an emulator.
{% endhint %}

## Extras:

Here are some extra methods and APIs which you can implement to communicate to and from Unity using Flutter.&#x20;

### **Props**&#x20;

* `fullscreen` (Enable or disable fullscreen mode on Android)
* `disableUnload` (Disable unload on iOS when unload is called)

### API&#x20;

* `pause()` (Use this to pause unity player)
* `resume()` (Use this to resume unity player)
* `unload()` (Use this to unload unity player)
* `quit()` (Use this to quit unity player)
* `postMessage(String gameObject, methodName, message)` (Allows you invoke commands in Unity from flutter)
* `onUnityMessage(data)` (Unity to flutter binding and listener)
* `onUnityUnloaded()` (Unity to flutter listener when unity is unloaded)
* `onUnitySceneLoaded(String name, int buildIndex, bool isLoaded, bool isValid,)` (Unity to flutter binding and listener when a new scene is loaded)

{% hint style="info" %}
To see more details, check out the package's official documentation linked below.&#x20;

<https://pub.dev/documentation/flutter_unity_widget/latest/>
{% endhint %}


# React Native

Introduction to using ARwayKit SDK with React Native

## What is React Native?

React Native is Meta’s best parts of native development with React, a best-in-class JavaScript library for building user interface. The goal is to enable developers to deliver high-performance apps that feel natural on different platforms, embracing differences where they exist while sharing as much code as possible.

## Key Features:

* **Native Development Made Accessible:** React Native enables developers to create truly native apps without compromising on user experience. It offers a set of core platform-agnostic native components, such as View, Text, and Image, that map directly to the building blocks of the platform's native UI.
* **Seamless Cross-Platform Development:** React components wrap existing native code and interact with native APIs using React's declarative UI paradigm and JavaScript. This allows new teams of developers to build native apps and enables existing native teams to work faster.
* **Fast Refresh for Rapid Iteration:** With React Native, you can see changes to your app as soon as you save, thanks to the power of JavaScript. This means you can iterate quickly and efficiently without waiting for native builds to finish. Just save, see, and repeat.

## Why use ARwayKit with React Native?

Using ARwayKit with React Native allows the developers to use their existing Android/iOS apps and then integrate ARwayKit into it as a scene rather than rebuilding the app from the ground up in Unity.

## **Components of ARwayKit SDK + React Native:**

* **React Native:** Your new/existing React Native project used for the integration with ARwayKit Unity SDK.
* **ARway Maps Studio:** A one-stop place for creating and editing maps, adding floor plans for navigation along with overlaying 3D assets, waypoints, destinations, text, and pictures over it.
* **ARwayKit SDK:** Our Unity SDK for linking the AR experiences created here and adding them to the Flutter application as a page/scene.


# Quickstart in React Native

Integrate the ARwayKit SDK with React Native

In this quickstart guide, we will be integrating the ARwayKit SDK in React Native with the CLI.

## Installed Versions

In this guide, we will be using the following versions of React, React Native, and Unity:

* **React version:** 18.2.0
* **React-Native:** 0.71.4
* **Unity:** 2022.3.29f1 LST
* **Packages:** [@azesmway/react-native-unity@0.4.0](https://www.npmjs.com/package/@azesmway/react-native-unity)

## Download the ARwayKit SDK

**Steps**

1. Download the ARwayKit SDK project from GitHub as a **ZIP**. You can [contact us](https://www.arway.ai/contact) for access to the ARwayKit SDK.

## Build the Project in Unity

Before adding the sample app to React Native, make sure to follow the guide [Building from the Source Code](/arway-sdk/building-from-the-source-code) first to get your Unity environment ready.

{% hint style="info" %}
Make sure to add the Account ID and Secret Key variables to the Unity project. Follow the guide for [Building from the Source Code](/arway-sdk/building-from-the-source-code) for instructions.
{% endhint %}

## Adding Folder from react-native-unity

To communicate between React Native and the Unity layer, you will need to copy the ["Plugins"](https://github.com/azesmway/react-native-unity/tree/main/unity/Assets) folder from the [react-native-unity](https://www.npmjs.com/package/@azesmway/react-native-unity) package repo and paste it into the ARwayKit SDK "Assets" folder.&#x20;

After copying the folder, your project will appear as below with the nested "NativeCallProxy" files.

```
.
├── unity-viewer-sdk-3.1.4
│   └── Assets
│       └── Plugins
│           └── iOS
│               └── NativeCallProxy.h
│               └── NativeCallProxy.mm
│   └── Library
│   └── Logs
│   └── Packages
│   └── Project Settings
│   └── UserSettings
```

## Creating a Blank Project in React Native

If you have already created a React Native project, you may skip the installation instructions and proceed with the next steps. Otherwise, kindly refer to the [React Native documentation](https://reactnative.dev/docs/environment-setup) for installation guidelines using the "React Native CLI".

## Configuration

### React Native Package

In this project, the package [@azesmway/react-native-unity](https://www.npmjs.com/package/@azesmway/react-native-unity) will be used to embed the Unity SDK into React Native.

Add the following package to the React Native project:&#x20;

```bash
npm install @azesmway/react-native-unity@0.4.0
```

### Configuring Unity

The default configuration expects the Unity SDK to be in the following position in the React Native app. Move the Unity project into the below location in the React Native folder. You will need to create the folder "unity" and then paste the Unity project inside.

```
.
├── node_modules
├── unity
│   └── <Your Unity Project>    // Example: unity-viewer-sdk-3.1.4
├── App.tsx
├── app.json
├── babel.config.js
├── package.json
└── README.md
```

### Android

1. Export Unity app to `[project_root]/unity/builds/android`
   * Go to "File -> Build Settings" and change the platform to Android and make sure that "Export Project" is checked.

2. Add the following lines to `android/settings.gradle`:

   <pre class="language-git"><code class="lang-git">+ include ':unityLibrary'
   <strong>+ project(':unityLibrary').projectDir=new File('..\\unity\\builds\\android\\unityLibrary')
   </strong></code></pre>

3. Add into `android/build.gradle`

   <pre class="language-git"><code class="lang-git">allprojects {
     repositories {
   +   flatDir {
   +     dirs "${project(':unityLibrary').projectDir}/libs"
   +   }
     }
   <strong>}
   </strong></code></pre>

4. Add into `android/gradle.properties`

   ```git
   + unityStreamingAssets=.unity3d
   ```

5. Add strings to `android/app/src/main/res/values/strings.xml`

   ```git
   + <string name="game_view_content_description">Game view</string>
   ```

6. Remove `<intent-filter>...</intent-filter>` from `<project_name>/unity/builds/android/unityLibrary/src/main/AndroidManifest.xml` to leave only integrated version.

7. Copy the file `[project_root]/unity/builds/android/local.properties`to the folder `[project_root]/android/`

8. Ensure that the minSdkVersion in `android/build.gradle` matches the minimum API level set in the ARwayKit Unity SDK. By default, the minimum is 24.

9. Change the following line in `unity\builds\android\unityLibrary\src\main\AndroidManifest.xml`.&#x20;

```git
- <provider android:name="androidx.core.content.FileProvider" android:authorities="com.arway.sdkviewer.unitywebview.fileprovider" android:exported="false" android:grantUriPermissions="true">
+ <provider android:name="androidx.core.content.FileProvider" android:authorities="com.reactnativearwaysdk.fileprovider" android:exported="false" android:grantUriPermissions="true">

```

{% hint style="info" %}
In the code above,`com.arway.sdkviewer.unitywebview` is replaced with `com.reactnativearwaysdk.` The new package name should match the namespace of your React Native package which can be found in the`android/app/build.gradle`
{% endhint %}

### iOS

1. Build the ARwayKit SDK from Unity `File -> Build Settings -> Change Platform to iOS -> click Build on the bottom` to the following folder in the React Native app `[project_root]/unity/builds/ios`
2. After building the project, make sure that the pods are installed.
   * Go to your React Native folder, then go to ios then type `pod install`
3. Add `Unity-iPhone.xcodeproj` to your XCode: press the right mouse button in the Left Navigator XCode -> `Add Files to [project_name]...` -> `[project_root]/unity/builds/ios/Unity-iPhone.xcodeproj`
4. Add `UnityFramework.framework` to `General` / section `Frameworks, Libraries, and Embedded Content`
5. Select Data folder and set a checkbox in the "Target Membership" section to "UnityFramework"
6. You need to select the NativeCallProxy.h inside the `Unity-iPhone/Libraries/Plugins/iOS` folder of the Unity-iPhone project and change UnityFramework’s target membership from Project to Public.
   * This is required for the communication between React Native and Unity.
7. In `Build Phases` remove UnityFramework.framework from `Linked Binary With Libraries`
8. In Build Phases move Embedded Frameworks before Compile Sources ( drag and drop )
9. In the React Native project, open the `ios/{APP_NAME}/Info.plist` and change the following key and string value to the \<dict> to request authorization to the camera:

   ```git
        <dict>
   +        <key>NSCameraUsageDescription</key> 
   +        <string>Used for AR Content and mapping</string> 
   +        <key>NSLocationWhenInUseUsageDescription</key> 
   +        <string>Used to attach maps with global coordinates and public map searching</string> 
   +        <key>NSMicrophoneUsageDescription</key> 
   +        <string>Used for creating audio content</string> 
   +        <key>NSPhotoLibraryAddUsageDescription</key> 
   +        <string>The app requires access to Photos to save media to it.</string> 
   +        <key>NSPhotoLibraryUsageDescription</key> 
   +        <string>The app requires access to Photos to interact with it.</string> 
        </dict>
   ```

## Sample Code

Sample code to get started in React Native.

{% code title="App.tsx" %}

```tsx
import React, {useRef, useEffect} from 'react';
import {View} from 'react-native';
import UnityView from '@azesmway/react-native-unity';
 
interface IMessage {
  gameObject: string;
  methodName: string;
  message: string;
}
 
const Unity = () => {
  const unityRef = useRef();
  const message: IMessage = {
    gameObject: 'GameObject',
    methodName: 'MessageRN',
    message: 'Send a message to Unity',
  };
 
  useEffect(() => {
    setTimeout(() => {
      if (unityRef && unityRef.current) {
        // @ts-ignore
        unityRef.current.postMessage(
          message.gameObject,
          message.methodName,
          message.message,
        );
      }
    }, 6000);
  }, []);
 
  return (
    <View style={{flex: 1}}>
     <UnityView
        // @ts-ignore
        ref={unityRef}
        style={{flex: 1}}
        onUnityMessage={result =>
          console.log('onUnityMessage', result.nativeEvent.message)
        }
      />
    </View>
  );
};
 
export default Unity;
```

{% endcode %}

## Extras:

Here are some extra methods and APIs which you can implement to communicate to and from Unity.

**OnEvent in Unity**

Add this code to the ARwayKit Unity SDK:

```csharp
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using UnityEngine.UI;
using UnityEngine;

public class NativeAPI {
#if UNITY_IOS && !UNITY_EDITOR
  [DllImport("__Internal")]
  public static extern void sendMessageToMobileApp(string message);
#endif
}

public class ButtonBehavior : MonoBehaviour
{
  public void ButtonPressed()
  {
    if (Application.platform == RuntimePlatform.Android)
    {
      using (AndroidJavaClass jc = new AndroidJavaClass("com.azesmwayreactnativeunity.ReactNativeUnityViewManager"))
      {
        jc.CallStatic("sendMessageToMobileApp", "The button has been tapped!");
      }
    }
    else if (Application.platform == RuntimePlatform.IPhonePlayer)
    {
#if UNITY_IOS && !UNITY_EDITOR
      NativeAPI.sendMessageToMobileApp("The button has been tapped!");
#endif
    }
  }
}
```


# Android Kotlin

Introduction to using ARwayKit SDK with Android Kotlin

## What is Android Kotlin?

Android Kotlin is a programming language that enables developers to build native Android apps using the Kotlin programming language. Kotlin is a modern language that offers concise syntax and a range of powerful features that make it easier to build high-performance, feature-rich Android apps.

## Key Features:&#x20;

* **Conciseness and Readability:** Kotlin is designed to be more concise and readable than Java, which makes it easier to write and maintain code. It also has better support for null safety, which helps to reduce errors in the code.
* **Interoperability:** Kotlin can be used alongside Java code in Android applications, which allows developers to use Kotlin where it makes sense without having to rewrite everything in a new language. Kotlin also supports many of the same libraries and tools as Java.
* **Coroutines:** Kotlin's coroutines allow for asynchronous programming in a simpler and more intuitive way than traditional callback-based approaches. They provide better control over concurrency and allow for more efficient use of resources.

## Why use ARwayKit with Android Kotlin?&#x20;

Using ARwayKit with Android Kotlin allows developers to integrate ARwayKit into their existing Android apps, without having to rebuild the app from the ground up in Unity. This saves time and effort, and enables developers to leverage the power of ARwayKit to create engaging, interactive AR experiences for their users.

## **Components of ARwayKit SDK + Kotlin:**

* **Android Kotlin:** Your new/existing project used for the integration with ARwayKit Unity SDK.
* **ARway Maps Studio:** A one-stop place for creating and editing maps, adding floor plans for navigation along with overlaying 3D assets, waypoints, destinations, text, and pictures over it.
* **ARwayKit SDK:** Our Unity SDK for linking the AR experiences created here and adding them to the Android application as a page/scene.


# Quickstart in Android Kotlin

Integrate the ARwayKit SDK with Android Kotlin

In this quickstart guide, we will be integrating the ARwayKit SDK with Android Kotlin. This example will be using [Unity as a Library](https://github.com/Unity-Technologies/uaal-example/blob/uaal-example/19LTS-21LTS/docs/android.md) to integrate into an Android app.

## Installed Versions

In this guide, we will be using the following versions:

* Android Studio: 2022.1.1
* Unity: 2022.3.29f1 LST
* Android Min API Level 24

## Download the ARwayKit SDK

**Steps**

1. Download the ARwayKit SDK project from GitHub as a **ZIP**. You can [contact us](https://www.arway.ai/contact) for access to the ARwayKit SDK.

## Create a Basic Project in Android Studio

Create a new sample Android Project, for this example a new project using the Empty Activity template will be used with the language set to Kotlin and the minimum SDK set to API 24.

## Generate the Gradle Project for the Android Platform

{% hint style="info" %}
Make sure to add the Account ID and Secret Key variables to the Unity project. Follow the guide for [Building from the Source Code](/arway-sdk/building-from-the-source-code) for instructions.
{% endhint %}

{% hint style="info" %}
The package name in the Unity Editor will need to match the package name of the Kotlin app.
{% endhint %}

## **Build Steps**

1. In Unity select File -> Build Settings.
2. Switch the Platform to Android.
3. Select option "Export Project".<br>

   <figure><img src="/files/HDOHhbtECSmsj2LR7VoX" alt=""><figcaption><p>Export the project.</p></figcaption></figure>
4. Export the ARwayKit Unity SDK to a new folder and name it "androidBuild" and place it in the base directory for the Android Kotlin project.

### Add the Unity Android Build to the Android App

**Steps**

1. Open the Android sample app in Android Studio.
2. Open the `settings.gradle` file and make the following changes to the code as shown below. Ensure that the line `'androidBuild\\unityLibrary'` matches the path to the ARwayKit Unity SDK export.

   ```git
   + include ':unityLibrary'
   + project(':unityLibrary').projectDir=new File('androidBuild\\unityLibrary')
   + include ':unityLibrary:xrmanifest.androidlib'
   dependencyResolutionManagement {
       repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
       repositories {
           google()
           mavenCentral()
   +       flatDir {
   +            dirs "${project(':unityLibrary').projectDir}/libs"
   +       }
       }
   }
   ```
3. Open `build.gradle`(Module: app) file, then add the following in the dependencies block.

   <pre class="language-git"><code class="lang-git">dependencies {
   ...
   <strong>+    implementation project(':unityLibrary')
   </strong>+    implementation fileTree(dir: project(':unityLibrary').getProjectDir().toString() + ('\\libs'), include: ['*.jar'])
   }
   </code></pre>
4. Open `gradle.properties` and add the code below to the end of the file.

   <pre class="language-git"><code class="lang-git"><strong>+ unityStreamingAssets=.unity3d
   </strong></code></pre>
5. In the file /app/src/main/AndroidManifest.xml add `tools:replace="android:allowBackup"` to line 6.

   <pre class="language-git"><code class="lang-git">&#x3C;?xml version="1.0" encoding="utf-8"?>
   &#x3C;manifest xmlns:android="http://schemas.android.com/apk/res/android"
       xmlns:tools="http://schemas.android.com/tools">

       &#x3C;application
   <strong>++      tools:replace="android:allowBackup"
   </strong>        android:allowBackup="true"
           android:dataExtractionRules="@xml/data_extraction_rules"
           android:fullBackupContent="@xml/backup_rules"
   </code></pre>
6. You will be notified that changes have been made to the grade files, click the 'Sync Now' button to continue.&#x20;

   <figure><img src="/files/zJDAMDpyBuJImmZoIT7C" alt=""><figcaption><p>Sync the gradle files.</p></figcaption></figure>
7. If everything succeeds you should be able to see the unityLibrary module added in the Android view.

### Preparing the Sample Project

To run the ARwayKit Unity SDK on Android, we need to integrate Unity as a library in our Android project. This will allow us to use the Unity engine within our app and run Unity scenes alongside native Android activities. In this section, we will go through the steps to set up Unity as a library and add the ARwayKit Unity SDK to the project.

1. For this we will be creating a **new** blank Activity in the project called `MainUnityActiviy`. Make sure the generate the layout file as well.

{% code title="MainUnityActiviy" %}

```kotlin
import android.content.Intent
import android.os.Bundle
import android.widget.Button
import android.widget.FrameLayout
import com.unity3d.player.UnityPlayerActivity;

open class MainUnityActivity : UnityPlayerActivity() {
    private var instance: MainUnityActivity? = null

    // Setup activity layout
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        instance = this;
        addControlsToUnityFrame()
        val intent: Intent = intent
        handleIntent(intent)
    }

    override fun onDestroy() {
        super.onDestroy()
        instance = null
    }

    override fun onNewIntent(intent: Intent?) {
        super.onNewIntent(intent)
        handleIntent(intent)
        setIntent(intent)
    }

    private fun handleIntent(intent: Intent?) {
        if (intent == null || intent.extras == null) return
        if (intent.extras!!.containsKey("doQuit")) if (mUnityPlayer != null) {
            finish()
        }
    }

    private fun showMainActivity() {
        val intent: Intent = Intent(this, MainActivity::class.java)
        intent.flags = Intent.FLAG_ACTIVITY_REORDER_TO_FRONT or Intent.FLAG_ACTIVITY_SINGLE_TOP
        startActivity(intent)
    }

    override fun onUnityPlayerUnloaded() {
        showMainActivity()
    }

    private fun addControlsToUnityFrame() {
        val layout: FrameLayout = mUnityPlayer
        run {
            val myButton = Button(this)
            myButton.text = "Show Main"
            myButton.x = 10f
            myButton.y = 500f
            myButton.setOnClickListener { showMainActivity() }
            layout.addView(myButton, 300, 200)
        }

        run {
            val myButton = Button(this)
            myButton.text = "Unload"
            myButton.x = 630f
            myButton.y = 500f
            myButton.setOnClickListener { mUnityPlayer.unload() }
            layout.addView(myButton, 300, 200)
        }
    }
}
```

{% endcode %}

In the above file, the `addControlsToUnityFrame()` method sets the positions of the buttons added to the layout. These buttons are not required but showcase the methods to unload the Unity player.

To pass data to Unity, you can call the following method:

```
mUnityPlayer.UnitySendMessage("<GameObject>", "<Method>",<string value>);
```

2. The `MainActivity.kt` file will be modified to add a button to load the activity above. The code below shows the end result.

{% code title="MainActivity.kt" %}

```kotlin
import android.content.Intent
import android.os.Bundle
import android.view.View
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity


class MainActivity : AppCompatActivity() {
    private var isUnityLoaded = false

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        handleIntent(intent)
    }

    override fun onNewIntent(intent: Intent?) {
        super.onNewIntent(intent)
        handleIntent(intent)
        setIntent(intent)
    }

    private fun handleIntent(intent: Intent?) {
        if (intent?.extras == null) return
    }

    fun btnLoadUnity(v: View?) {
        isUnityLoaded = true
        val intent = Intent(this, MainUnityActivity::class.java)
        intent.flags = Intent.FLAG_ACTIVITY_REORDER_TO_FRONT
        startActivityForResult(intent, 1)
    }

    override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
        super.onActivityResult(requestCode, resultCode, data)
        if (requestCode == 1) isUnityLoaded = false
    }

    private fun unloadUnity(doShowToast: Boolean) {
        if (isUnityLoaded) {
            val intent = Intent(this, MainUnityActivity::class.java)
            intent.flags = Intent.FLAG_ACTIVITY_REORDER_TO_FRONT
            intent.putExtra("doQuit", true)
            startActivity(intent)
            isUnityLoaded = false
        } else if (doShowToast) showToast("Show Unity First")
    }

    fun btnUnloadUnity(v: View?) {
        unloadUnity(true)
    }

    private fun showToast(message: String) {
        val text: CharSequence = message
        val duration = Toast.LENGTH_SHORT
        val toast = Toast.makeText(applicationContext, text, duration)
        toast.show()
    }

    override fun onBackPressed() {
        finishAffinity()
    }
}
```

{% endcode %}

3. Next, find the newly created layout file under `src/main/res/layout` called `activity_main_unity.xml`. This adds the buttons to open the Unity activity and close the app.

{% code title="activity\_main\_unity.xml" %}

```xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:showIn="@layout/activity_main"
    tools:context=".MainActivity">

    <Button
        android:id="@+id/button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="24dp"
        android:layout_marginTop="16dp"
        android:layout_marginEnd="36dp"
        android:onClick="btnLoadUnity"
        android:text="Show Unity"
        app:layout_constraintEnd_toStartOf="@+id/button2"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <Button
        android:id="@+id/button2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="16dp"
        android:layout_marginTop="16dp"
        android:onClick="btnUnloadUnity"
        android:text="Finish"
        app:layout_constraintStart_toEndOf="@+id/button"
        app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
```

{% endcode %}

4. Modify the layout code of the default file `activity_main.xml` to load the `activity_main_unity.xml` file from above.

{% code title="activity\_main.xml" %}

```xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <include layout="@layout/activity_main_unity" />

</androidx.constraintlayout.widget.ConstraintLayout>
```

{% endcode %}

5. Then add a new string resource with the name `game_view_content_description`and the content `Game view` in the `strings.xml` file.

<pre class="language-git"><code class="lang-git">&#x3C;resources>
<strong>+    &#x3C;string name="game_view_content_description">Game view&#x3C;/string>
</strong>&#x3C;/resources>
</code></pre>

Once you have completed all the necessary steps to integrate the ARwayKit Unity SDK into your Android Kotlin project, you are ready to build, run, and debug your app. If everything has been properly configured, you should be able to run the app seamlessly with the ARwayKit Unity SDK.

Unity will run in another process android:process=":Unity" (AndroidManifest.xml at app module).

{% hint style="info" %}
Additional information about integrating Unity as a library into a standard Android app can be found in the following links:&#x20;

<https://github.com/Unity-Technologies/uaal-example/blob/uaal-example/19LTS-21LTS/docs/android.md>

<https://docs.unity3d.com/2019.3/Documentation/Manual/UnityasaLibrary.html>
{% endhint %}


# Android Java

Introduction to using ARwayKit SDK with Android Java

## What is Android Java?

Android Java is a programming language that enables developers to build native Android apps using the Java programming language. Java is a widely-used language that offers a comprehensive set of features and libraries, making it easier to develop high-performance, feature-rich Android applications.

## Key Features:&#x20;

* **Conciseness and Readability:** Java is designed to be concise and readable, allowing developers to write and maintain code more easily. It also provides support for null safety, reducing the chances of errors in the code.
* **Interoperability:** ava can be seamlessly used alongside other Java code in Android applications. This allows developers to integrate Java into their projects without the need for rewriting everything in a different language. Java also supports a wide range of libraries and tools.
* Threa**ds and Concurrency:** Java provides robust support for multi-threading and concurrency, allowing developers to create asynchronous programs efficiently. It offers various mechanisms, such as threads and synchronization, to control concurrent execution and resource management.

## Why use ARwayKit with Android Java?&#x20;

Using ARwayKit with Android Java enables developers to incorporate ARwayKit into their existing Android applications without rebuilding the app from scratch in Unity. This saves time and effort, empowering developers to harness the capabilities of ARwayKit and create captivating, interactive AR experiences for their users.

## **Components of ARwayKit SDK +** Jav&#x61;**:**

* **Android Java:** Your new/existing project used for the integration with ARwayKit Unity SDK.
* **ARway Maps Studio:** A one-stop place for creating and editing maps, adding floor plans for navigation along with overlaying 3D assets, waypoints, destinations, text, and pictures over it.
* **ARwayKit SDK:** Our Unity SDK for linking the AR experiences created here and adding them to the Android application as a page/scene.


# Quickstart in Android Java

Integrate the ARwayKit SDK with Android Java

In this quickstart guide, we will be integrating the ARwayKit SDK with Android Java. This example will be using [Unity as a Library](https://github.com/Unity-Technologies/uaal-example/blob/uaal-example/19LTS-21LTS/docs/android.md) to integrate into an Android app.

## Installed Versions

In this guide, we will be using the following versions:

* Android Studio: 2022.1.1
* Unity: 2022.3.29f1 LST
* Android Min API Level 24

## Download the ARwayKit SDK

**Steps**

1. Download the ARwayKit SDK project from GitHub as a **ZIP**. You can [contact us](https://www.arway.ai/contact) for access to the ARwayKit SDK.

## Create a Basic Project in Android Studio

Create a new sample Android Project, for this example a new project using the Empty Activity template will be used with the language set to Java and the minimum SDK set to API 24.

## Generate the Gradle Project for the Android Platform

{% hint style="info" %}
Make sure to add the Account ID and Secret Key variables to the Unity project. Follow the guide for [Building from the Source Code](/arway-sdk/building-from-the-source-code) for instructions.
{% endhint %}

{% hint style="info" %}
The package name in the Unity Editor will need to match the package name of the Kotlin app.
{% endhint %}

## **Build Steps**

1. In Unity select File -> Build Settings.
2. Switch the Platform to Android.
3. Select option "Export Project".<br>

   <figure><img src="/files/HDOHhbtECSmsj2LR7VoX" alt=""><figcaption><p>Export the project.</p></figcaption></figure>
4. Export the ARwayKit Unity SDK to a new folder and name it "androidBuild" and place it in the base directory for the Android Java project.

### Add the Unity Android Build to the Android App

**Steps**

1. Open the Android sample app in Android Studio.
2. Open the `settings.gradle` file and make the following changes to the code as shown below. Ensure that the line `'androidBuild\\unityLibrary'` matches the path to the ARwayKit Unity SDK export.

   ```git
   + include ':unityLibrary'
   + project(':unityLibrary').projectDir=new File('androidBuild\\unityLibrary')
   + include ':unityLibrary:xrmanifest.androidlib'
   dependencyResolutionManagement {
       repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
       repositories {
           google()
           mavenCentral()
   +       flatDir {
   +            dirs "${project(':unityLibrary').projectDir}/libs"
   +       }
       }
   }
   ```
3. Open `build.gradle`(Module: app) file, then add the following in the dependencies block.

   <pre class="language-git"><code class="lang-git">dependencies {
   ...
   <strong>+    implementation project(':unityLibrary')
   </strong>+    implementation fileTree(dir: project(':unityLibrary').getProjectDir().toString() + ('\\libs'), include: ['*.jar'])
   }
   </code></pre>
4. Open `gradle.properties` and add the code below to the end of the file.

   <pre class="language-git"><code class="lang-git"><strong>+ unityStreamingAssets=.unity3d
   </strong></code></pre>
5. In the file /app/src/main/AndroidManifest.xml add `tools:replace="android:allowBackup"` to line 6.

   <pre class="language-git"><code class="lang-git">&#x3C;?xml version="1.0" encoding="utf-8"?>
   &#x3C;manifest xmlns:android="http://schemas.android.com/apk/res/android"
       xmlns:tools="http://schemas.android.com/tools">

       &#x3C;application
   <strong>++      tools:replace="android:allowBackup"
   </strong>        android:allowBackup="true"
           android:dataExtractionRules="@xml/data_extraction_rules"
           android:fullBackupContent="@xml/backup_rules"
   </code></pre>
6. You will be notified that changes have been made to the grade files, click the 'Sync Now' button to continue.&#x20;

<figure><img src="/files/zJDAMDpyBuJImmZoIT7C" alt=""><figcaption><p>Sync the gradle files.</p></figcaption></figure>

7. If everything succeeds you should be able to see the unityLibrary module added in the Android view.

## Preparing the Sample Project

To run the ARwayKit Unity SDK on Android, we need to integrate Unity as a library in our Android project. This will allow us to use the Unity engine within our app and run Unity scenes alongside native Android activities. In this section, we will go through the steps to set up Unity as a library and add the ARwayKit Unity SDK to the project.

1. For this we will be creating a **new** blank Activity in the project called `MainUnityActiviy`. Make sure the generate the layout file as well.

{% code title="MainUnityActiviy" %}

```kotlin
import android.content.Intent;
import android.os.Bundle;
import android.widget.Button;
import android.widget.FrameLayout;
import com.unity3d.player.UnityPlayerActivity;

public class MainUnityActivity extends UnityPlayerActivity {
    private MainUnityActivity instance;

    // Setup activity layout
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        instance = this;
        addControlsToUnityFrame();
        Intent intent = getIntent();
        handleIntent(intent);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        instance = null;
    }

    @Override
    protected void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
        handleIntent(intent);
        setIntent(intent);
    }

    private void handleIntent(Intent intent) {
        if (intent == null || intent.getExtras() == null) return;
        if (intent.getExtras().containsKey("doQuit")) {
            if (mUnityPlayer != null) {
                finish();
            }
        }
    }

    private void showMainActivity() {
        Intent intent = new Intent(this, MainActivity.class);
        intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_SINGLE_TOP);
        startActivity(intent);
    }

    @Override
    public void onUnityPlayerUnloaded() {
        showMainActivity();
    }

    private void addControlsToUnityFrame() {
        FrameLayout layout = mUnityPlayer;

        Button myButton = new Button(this);
        myButton.setText("Show Main");
        myButton.setX(10f);
        myButton.setY(500f);
        myButton.setOnClickListener(v -> showMainActivity());
        layout.addView(myButton, 300, 200);

        Button unloadButton = new Button(this);
        unloadButton.setText("Unload");
        unloadButton.setX(630f);
        unloadButton.setY(500f);
        unloadButton.setOnClickListener(v -> mUnityPlayer.unload());
        layout.addView(unloadButton, 300, 200);
    }
}
```

{% endcode %}

In the above file, the `addControlsToUnityFrame()` method sets the positions of the buttons added to the layout. These buttons are not required but showcase the methods to unload the Unity player.

To pass data to Unity, you can call the following method:

```
mUnityPlayer.UnitySendMessage("<GameObject>", "<Method>",<string value>);
```

2. The `MainActivity` file will be modified to add a button to load the activity above. The code below shows the end result.

{% code title="MainActivity" %}

```kotlin
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {
    private boolean isUnityLoaded = false;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        handleIntent(getIntent());
    }

    @Override
    protected void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
        handleIntent(intent);
        setIntent(intent);
    }

    private void handleIntent(Intent intent) {
        if (intent.getExtras() == null) return;
    }

    public void btnLoadUnity(View v) {
        isUnityLoaded = true;
        Intent intent = new Intent(this, MainUnityActivity.class);
        intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
        startActivityForResult(intent, 1);
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (requestCode == 1) isUnityLoaded = false;
    }

    private void unloadUnity(boolean doShowToast) {
        if (isUnityLoaded) {
            Intent intent = new Intent(this, MainUnityActivity.class);
            intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
            intent.putExtra("doQuit", true);
            startActivity(intent);
            isUnityLoaded = false;
        } else if (doShowToast) showToast("Show Unity First");
    }

    public void btnUnloadUnity(View v) {
        unloadUnity(true);
    }

    private void showToast(String message) {
        CharSequence text = message;
        int duration = Toast.LENGTH_SHORT;
        Toast toast = Toast.makeText(getApplicationContext(), text, duration);
        toast.show();
    }

    @Override
    public void onBackPressed() {
        finishAffinity();
    }
}
```

{% endcode %}

3. Next, find the newly created layout file under `src/main/res/layout` called `activity_main_unity.xml`. This adds the buttons to open the Unity activity and close the app.

{% code title="activity\_main\_unity.xml" %}

```xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:showIn="@layout/activity_main"
    tools:context=".MainActivity">

    <Button
        android:id="@+id/button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="24dp"
        android:layout_marginTop="16dp"
        android:layout_marginEnd="36dp"
        android:onClick="btnLoadUnity"
        android:text="Show Unity"
        app:layout_constraintEnd_toStartOf="@+id/button2"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <Button
        android:id="@+id/button2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="16dp"
        android:layout_marginTop="16dp"
        android:onClick="btnUnloadUnity"
        android:text="Finish"
        app:layout_constraintStart_toEndOf="@+id/button"
        app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
```

{% endcode %}

4. Modify the layout code of the default file `activity_main.xml` to load the `activity_main_unity.xml` file from above.

{% code title="activity\_main.xml" %}

```xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <include layout="@layout/activity_main_unity" />

</androidx.constraintlayout.widget.ConstraintLayout>
```

{% endcode %}

5. Then add a new string resource with the name `game_view_content_description`and the content `Game view` in the `strings.xml` file.

<pre class="language-git"><code class="lang-git">&#x3C;resources>
<strong>+    &#x3C;string name="game_view_content_description">Game view&#x3C;/string>
</strong>&#x3C;/resources>
</code></pre>

Once you have completed all the necessary steps to integrate the ARwayKit Unity SDK into your Android Java project, you are ready to build, run, and debug your app. If everything has been properly configured, you should be able to run the app seamlessly with the ARwayKit Unity SDK.

Unity will run in another process android:process=":Unity" (AndroidManifest.xml at app module).

{% hint style="info" %}
Additional information about integrating Unity as a library into a standard Android app can be found in the following links:&#x20;

<https://github.com/Unity-Technologies/uaal-example/blob/uaal-example/19LTS-21LTS/docs/android.md>

<https://docs.unity3d.com/2019.3/Documentation/Manual/UnityasaLibrary.html>
{% endhint %}


# iOS Swift

Introduction to using ARwayKit SDK with iOS Swift

## What is iOS Swift?

Welcome to the world of iOS development with Swift! Swift is a modern and powerful programming language that has been specifically designed to make app development for Apple's ecosystem, including iPhone, iPad, and Mac, faster and more intuitive. It is also an open-source language, which means it is constantly evolving and improving with contributions from a global community of developers.

## Key Features:&#x20;

* **Optionals:** Optionals are a unique feature in Swift that allows developers to deal with nil values (i.e., absence of a value) in a safe and efficient manner. With optionals, you can explicitly declare whether a variable can be nil or not. This helps to avoid runtime errors caused by trying to access a nil value, which is a common source of crashes in other programming languages.
* **Type Safety:** Swift is a statically typed language, which means that every variable, constant, and function parameter must have a specific type declared at compile time. This helps to catch errors at compile time rather than runtime, leading to safer and more reliable code. Swift also supports type inference, so the compiler can often infer the type of a variable based on its value, reducing the need for explicit type declarations.
* **Generics:** Generics is a powerful feature in Swift that allows you to write flexible and reusable code. With generics, you can create functions, classes, and data types that can work with any type, rather than being limited to a specific type. This can save time and reduce the amount of code you need to write, while also making your code more generic and adaptable. Generics are used extensively in Swift's standard library, and are also commonly used in third-party frameworks and libraries.

## Why use ARwayKit with iOS Swift?&#x20;

Using ARwayKit with iOS Swift allows developers to integrate ARwayKit into their existing iOS apps, without having to rebuild the app from the ground up in Unity. This saves time and effort, and enables developers to leverage the power of ARwayKit to create engaging, interactive AR experiences for their users.

## **Components of ARwayKit SDK + Swift:**

* **iOS Swift:** Your new/existing project used for the integration with ARwayKit Unity SDK.
* **ARway Maps Studio:** A one-stop place for creating and editing maps, adding floor plans for navigation along with overlaying 3D assets, waypoints, destinations, text, and pictures over it.
* **ARwayKit SDK:** Our Unity SDK for linking the AR experiences created here and adding them to the iOS application as a page/scene.


# Quickstart in iOS Swift

Integrate the ARwayKit SDK with iOS Swift

In this quickstart guide, we will be integrating the ARwayKit SDK with iOS Swift. This example will be using [Unity as a Library](https://github.com/Unity-Technologies/uaal-example/blob/uaal-example/19LTS-21LTS/docs/ios.md) to integrate into an iOS app.

## Installed Versions

In this guide, we will be using the following versions:

* Xcode: 14.3
* Unity: 2022.3.29f1 LST

## Download the ARwayKit SDK

Download the ARwayKit SDK project from GitHub as a **ZIP**. You can [contact us](https://www.arway.ai/contact) for access to the ARwayKit SDK.

## Create a Basic Project in Xcode

For this example a new iOS app called "SwiftUnity" will be created with interface "Storyboard" and language "Swift".

## Generate the Build for the iOS Platform

{% hint style="info" %}
Make sure to add the Account ID and Secret Key variables to the Unity project. Follow the guide for [Building from the Source Code](/arway-sdk/building-from-the-source-code) for instructions.
{% endhint %}

### **Updating the** Addressables Groups

When opening the project in Unity for the first time, you will need to build the Addressables Groups.

1. Switch the build platform to either iOS or Android
   * "File-> Build Settings..." then select the Android or iOS as the Platform.
2. Click "Switch Platform" on the bottom right.
3. Navigate to "Window -> Asset Management -> Addressable -> Groups".
4. In the Addressables Groups window, click on "Build -> New Build -> Default Build Script".
5. In the Console window, you should see the success message "Addressable content successfully built".

{% hint style="info" %}
When making any changes that affect localization strings, you will need to update the Addressables Groups.
{% endhint %}

### **Building the Project**

**Steps**

1. In Unity select File -> Build Settings.
2. Switch the Platform to iOS.
3. Select option "Build Project".

<figure><img src="/files/3tK8dGP7e4O9aOiIK8DU" alt=""><figcaption><p>Build the project, this example will run it as debug.</p></figcaption></figure>

4. Export the ARwayKit Unity SDK to a new folder and name it "iOSBuild" and place it in the base directory for the iOS project.

## **Setup Xcode workspace**

Xcode workspace allows to work on multiple projects simultaneously and combine their products

1. Open your Xcode project.
2. Create workspace and save it as both.xcworkspace. (File / New / Workspace).\
   ![](/files/qbAnwcTPIHgVaTlPjSvP)
3. All the steps are done from just created Workspace project.
4. Add SwiftUnity.xcodeproj and generated Unity-iPhone.xcodeproj from step #2 to workspace on a same level ( File / Add Files to “both” ).\
   ![](/files/riwous86HLKUut8fW4wB)

### **Add UnityFramework.framework**

With this step we add Unity player in the form of a framework to NativeiOSApp, it does not change the behavior of NativeiOSApp yet

1. Select NativeiOSApp target from NativeiOSApp project.
2. In "General" tab / "Frameworks, Libraries, and Embedded Content" press **+**.
3. Add Unity-iPhone/UnityFramework.framework.

   <figure><img src="/files/CjQokQ1x9cuz5CSXgxfd" alt=""><figcaption></figcaption></figure>
4. In "Build Phases" tab, expand "Link Binary With Libraries".
5. Remove UnityFramework.framework from the list (select it and press **-** ).

   <figure><img src="/files/7dNxEUmAqGciY6EYfCQX" alt=""><figcaption></figcaption></figure>

### **Make Data folder to be part of the UnityFramework**

By default Data folder is part of Unity-iPhone target, we change that to make everything encapsulated in one single framework file.

1. Change Target Membership for Data folder to UnityFramework.

   <figure><img src="/files/XfKk2hbsbZkwSAPnp1a8" alt=""><figcaption></figcaption></figure>

Next, open **Info.plist** and add the following rows:

* Privacy - Microphone Usage Description: Used for creating audio content
* Privacy - Camera Usage Description: Used for AR Content and mapping
* Privacy - Location Usage Description: Used to attach maps with global coordinates and public map searching
* Privacy - Location When in Usage Description: Used to attach maps with global coordinates and public map searching
* Privacy - Photo Library Usage Description: This app requires access to save media
* Privacy - Photo Library Additions Usage Description: This app requires access to save media

<figure><img src="/files/rFqMGDFZo0lZlCucxJ4J" alt=""><figcaption></figcaption></figure>

### Swift Code

To create an entry point to SwiftUI, create a new SwiftUI view called **ContentView\.swift** and add a single button to launch ARway.

{% code title="ContentView\.swift" %}

```swift
import SwiftUI

struct ContentView: View {
    var body: some View {
        Button(action: {
            Unity.shared.show()
        }) {
            Text("Launch ARway!")
        }
    }
}
```

{% endcode %}

Next, update the **ViewController.swift** file to match the following.

{% code title="ViewController.swift" %}

```swift
import UIKit
import SwiftUI

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        let vc = UIHostingController(rootView: ContentView())
        addChild(vc)
        vc.view.frame = self.view.frame
        view.addSubview(vc.view)
        vc.didMove(toParent: self)
    }
}

```

{% endcode %}

Next, implement the connection between the Unity SDK and the Swift app. A new singleton called **Unity.swift** is created with the following code.

{% code title="Unity.swift" %}

```swift
import Foundation
import UnityFramework

class Unity: UIResponder, UIApplicationDelegate {
    static let shared = Unity()

    private let dataBundleId = "com.unity3d.framework"
    private let frameworkPath = "/Frameworks/UnityFramework.framework"

    private lazy var unityFramework: UnityFramework? = {
        guard let bundle = loadUnityFramework() else {
            return nil
        }
        let ufw = bundle.principalClass?.getInstance()
        ufw?.setDataBundleId(dataBundleId)
        ufw?.register(self)
        return ufw
    }()

    private var hostMainWindow: UIWindow?

    private var isInitialized: Bool {
        unityFramework?.appController() != nil
    }

    func show() {
        guard isInitialized else {
            initWindow()
            return
        }
        showWindow()
    }

    func setHostMainWindow(_ hostMainWindow: UIWindow?) {
        self.hostMainWindow = hostMainWindow
    }

    private func initWindow() {
        guard !isInitialized else {
            showWindow()
            return
        }
        guard let unityFramework = unityFramework else {
            print("ERROR: Was not able to load Unity")
            return unloadWindow()
        }
        self.unityFramework = unityFramework
        unityFramework.runEmbedded(withArgc: CommandLine.argc, argv: CommandLine.unsafeArgv, appLaunchOpts: nil)
    }

    private func showWindow() {
        guard let unityFramework = unityFramework else {
            return
        }
        unityFramework.showUnityWindow()
    }

    private func unloadWindow() {
        guard let unityFramework = unityFramework else {
            return
        }
        unityFramework.unloadApplication()
    }

    private func loadUnityFramework() -> Bundle? {
        let bundlePath = Bundle.main.bundlePath + frameworkPath
        guard let bundle = Bundle(path: bundlePath), !bundle.isLoaded else {
            return nil
        }
        do {
            try bundle.loadAndReturnError()
        } catch {
            print("ERROR: Failed to load Unity framework: \(error)")
            return nil
        }
        guard unityFramework?.appController() == nil else {
            return bundle
        }
        let machineHeader = UnsafeMutablePointer<MachHeader>.allocate(capacity: 1)
        machineHeader.pointee = _mh_execute_header
        unityFramework?.setExecuteHeader(machineHeader)
        return bundle
    }
}

extension Unity: UnityFrameworkListener {
    func unityDidUnload(_ notification: Notification!) {
        unityFramework?.unregisterFrameworkListener(self)
        unityFramework = nil
        hostMainWindow?.makeKeyAndVisible()
    }
}
```

{% endcode %}

Next update the **AppDelegate.swift** file to pass the main window reference to Unity.

{% code title="AppDelegate.swift" %}

```swift
import UIKit

@main
class AppDelegate: UIResponder, UIApplicationDelegate {
    var window: UIWindow?
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        Unity.shared.setHostMainWindow(window)
        return true
    }
}
```

{% endcode %}

You should now be able to build and run the project on an iOS device.

{% hint style="info" %}
To run the app, you will need to use a physical device and not a simulator.
{% endhint %}

{% hint style="info" %}
Additional information about integrating Unity as a library into a standard iOS app can be found in the following links:&#x20;

<https://github.com/Unity-Technologies/uaal-example/blob/uaal-example/19LTS-21LTS/docs/ios.md>

<https://docs.unity3d.com/2019.3/Documentation/Manual/UnityasaLibrary.html>
{% endhint %}


# What is Deep Linking?

### What is Deep Linking?

Deep linking is a mechanism that allows users to open specific content or scenes within an app directly from an external source, such as a QR code. In the context of ARway and Unity, deep linking enables users to launch the ARMapSession scene within the ARway app by simply scanning a QR code with their mobile device.

### How Does Deep Linking Work?

Deep linking relies on specific file formats and configurations to function correctly on different mobile platforms:

#### iOS

* [apple-app-site-association](https://developer.apple.com/documentation/xcode/supporting-associated-domains): For iOS, deep linking is supported through the `apple-app-site-association` file. This JSON file must be hosted on the domain that the app is associated with.
* The file contains information about the allowed app IDs and the paths they can handle.
* When a user clicks on a deep link, iOS checks the `apple-app-site-association` file on the corresponding domain to determine if the app is registered to handle the link. If it is, the app is opened, and the specific content or feature associated with the deep link is displayed.

#### Android

* [assetlinks.json](https://developer.android.com/training/app-links/verify-android-applinks): For Android, deep linking is facilitated by the `assetlinks.json` file. Similar to iOS, this JSON file must also be hosted on the domain associated with the app.
* The file specifies the relationship between the web domain and the app, along with the app's package name and fingerprint of the signing key.
* When a user clicks on a deep link, Android checks the `assetlinks.json` file on the corresponding domain to verify the app's association. If validated, the app is launched, and the user is taken to the relevant content or functionality.

### Benefits of Deep Linking

* **Enhanced User Experience**: Deep linking improves the user experience by enabling seamless transitions between apps and providing direct access to desired content.
* **Increased App Engagement**: By directing users to specific content or features, deep linking encourages higher app engagement and reduces the chances of user drop-offs.


# Creator Portal Changes

The Deeplink Domain feature allows you to add a custom domain to QR codes downloaded from the ARway Creator Portal. You can easily set up a new domain or revert to the default settings whenever needed. Let's get started!

### Adding a Custom Domain

{% hint style="info" %}
When choosing a custom domain, the total number of characters for the subdomain, main domain, and top-level domain should not go over 30.
{% endhint %}

1. In the "For Developers" page, find the "Deeplink Domain" section.
2. You will see a text input box where you can enter your desired custom domain, e.g., [https://a.arway.ai](https://anchor.arway.ai).
3. Type in your new domain name in the text input box.
4. After entering the custom domain, click the "Save" button to save your changes.

<figure><img src="/files/W0NlO51a6dv2eLmMV2am" alt=""><figcaption></figcaption></figure>

### Updated QR Codes

1. After clicking the "Save" button, all the QR codes in the ARway Creator Portal will be automatically updated to reflect the new custom domain you entered.
2. Any QR code you download from now on will point to the new domain you set.

{% hint style="info" %}
You will need to **re-download** and **replace** existing QR codes for them to point to your new custom domain.
{% endhint %}

### Removing the Custom Domain

1. If you wish to revert your changes and remove the custom domain, go to the "Deeplink Domain" section again.
2. Click the "Remove" button, which will remove the custom domain and restore the default settings.


# Modifying the SDK

ARway Unity SDK allows you to create and customize deep links for your augmented reality (AR) experiences. Deep links can be used to direct users to specific content within your AR app. By default, the ARway SDK uses the URL 'anchor.arway.ai', but you may want to use your custom domain URL for branding purposes.

By default, the Sample App can scan QR codes with the custom domain you have set, but there are a few changes that should be made for Android and iOS for deep linking.

### Update the DomainHandler in the Dashboard-SDK scene

1. Open the Dashboard-SDK scene located at `/Assets/ARway/ViewerMode/0_Scene`.
2. Select the DomainHandler object.
3. In the Inspector window, edit the DOMAIN under the Domain Handler (Script) to your custom domain URL.

<figure><img src="/files/JtUgFQyNqznmkbw8VK9W" alt=""><figcaption><p>Editing the DOMAIN in the Dashboard-SDK scene</p></figcaption></figure>

### Modify the SDK Files

To change the URL from 'anchor.arway.ai' to your custom domain URL '[www.yourdomain.com](http://www.yourdomain.com)', you need to modify the following files in the ARway Unity SDK:

1. Android: AndroidManifest.xml&#x20;
2. iOS: entitlements fille

### iOS

#### Modifying the entitlements file

1. Open your project in Xcode.
2. Choose your target, in this case it is Unity-iPhone.
3. Access the "Capabilities" tab.
4. Scroll down to "Associated Domains".
5. Click the Add button (+) to insert a service-domain placeholder.
6. Add your domain link, like `applinks:www.yourdomain.com`.
7. Save your changes and build your app.

<figure><img src="/files/epSEk3VHRUafvYVEa83s" alt=""><figcaption></figcaption></figure>

For more information view this link from the Apple docs:

{% embed url="<https://developer.apple.com/documentation/xcode/configuring-an-associated-domain>" %}

### Android

#### Modifying `AndroidManifest.xml`

Path: `Assets/ARwayKitSDK/Plugins/Android/AndroidManifest.xml`

1. Open the 'AndroidManifest.xml' file in a text editor or within Unity's editor.
2. Locate the deep link URL in the file, which should look like this:

   ```xml
   <data android:host="anchor.arway.ai" />
   ```
3. Replace the existing URL with your custom domain URL '[www.yourdomain.com](http://www.yourdomain.com)':

   ```xml
   <data android:host="qr.yourdomain.com" />
   ```

### Rebuild the App

After making the necessary modifications to the SDK files, follow these steps to rebuild the app on your device:

1. Save all the modified files.
2. In Unity, go to 'File' > 'Build Settings'.
3. Select your target platform (e.g., Android / iOS).
4. Click on 'Build and Run' to rebuild the app with your custom deep link URLs.


# Configuring Server Files

Configuring apple-app-site-association, assetlinks.json, and the redirection.html files

Mobile app deep linking enables seamless navigation between web pages and app content, enhancing the user experience and engagement. To implement deep linking on iOS (using `apple-app-site-association`), Android (using `assetlinks.json`) and the app redirect (using `redirection.html`), follow the instructions below.

### Apple App Site Association (`apple-app-site-association`)

**1. Create the File:**

* Create a JSON file named `apple-app-site-association` (with no file extension) using a text editor.

**2. JSON Structure:**

* The `apple-app-site-association` file should contain a JSON object with the following structure:

<pre class="language-json" data-title="apple-app-site-association"><code class="lang-json"><strong>{
</strong>  "applinks": {
    "apps": [],
    "details": [
      {
        "appID": "&#x3C;TeamID>.&#x3C;BundleID>",,
        "paths": [
          "*"
        ]
      }
    ]
  }
}
</code></pre>

* Replace `<TeamID>` with your Apple Team ID and `<BundleID>` with your app's Bundle ID.

**3. Specify Associated Domains:**

* In your Xcode project, go to the "Signing & Capabilities" tab.
* Enable the "Associated Domains" capability.
* Add the domain(s) and paths that you want to associate with your app using the `applinks:<domain>` format.

**4. Add the File to the Server:**

* Place the `apple-app-site-association` file at the root of your domain (e.g., `https://www.yourdomain.com/.well-known/apple-app-site-association`).

**5. Test Universal Links:**

* Deploy your app on a testing device through TestFlight or other testing methods.
* Ensure the app is associated with the correct domain and paths.
* Open a link that matches the specified domain and path on your testing device. It should open the app directly to the specified content.

### Android Digital Asset Links (`assetlinks.json`)

**1. Create the File:**

* Create a JSON file named `assetlinks.json` using a text editor.

**2. JSON Structure:**

* The `assetlinks.json` file should contain a JSON array with the following structure:

{% code title="assetlinks.json" %}

```json
[
  {
    "relation": ["delegate_permission/common.handle_all_urls"],
    "target": {
      "namespace": "android_app",
      "package_name": "your.app.package",
      "sha256_cert_fingerprints": ["<SHA256_Fingerprint>"]
    }
  }
]
```

{% endcode %}

* Replace `your.app.package` with your Android app's package name.
* Obtain the `<SHA256_Fingerprint>` by running the following command:
* ```
  keytool -list -v -keystore your_keystore.keystore
  ```

**3. Add the File to the Server:**

* Place the `assetlinks.json` file at the root of your domain (e.g., `https://www.yourdomain.com/.well-known/assetlinks.json`).

### Redirecting to the Apple App Store & Google Play Store (`redirection.html`)

**1. Create the File:**

* Create a JSON file named `redirection.html`using a text editor.

**2. HTML Structure:**

* The `redirection.html` file should contain the following structure:

{% code title="redirection.html" %}

```html
<html>
<head>
   <meta http-equiv=Content-Type content="text/html; charset=windows-1252">
</head>
<body>

<script>
    const getMobileOS = () => {
        const ua = navigator.userAgent;
        let redirectUrl;
        
        const androidUrl = "https://play.app.goo.gl/?link=https://play.google.com/store/apps/details?id=your.app.package";
        const iOSUrl = "https://apps.apple.com/us/app/your-app-name/id123456789";
        const nonMobileUrl = "https://www.arway.ai/";
        
        if (/android/i.test(ua)) {
            redirectUrl = androidUrl;
        } else if (/iPad|iPhone|iPod/.test(ua)) {
            redirectUrl = iOSUrl;
        } else {
            redirectUrl = nonMobileUrl;
        }
        
        setTimeout(() => {
            window.location.href = redirectUrl;
        }, 3000);
    };
    
    getMobileOS();
</script>

</body>
</html>

```

{% endcode %}

* Replace the variables androidUrl and iOSUrl with your own app store links.
* Replace the variable nonMobileUrl with a fallback link in the case that someone is opening the link from a non-mobile device.

**3. Add the File to the Server:**

To achieve the desired behavior where any URL in the format of `https://qr.yourdomain.com/{*}` is redirected to the "redirection.html" file, you need to set up server configuration rules.

Keep in mind that the implementation specifics may vary depending on the web server you are using (e.g., Apache, Nginx) and the server-side scripting language (e.g., PHP, Node.js) you have at your disposal. The redirection can be achieved through server configuration files or using server-side code to handle the redirection logic.

### Additional Path Parameters

Path parameters in deep linking simplify user access by directing them to specific content or features within apps, aiding personalization and tracking. They enhance sharing and engagement, offering a seamless experience.

Include paths in the Deeplink Domain on the 'For Developers' page of the Creator Portal if you want to add these extra path parameters.

<figure><img src="/files/MWLy99irhtZTD7H3ntfK" alt=""><figcaption></figcaption></figure>

More information on path parameters for deep links can be found below.

{% embed url="<https://developer.apple.com/documentation/xcode/allowing-apps-and-websites-to-link-to-your-content>" %}
iOS allowing apps and websites to link to your content
{% endembed %}

{% embed url="<https://developer.android.com/guide/navigation/design/deep-link>" %}
Android deep linking
{% endembed %}

### Verifying Deep Link Setup

To verify that your deep link setup is working correctly, you can use Branch's ["Associated Domains" validation tool](https://branch.io/resources/aasa-validator/) to test your `apple-site-association` file and follow this [developer guide](https://developer.android.com/training/app-links/verify-android-applinks) for your `assetslinks.json` file.


# Support

Need to get in touch with someone from ARway?

## Community Forum

Reach out to our community forums for support - <https://www.arway.ai/forum>


