πŸš€ How to build Sample Dapp

Building Sample Dapp

This page describes how to build and run Sample DApp using Unity SDK.

If you add the ~/Assets/haechi.face.unity.sdk/Samples/SampleDapp/SampleWebviewUI.Prefab Prefab to Scene, it appears as shown in the image below.

After changing 'Main Camera' Background color as white and 'Importing TMP Essentials', you can find our Face Wallet Sample Dapp :tada:

1440 1440

Sample Dapp only supports (Old) input system. In EDIT > Project Settings > Player > Active input Handling, set the value to Input Manager (Old).

1440

Android

IMPORTANT: Before build Sample Dapp on Android platform, please put our AndroidManifest.xml on your project on the path of Assets/Plugins/Android/AndroidManifest.xml. And update build settings to include this manifest on the 'Project Settings' > 'Player' > 'Android' > 'Publishing Settings' > 'Build' section.

  1. Install Android Studio, set the Android simulator or prepare a real device. Please refer to here for the simulator setting method.
  2. If the Android simulator or device is ready, complete the Unity build settings.
    • Move to Unity 'File'> 'Build Settings' menu. Change the platform to Android.
1440
- Select the device to run from the β€˜Run Device’ item.
  1. Run through β€˜Build and Run’. It may take some time depending on the development environment. When the build is finished, the result is installed and executed in the Android emulator or device.

iOS

  1. Install XCode and prepare iOS virtual devices or devices. For how to set up a virtual device, see [here](https://developer.apple.com/documentation/xcode/running-your-pp- in-simulator-n-a-device).
  2. After changing the platform to iOS in 'Build Settings', you need to select whether to use a virtual device or actual device. Go to β€˜β€˜Player Settings’ > β€˜Other Settings’ > β€˜Target SDK’ and select a Device Type.
1440
  1. Run through β€˜Build and Run’. It may take some time depending on the development environment. When the build is finished, the result is installed and executed in iOS virtual devices or devices.

WebGL

  1. On the Player Settings > Resolution and Presentation tab, you should select WebGL Template with FaceTemplate just like the image.
1440
  1. Build WebGL by the Build button. It may take some time depending on the development environment. When the building is finished, the result is in your selected directory.
  2. With the build files, you need to host a server with port 9090. http://localhost:9090 is whitelisted. Other domains or ports will not be able to run Face Wallet properly.
  • Simply, run python3 -m http.server 9090 command where the build files exist.
  1. You can find the Demo here