Webpage controls Android Unity App?

Hi everyone,
I am developing a VR android mobile app in unity, however, how can I achieve that from a webpage can control some parts of the VR android app. I mean, in the webpage I have a button that says “Run App”, then when I click in that button, the VR android app open. How can be done this? Do you recommended me some tutorials ?

Thanks :slight_smile:

Hi, you need to use deep links. Here you can find plugin for realize it.

There is a set of tools for Unity to allow handling deeplink activation from within Unity scripts, for Android and iOS, including iOS Universal Links.


Clone/download the repository

Copy the entire UnityDeeplinks folder into your Unity project Assets folder

Attach the Assets/UnityDeeplinks/UnityDeeplinks.cs script to an empty UnityDeeplinks game object

Subclass the default UnityPlayerActivity in order to add deeplink-handling code that marshals deeplinks into your Unity script:

Replace the default UnityPlayerActivity in your Assets/Plugins/Android/AndroidManifest.xml with com.trophit.MyUnityPlayerActivity:

<activity android:name="com.unity3d.player.UnityPlayerActivity" ...
<activity android:name="com.trophit.MyUnityPlayerActivity" ...

Add the following inside the same activity tag, assuming your deeplink URL scheme is myapp://

    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
    <data android:scheme="myapp" />

I hope this will help You.

Hi, in Assets/Plugins/Android/AndroidManifest-Cardboard there is no <activity android:name="com.google.unity.GoogleUnityActivity" , there is that part only in AndroidManifest-Cardboard. Also, where is “myapp”? and how the button in the webpage can open the app in this way? Thanks